-
Notifications
You must be signed in to change notification settings - Fork 96
fix: resolve JSON schema $ref/$defs for UI display of titles and descriptions #8805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…riptions When users provide JSON schemas with $ref and $defs/definitions (e.g., in Parse JSON actions or Request triggers), the referenced definitions' titles, descriptions, and other metadata were not displayed in the designer UI. Root cause: The SchemaProcessor only handled cyclical $refs left over from Swagger dereferencing. For standalone user-provided schemas, $ref pointers against $defs/definitions were never resolved, causing all metadata to be lost. Changes: - Add dereferenceJsonSchema() utility that resolves local $ref pointers in standalone JSON schemas against their own $defs or definitions - Integrate it in getUpdatedManifestForSchemaDependency() to dereference user-provided schemas before they reach SchemaProcessor - Add $ref and $defs to IJsonSchema type for Draft 2019-09+ support - Add 13 unit tests covering all resolution scenarios Closes #8689
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | Title is good; optional minor rewording suggested |
| Commit Type | ✅ | Correct (fix) |
| Risk Level | ✅ | Low matches code changes and label |
| What & Why | ✅ | Clear and complete |
| Impact of Change | ✅ | Good coverage for Users/Developers/System |
| Test Plan | ✅ | Unit tests present and match claims |
| Contributors | Optional: add credits if applicable | |
| Screenshots/Videos | Optional: add before/after screenshot for UI |
Final message:
This PR passes the PR title/body checklist. The commit type and risk level are correctly selected and the risk:low label matches the declared Low risk. The PR body includes a clear What & Why, a detailed Impact section, and a matching Test Plan — and the diff includes the new utility, its export, the call sites, and comprehensive unit tests.
Minor, optional suggestions:
- Consider adding a short E2E/integration test that exercises the designer path (schema -> manifest -> UI) to lock in the user-visible behavior.
- Optionally include before/after screenshots demonstrating the UI change for reviewers.
- If others contributed, consider listing them in Contributors for credit.
Please update only if you want to add the optional items above; otherwise this PR is good to merge. Thank you for the clear description and thorough unit tests!
Last updated: Wed, 11 Feb 2026 19:18:22 GMT
|
📊 Coverage check completed. See workflow run for details. |
1 similar comment
|
📊 Coverage check completed. See workflow run for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes issue #8689 where JSON schemas using $ref pointers to $defs or definitions don't display titles, descriptions, and other metadata in the Logic Apps designer UI. The fix adds a new dereferenceJsonSchema() utility that resolves local $ref pointers in user-provided schemas before they're processed by the SchemaProcessor, ensuring all metadata is preserved and displayed.
Changes:
- Added
$refand$defsproperties to theIJsonSchemainterface for JSON Schema 2019-09+ compatibility - Created
dereferenceJsonSchema()utility with cycle detection and JSON Pointer decoding per RFC 6901 - Integrated the utility into the designer library's schema processing pipeline
- Added comprehensive unit tests covering various scenarios including nested refs, cycles, and edge cases
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
libs/logic-apps-shared/src/utils/src/lib/models/openApiV2.ts |
Extended IJsonSchema interface with $ref and $defs properties to support JSON Schema Draft 2019-09+ |
libs/logic-apps-shared/src/parsers/lib/common/helpers/dereferenceJsonSchema.ts |
New utility function that resolves local $ref pointers with cycle detection and RFC 6901-compliant JSON Pointer decoding |
libs/logic-apps-shared/src/parsers/lib/common/helpers/__test__/dereferenceJsonSchema.spec.ts |
Comprehensive test suite with 13 test cases covering various dereferencing scenarios |
libs/logic-apps-shared/src/parsers/index.ts |
Exported the new dereferenceJsonSchema function for use across the codebase |
libs/designer/src/lib/core/utils/outputs.ts |
Integrated dereferenceJsonSchema() into the schema processing pipeline for Parse JSON actions and Request triggers |
libs/logic-apps-shared/src/parsers/lib/common/helpers/__test__/dereferenceJsonSchema.spec.ts
Show resolved
Hide resolved
libs/logic-apps-shared/src/parsers/lib/common/helpers/dereferenceJsonSchema.ts
Outdated
Show resolved
Hide resolved
libs/logic-apps-shared/src/parsers/lib/common/helpers/__test__/dereferenceJsonSchema.spec.ts
Show resolved
Hide resolved
libs/logic-apps-shared/src/parsers/lib/common/helpers/dereferenceJsonSchema.ts
Outdated
Show resolved
Hide resolved
…, add ~0 test, improve external URL test
|
📊 Coverage check completed. See workflow run for details. |
1 similar comment
|
📊 Coverage check completed. See workflow run for details. |
Commit Type
Risk Level
What & Why
When users provide JSON schemas with
$refand$defs/definitions(e.g., in Parse JSON actions or Request triggers), the referenced definitions' titles, descriptions, and other metadata are not displayed in the designer UI even though validation still works correctly.Root cause: The
SchemaProcessoronly handled cyclical$refs left over from Swagger dereferencing (via metadata). For standalone user-provided schemas,$refpointers against$defs/definitionswere never resolved, causing_dereferenceRefSchema()to return{}and all metadata (title, description, enum, etc.) to be lost.This PR adds a
dereferenceJsonSchema()utility that resolves local$refpointers in standalone JSON schemas against their own$defsordefinitionscontainers before they reachSchemaProcessor.Closes #8689
Impact of Change
$ref/$defsor$ref/definitionsin Parse JSON actions and Request triggers will now correctly display titles, descriptions, and other metadata from referenced definitions in the designer UI.dereferenceJsonSchema()utility available from@microsoft/logic-apps-shared.IJsonSchematype now includes$refand$defsproperties for JSON Schema Draft 2019-09+ support.$defsordefinitionsare present.Test Plan
$defsresolution (JSON Schema 2019-09+)definitionsresolution (Draft 4/7)$refs (definition referencing another definition)$refs$refs (kept unchanged)$defs)