josdejong / jsoneditor

A web-based tool to view, edit, format, and validate JSON
http://jsoneditoronline.org
Apache License 2.0
11.62k stars 2.05k forks source link

Add/Remove Array Elements in Form mode #1625

Open Flydroid opened 1 day ago

Flydroid commented 1 day ago

I'm using the "form" mode to allow users to values in json data. The data is also validated with a json schema.

For some data/schemas the users would need to add or remove array elements.

Is it possible to enable the custom action menu in "form" mode and configure it to only provide the add and remove functions on arrays?

josdejong commented 17 hours ago

The form mode is indeed quite limited, adding/removing array items would be very neat indeed. To to be able to support that though, we would need to know the structure of the array items: often, an array contains objects with specific properties. I think to propertly implement that, we need to require a JSON Schema document describing the structure.

I'm open to a PR solving this. Anyone interested in picking this up?