dashjoin / json-schema-form

Angular JSON Schema Form Library
https://dashjoin.github.io/
Apache License 2.0
84 stars 27 forks source link

Ordered schema with properties that have title will throw errors #179

Open sneaker102 opened 1 month ago

sneaker102 commented 1 month ago

Using the version 1.0.3 with the order capability I encounter the next bugs: Given schema: { "type": "object", "order": [ "version", "name" ], "properties": { "name": { "type": "string", "title": "Name title" }, "version": { "type": "number", "title": "Version title" } } } Will throw this error : image image

And given this schema { "type": "object", "order": [ [ "version", "name" ] ], "properties": { "name": { "type": "string", "title": "Name title" }, "version": { "type": "number", "title": "Version title" } } } Will throw this error: image image

This is because the properties keys are the name of a specific child schema and the order and required arrays are using this keys but inside the BaseComponent you modify the name by assigning the title and the getState function from ObjectComponent will return undefined.

image image image

sneaker102 commented 1 month ago

Also if the property "order" is an empty array nothing will be displayed.