-
Notifications
You must be signed in to change notification settings - Fork 10
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
Generated JSON Schemas do not correctly serialize choice #105
Comments
It is awesome to see this with such specificity. However we aren't quite there yet to a spec - I would like to see the desired results for this:
? just a little closer to RL - though ph oscal-cli already does this correctly? comments, @aj-stein-nist ? |
Follow up question for @JustKuzya: is the "should look like" model sketch above showing the JSON schema produced by oscal-cli, by some other tool, or a correct design by 'dead reckoning'? Any answer is fine, and aligning with oscal-cli is especially fine. |
@JustKuzya won't But I am getting ahead of us. It is not really worth discussing until we have working and breaking examples of actual JSON. |
Behind #108 there is WIP towards supporting It also exposes the difficulty here*, namely a combinatorial explosion of subschemas to be listed under More research is called for. I would love extra eyes on this and suggestions are welcome: please comment or ping me. * I was pretty sure there was a reason we did not implement this sooner. |
As noted, significant work towards implementing (exclusive) 'choice' in metaschema-xslt JSON Schema production is now behind PR #108. This includes analysis and a solution for the 'expand model' step that rewrites options implied by
|
…, still wanting testing; with a small testing application
…, still wanting testing; with a small testing application
Refactoring submodules; XProc-based testing; XSpec testing of JSON Schema generation; improvements to JSON Schema generation - addressing #105 also #2007.
Includes updates to unit testing, Inspector XSLT, JSON Schema (#105) and others Co-authored-by: A.J. Stein <[email protected]>
* produce-xml-converter.xsl: XSpec tests and minor XSLT improvements (#87) * XSpec tests and minor XSLT improvements * JSON Schema generation improvements (#108) Refactoring submodules; XProc-based testing; XSpec testing of JSON Schema generation; improvements to JSON Schema generation - addressing #105 also #2007. * June 2024 Integration (#118) Integrating branches * June 2024 in-progress merge (#120) Includes updates to unit testing, Inspector XSLT, JSON Schema (#105) and others * More testing (#122) Mostly testing support - * Adding Makefile in compose phase to run XSpec - presently showing errors! * Extending and reorganizing testing, including removing temporary artifacts from git * Adding subpipeline mistakenly omitted from the last PR * New Makefile for testing/tinydata * Mending XSpecs testing Metaschema composition (regression protection); also a new tinydata sample. * Update src/testing/tinydata/tiny-data/terms-of-art.xml (AJ Stein) Co-authored-by: Wendell Piez <[email protected]> Co-authored-by: Amanda Galtman <[email protected]> Co-authored-by: A.J. Stein <[email protected]>
Describe the bug
When using metaschema-xslt as of
7d9fbfa84e78e4ba4dd950ad39c65738b7b66697
and also tested off of current develop (at ), Metaschema modules that define a<choice/>
are not correctly serializing the choice options correctly as one or N choices, but allowing any defined.Who is the bug affecting?
Tool developers relying on generated JSON schemas from this tool.
What is affected by this bug?
JSON Schema generation with models using
<choice/>
.When does this occur?
Consistently.
How do we replicate the issue?
Example model, current output, and desired outputs to follow in upcoming edits to this issue.
ajv
, or any other JSON Schema validator tool.JSON document instance:
Current JSON Schema:
Expected behavior (i.e. solution)
The generated JSON Schemas serialize
<choice/>
into a selection with JSON Schema'soneOf
syntax, notanyOf
.The target JSON Schema should look this:
Other Comments
N/A
The text was updated successfully, but these errors were encountered: