-
Notifications
You must be signed in to change notification settings - Fork 155
Description
Currently in jsonschemagen inlining of multivalued slots is assumed to be as a list.
i.e we can generate jsonschema that validates:
{"persons":
[
{
"name": "Bob",
"age": 42,
"gender": "male"
},
{
"name": "Alice",
"age": 37,
"gender": "female"
}
]
}however, linkml supports inlining as dicts
See https://linkml.io/linkml/schemas/inlining.html for inlining docs
here the identifier slot is used as a key, and the presence of the identifier is optional in the body of the dict
{"persons":
{
"Bob": {
"age": 42,
"gender": "male"
},
"Alice": {
"age": 37,
"gender": "female"
}
}
}however, currently jsonschemagen ignores the distinction between list and dict inlining, and always inlines as lists.
This has not been a problem for many schemas "in the wild" since inlining as lists is more common. But it does mean that currently the linkml metamodel (which uses inlining as dict extensively) does not self-validate
To support this the jsonschemagen will need to use the pattern described here:
https://stackoverflow.com/questions/27357861/dictionary-like-json-schema