fix – fixes incomplete scope generation in getScopesOfParsedJsonSche…#2177
fix – fixes incomplete scope generation in getScopesOfParsedJsonSche…#2177Adityakk9031 wants to merge 2 commits intojson-schema-org:mainfrom
Conversation
…a which ignored critical JSON Schema constructs.
|
Hi @Adityakk9031! Thanks a lot for your contribution! I noticed that the following required information is missing or incomplete: kind of change description Please update the PR description to include this information. You can find placeholders in the PR template for these items. Thanks a lot! |
|
Hi @Adityakk9031! Thanks a lot for your contribution! I noticed that the following required information is missing or incomplete: kind of change description Please update the PR description to include this information. You can find placeholders in the PR template for these items. Thanks a lot! |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2177 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 30 30
Lines 640 640
Branches 198 198
=========================================
Hits 640 640 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@Utkarsh-123github please have a look |
|
Thanks for PR, But as Utkarsh mention in your other issue about tagging multiple time please follow that strictly. |
|
@AgniveshChaubey sir please look this pr |
|
let's wait for someone who has better understanding of that section of code. |
|
@Utkarsh-123github sir please have a look |
What kind of change does this PR introduce?
Bug fix – fixes incomplete scope generation in
getScopesOfParsedJsonSchema, which previously ignored important JSON Schema constructs.Issue Number
Closes #2174
Summary
Previously, the
getScopesOfParsedJsonSchemautility only handled shallow schemas withtype: 'object'ortype: 'array', and completely ignored combinators (oneOf,anyOf,allOf), definitions (definitions,$defs), references ($ref), conditional schemas, and several other JSON Schema keywords. This led to incomplete scope generation and broke clickable documentation links and syntax highlighting in the JSON Editor for complex, real‑world schemas.This PR rewrites the function to recursively traverse all relevant JSON Schema constructs across multiple JSON Schema drafts, ensuring that scopes are generated for deeply nested and combined schemas used in production.
Changes
type: 'object'ortype: 'array'.processObjectProperties– handles property-like keywords such asproperties,definitions,$defs, and related object schema fields.processSchemasArray– handles arrays of schemas foroneOf,anyOf,allOf, tupleitems, and similar patterns.oneOf,anyOf,allOf,not.definitions(Draft 7) and$defs(Draft 2019‑09+).additionalProperties,unevaluatedProperties,propertyNames.itemsas array),prefixItems,additionalItems,unevaluatedItems,contains.if/then/else,dependentSchemas.properties,patternProperties, and single‑schemaitems.Screenshots / Videos
N/A – this is an internal utility function change.
To verify manually:
oneOf, definitions, and nested combinators.Does this PR introduce a breaking change?
No.
Documentation Updates
N/A.
Checklist
Please ensure the following tasks are completed before submitting this pull request.