json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

choose objects in array

Open manuliner opened this issue 3 years ago • 1 comments

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

manuliner avatar Dec 03 '20 18:12 manuliner

Use patternProperties

robocoder avatar Mar 23 '21 18:03 robocoder