-
Notifications
You must be signed in to change notification settings - Fork 415
Description
Describe the bug
Let's assume that we have a form with such a schema:
const schema = {
properties: {
someObject: {
type: "object",
additionalProperties: {
type: "string"
}
}
},
};when I try to use the form and add a new field to the object, the field gets inserted, but it's constantly empty when I insert text into the form.
{
"someObject": {
"someKey": ""
}
}After some debugging, I discovered that jsonforms/vue-vuetify tries to insert data into someObject.someKey.someKey field instead of someObject.someKey
Expected behavior
The value I inserted into the form should appear in the data
{
"someObject": {
"someKey": "my text"
}
}Steps to reproduce the issue
- Clone https://github.com/eclipsesource/jsonforms-vue-seed
- Remove
@jsonforms/vue-vanilla, installvuetifyand@jsonforms/vue-vuetify - Make necessary changes in
main.tsto enable vuetify - Change renderers in
App.vuetoextendedVuetifyRenderers - Change schema in
App.vueto something like this:
const schema = {
properties: {
someObject: {
type: "object",
additionalProperties: {
type: "string"
}
}
},
};
const uischema = {
type: "VerticalLayout",
elements: [
{
type: "Control",
scope: "#/properties/someObject"
}
],
};
const data = ref({
someObject: {}
});- Launch the application
- Insert the new key in the form, it should appear in the JSON data preview below the form
- Write some text in that value, it doesn't appear in the data preview
Screenshots
Which Version of JSON Forms are you using?
3.5.1
Package
Vue Vuetify Renderers
Additional context
I put a breakpoint in the mapStateToControlProps function in renderer.ts file and I discovered that the key name is duplicated in the property that jsonforms tries to modify

after some more digging, I think that the issue is in toAdditionalPropertyType function in AdditionalProperties.vue file
return {
propertyName: propName,
path: composePaths(control.value.path, propName),
schema: propSchema,
uischema: propUiSchema,
};when I removed the call to composePaths function
return {
propertyName: propName,
path: control.value.path,
schema: propSchema,
uischema: propUiSchema,
};But I don't know if such a fix breaks other things.

