I have a JSON file which contains a list of items. The only thing stored in this file is the items as a array. e.g:
[
{...},
{...},
{...},
]
I want to define a schema file for this. This seems fine as the initial type can be set to array and I can define items as a type. But I want to reference the schema in the item json file. Unfortunately it is not an object so I cannot add the "$schema"
key. I could of course make the json a object with only one key that has the array value but this doesn't seem to be good design.
Does the schema system seems to have some design fault or is top level array json unsupported?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…