jdorn / json-editor

JSON Schema Based Editor
MIT License
5.8k stars 1.08k forks source link

choose objects in array #842

Open manuliner opened 3 years ago

manuliner commented 3 years ago

Hello,

first at all thank you for this great way to generate jsons.

i was wondering if it is somehow possible to achieve the following:

i have an array of objects pets each pet has it own values and therefore they are all different to each other.

cat:{ name: "", color:"", } dog:{ name:"", favorite toy:"" }

i would like to use your array function ( from the example page ) to add an object to the array but if i add an cat, the fields of the cat should appear. if i add an dog, the fields of the dog should appear.

thank you

manu

robocoder commented 3 years ago

Use patternProperties