fix(vue-vuetify): resolve a $ref on propertyNames in the additional-properties nested form#2603
Open
KiaraGrouwstra wants to merge 1 commit into
Open
Conversation
…yNames` The `additional-properties` (map) renderer builds the nested new-key form's schema by spreading `control.value.schema.propertyNames`. When `propertyNames` is a `$ref` into the root's `$defs` (the shape a schema that shares a named key type across many maps emits), the nested `json-forms` mounts it as its OWN root, where `#/$defs/...` does not exist. AJV then throws `can't resolve reference #/$defs/... from id #` and the map fails to render. Resolve the `$ref` against the real root schema (`control.value.rootSchema`, via `Resolve.schema` -- the same accessor the renderer already uses for the additional-properties value schema) before spreading, so the nested form gets a self-contained subschema. Adds a regression test mounting such a map and asserting the mount does not throw (`tests/unit/additional/AdditionalPropertiesRef.spec.ts`). Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Kiara Grouwstra <kiara.grouwstra@gmail.com>
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
KiaraGrouwstra
marked this pull request as ready for review
July 19, 2026 13:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolve a
$refon @vue-vuetifyadditionalProperties'propertyNamesagainst the root schema (control.value.rootSchema, viaResolve.schema) before spreading it into the nested form's schema.Further add a test verifying these are resolved with this change.
The
additional-properties(map) renderer builds the nested new-key form's schema by spreadingcontrol.value.schema.propertyNames. WhenpropertyNamesis a$refinto the root's$defs(the shape a schema that shares a named key type across many maps emits), the nested<json-forms>mounts it as its own root, where#/$defs/...does not exist. AJV then throwscan't resolve reference #/$defs/... from id #and the map fails to render.Disclaimer: I used a coding agent in the creation of this patch.