Repository navigation
fix(jsonforms-renderers): scan nested and $ref schemas for conditional required - #117
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sthanikan2000
left a comment
There was a problem hiding this comment.
The scan looks right: I ran the suite and probed it against AJV, and the #115 example works end to end. Three things:
- The base is #112's branch, so Packages CI hasn't run. After #112 squash-merges, please
git rebase --onto mainand confirm CI is green. Please runpnpm linttoo; I saw possibleno-unnecessary-type-assertionatrequired.tslines 28, 108 and 115, which I couldn't confirm locally. - It has both
Type/ImprovementandType/Bug. This completes unreleased work, so I'd useskip-changelogand mention nested/$refin #112's Release notes. - Please change the title scope to
jsonforms-renderers. Optional: add a test for the self-referential$refguard.
|
@sthanikan2000 Thanks — addressed what we can before #112 merges:
|
43ed744 to
fecd594
Compare
Widen schemaHasConditionalRequired so nested if/then and local $refs are seen, cache the result per schema object, and keep enum-only oneOf on the fast path. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
fecd594 to
11cad85
Compare
Property-array dependencies report under keyword `dependencies`, so the asterisk hook missed them even though AJV enforces the constraint. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the non-blocking |
sthanikan2000
left a comment
There was a problem hiding this comment.
Re-checked on the rebased head. Through the real controls, nested if/then, a conditional behind a local $ref, and property-array dependencies all show the * when the condition holds and not otherwise. The schema-form dependencies claim in your comment is also correct. 587 tests pass, type-check is clean, and CI is green now that it targets main. Approving.
Non-blocking: the description still says "Stacked on #112 … rebase after #112 squash-merges", and the test-plan boxes are unchecked. Worth cleaning up before merge.
Summary
Follow-up to #112 / closes #115.
schemaHasConditionalRequirednow walks the whole schema (properties, items, then/else, etc.), follows local$refs into$defs/definitions, and caches the result per schema object in aWeakMap. Property-level enumoneOfthat only listsconstoptions stays on the fast path; branches that addrequiredor further conditionals do not.Type of change
Release notes
N/A — covered in #112's release notes (nested /
$refconditionals). Useskip-changelogon this PR.Test plan
if/thenunderpropertiesenables the AJV-backed asterisk path$refinto$defswith a conditional is detected$refdoes not looponeOfstill skips AJV when there is no conditional requiredallOf/if/thenbehaviour from fix(jsonforms-renderers): show required asterisk for conditionally required fields #112 unchanged