-
Notifications
You must be signed in to change notification settings - Fork 192
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
JSON Schema References are Incorrect #933
Comments
I just wanted to add a plus one on the object specific definitions - I understand the logic in that these are unique, however, I think referencing back to #731 it just spins the problem in a different way. Today from a final data point of view is This complexity makes it harder to use tooling like openapi efficiently. I think the ideal outcome is that the json schema object (from a json schema users perspective) can be generated as one global OSCAL schema. It does not have to be generated as a global schema, however, the names do need to be consistent such that a user could merge and do so themselves without creating a mess. |
@butler54, OpenAPI is exactly one of the reasons we're pursing this. We hope to put forward a proposal for the beginnings of an OSCAL REST OpenAPI definition (in a time frame closely aligned with OSCAL's 1.0 final release) that starts to explore how real world systems could map the relationships within and between the different OSCAL models. As part of this discussion though, we need to have clear schema definitions of which objects are in fact shared vs unique, not just based on name. For example, a |
If you are interested (or okay with) python this may be of interest (I won't claim it's perfect but we did get to an object model and at least you are able to build APIs quickly): https://github.com/IBM/compliance-trestle-flask-demo (Could not help the little plug for https://github.com/IBM/compliance-trestle) |
* Rework of docs focusing on JSON docs and model pipeline * Improvements to composition toolchain * Fixed a few small bugs in the metaschema-check. Improved performance of the compose pruning using an accumulator. * Moved edge-case samples into testing directory * Made shadowing warning a warning * Initial commit of an Oxygen Metaschema framework. * Creation of new compose schematron unit tests. * Cross-linking XML and JSON syntax pages and other improvements to links * Now building XML and JSON indexes to reference pages, with links to steps * Reconfigured docs pipeline (XSLT entry points); adding new files including pipeline steps * Migrating schema generation tools to new/improved composition pipeline * Addressing usnistgov/OSCAL#902 thanks for finding this bug * Enhancements to JSON Schema definition (with better performance too) * Adding support for json-base-uri as a metaschema property * Updated JSON schema $id; factoring out common docs XSLT * Fixing IDs in JSON schema per issue usnistgov/OSCAL#933. * Addressing datatype validation issues: whitespace collapsing; non-empty values; ncname-workalike in JSON Schema - see usnistgov/OSCAL#911 usnistgov/OSCAL#805 also #33 #67 #68 * Improvements to XSD production; fully aligning 'token' datatype across XSD and JSON Schema implementations. * Updating bidirectional XML/JSON converter generators (#143) * Committing a version that handles test data correctly (so far) from rebuilt metaschema composition addressing #51 #53 #76 * Now displaying constraints in documentation at point of definition; * Docs generation revamp Reworked reference and other pages to sketch - #128 and others Co-authored-by: Wendell Piez <wendell.piez@nist.gov>
This was addressed by PR #948, which has added support for a combined XML and JSON schema, along with model specific schema views. |
While this fix looks correct after a quick 'manual' spot check of the changes it unfortunately won't solve our issue since It would be nice if |
@rgauss would you be able to open a new ticket in the usnistgov/metaschema repo for this, possibly with a (tiny) mockup? We would gladly consider options and feasibility. There is a possibility that the Metaschema design would preclude doing this, but alternatively, maybe it is actually super-easy or could be made to be. We have to look. Thanks! |
@wendellpiez, submitted usnistgov/metaschema#160. Thanks! |
Here's an example of what the result might look like (and works with Swagger UI). |
* Rework of docs focusing on JSON docs and model pipeline * Improvements to composition toolchain * Fixed a few small bugs in the metaschema-check. Improved performance of the compose pruning using an accumulator. * Moved edge-case samples into testing directory * Made shadowing warning a warning * Initial commit of an Oxygen Metaschema framework. * Creation of new compose schematron unit tests. * Cross-linking XML and JSON syntax pages and other improvements to links * Now building XML and JSON indexes to reference pages, with links to steps * Reconfigured docs pipeline (XSLT entry points); adding new files including pipeline steps * Migrating schema generation tools to new/improved composition pipeline * Addressing usnistgov/OSCAL#902 thanks for finding this bug * Enhancements to JSON Schema definition (with better performance too) * Adding support for json-base-uri as a metaschema property * Updated JSON schema $id; factoring out common docs XSLT * Fixing IDs in JSON schema per issue usnistgov/OSCAL#933. * Addressing datatype validation issues: whitespace collapsing; non-empty values; ncname-workalike in JSON Schema - see usnistgov/OSCAL#911 usnistgov/OSCAL#805 also usnistgov#33 usnistgov#67 usnistgov#68 * Improvements to XSD production; fully aligning 'token' datatype across XSD and JSON Schema implementations. * Updating bidirectional XML/JSON converter generators (#143) * Committing a version that handles test data correctly (so far) from rebuilt metaschema composition addressing usnistgov#51 usnistgov#53 usnistgov#76 * Now displaying constraints in documentation at point of definition; * Docs generation revamp Reworked reference and other pages to sketch - #128 and others Co-authored-by: Wendell Piez <wendell.piez@nist.gov>
Describe the bug
Many of the
$ref
values in the JSON schema seem to be incorrect. As just one example, the catalog metadata revision property specifies an array of items with type"$ref" : "#/definitions/oscal-metadata-revision"
but I believe the definition has been renamed tooscal-catalog-oscal-metadata-revision
.These new object-specific definitions, such as
oscal-catalog-oscal-metadata-revision
, will also make it much more difficult to address an issue like #731 where we'd like to see common schemas for elements reused across different models, i.e. the profile model definesoscal-profile-oscal-metadata-revision
.Who is the bug affecting?
Anyone trying to resolve/leverage the JSON schema, this seems to affect all models.
What is affected by this bug?
The ability to properly parse/resolve the schema.
When does this occur?
Always
The text was updated successfully, but these errors were encountered: