-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(converters): add option include descendants #1630
base: main
Are you sure you want to change the base?
Conversation
In draft status until tests are provided. Functional changes already available (manually tested) for preview. |
Thanks! I think in general there is less need of user control over this now we have: This keeps the default as false, but always allows class descendants if there is a type designator, which essentially allows the jsonschema validator to "choose" the intended one based on the value of the type designator. However, it's still good to have consistency in options and how options are passed through. Further discussion on dynamic typing: |
I think, I've understood it now! The option The type designators state explicitly of which subtype an object is, so no more duck typing needed. I haven't tested it yet, but I understand that once a type desingator has been used, descendant classes are automatically included for the subtypes. But not on those without type designators. I like it! |
5ad6263
to
491f9d6
Compare
I'm having difficulties to get this functionality working. I suspect that issue #1638 is the origin of the difficulties I'm facing. |
"gen-json-schema" and "linkml-validate" have the option "--include-range-class-descendants" so that children of a class specified in a range are added to the generated JSON-Schema as allowed classes. This patch adds a similar option to "linkml-convert", with the same result in the JSON-Schema being used for validation as the equally named option for "gen-json-schema" and "linkml-validate". Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
Extend "linkml-convert" tests to cover the new option "--include-range-class-descendants". Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
491f9d6
to
848810a
Compare
Apply same validation code as in 'linkml-validate' to include range class descendants. Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
"gen-json-schema" and "linkml-validate" have the option "--include-range-class-descendants" so that children of a class specified in a range are added to the generated JSON-Schema as allowed classes.
This patch adds a similar option to "linkml-convert", with the same result in the JSON-Schema being used for validation as the equally named option for "gen-json-schema" and "linkml-validate".
Closes #1629