Is there way to add to schema a new property in the code? (angular)

Hi, How can I add additional property to JSON schema just in time, I mean I write something like this => this.addProperty(Here goes object of new property for jsonschema)

I found that arrayControlProps has such method addItem(), but it requires path that I don’t know where to get from.

Hi @ContrRus! The addItem props is a function factory for adding instance values. This will not modify the JSON Scheme.

What you can do is construct a new schema and hand it over to the JSON Forms root component. If you prefer updating the schema from inside JSON Forms you need to use the JsonFormsAngularService. There you can use the setSchema method to hand over a new JSON Schema for your form.

Thank you for the reply @sdirix
You see, I have a form at first it is empty, but when I press the button for example like this
image

It will add a new property like that (here actually is used customRenderers)

Can I this this with JsonFormsAngularService and setSchema?

Yes this should not be a problem. If the button is outside of the form then just hand over a new JSON Schema to the root component, in case the button is rendered via JSON Forms custom renderers already you can use the service.