Skip to content
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 should allow $schema directive #383

Closed
5 tasks
aj-stein-nist opened this issue Jun 20, 2023 · 1 comment · Fixed by #384
Closed
5 tasks

Generated JSON schemas should allow $schema directive #383

aj-stein-nist opened this issue Jun 20, 2023 · 1 comment · Fixed by #384
Assignees
Labels
enhancement New feature or request XSLT Implementation Issue relates to the XSLT implementation of Metaschema.

Comments

@aj-stein-nist
Copy link
Collaborator

aj-stein-nist commented Jun 20, 2023

User Story:

As a developer using Metaschema, in order to benefit consumers of my Metaschema modules using their related JSON schemas, I would like the JSON schemas generated from modules to always allow the $schema directive.

NOTE: I tested the Java implementation of oscal-cli and its dependent libraries and as of 0.3.4-SNAPSHOT version the emitted schemas do allow for an optional $schema directive, but the XSLT-M4 implementation does not.

Goals:

  • Allow robust metaschema module generation of JSON schema to support common use cases
  • Align JSON schemas shape from schema generation in the Java and XSLT M4 implementations

Dependencies:

N/A

Acceptance Criteria

  • All website and readme documentation affected by the changes in this issue have been updated. Changes to the website can be made in the docs/content directory of your branch.
  • A Pull Request (PR) is submitted that fully addresses the goals of this User Story in make-json-schema-metamap.xsl. This issue is referenced in the PR.
  • The CI-CD build process runs without any reported errors on the PR. This can be confirmed by reviewing that all checks have passed in the PR.

{The items above are general acceptance criteria for all User Stories. Please describe anything else that must be completed for this issue to be considered resolved.}

@aj-stein-nist aj-stein-nist added enhancement New feature or request XSLT Implementation Issue relates to the XSLT implementation of Metaschema. labels Jun 20, 2023
@aj-stein-nist aj-stein-nist self-assigned this Jun 20, 2023
@aj-stein-nist
Copy link
Collaborator Author

I know as a group we discussed this recently. I looked in the backlog and I could not find this reported after all. I opened this issue, but let me know if it is a duplicate.

aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 20, 2023
For usnistgov#383, allow $schema so JSON schemas that are
emitted by the XSLT-M4 implementation allow downstream consumers to
optionally bind schema references into a document instances and not
immediately invalidate the schema.
@aj-stein-nist aj-stein-nist linked a pull request Jun 20, 2023 that will close this issue
7 tasks
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 23, 2023
For usnistgov#383, allow $schema so JSON schemas that are
emitted by the XSLT-M4 implementation allow downstream consumers to
optionally bind schema references into a document instances and not
immediately invalidate the schema.
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 23, 2023
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 23, 2023
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 23, 2023
For usnistgov#383, allow $schema so JSON schemas that are
emitted by the XSLT-M4 implementation allow downstream consumers to
optionally bind schema references into a document instances and not
immediately invalidate the schema.
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 23, 2023
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 23, 2023
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 26, 2023
For usnistgov#383, allow $schema so JSON schemas that are
emitted by the XSLT-M4 implementation allow downstream consumers to
optionally bind schema references into a document instances and not
immediately invalidate the schema.
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 26, 2023
@david-waltermire david-waltermire added this to the Metaschema 0.9.0 milestone Jun 26, 2023
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 27, 2023
Do not just compare the XML-based syntax tree of whole JSON schemas.
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 27, 2023
Do not just compare the XML-based syntax tree of whole JSON schemas.
aj-stein-nist added a commit to aj-stein-nist/metaschema that referenced this issue Jun 27, 2023
Do not just compare the XML-based syntax tree of whole JSON schemas.
david-waltermire pushed a commit that referenced this issue Jun 27, 2023
* Allow $schema in XSLT-generated JSON schemas

For #383, allow $schema so JSON schemas that are
emitted by the XSLT-M4 implementation allow downstream consumers to
optionally bind schema references into a document instances and not
immediately invalidate the schema.

* Remove maxProperties for #385.

* Update pre-existing and new tests for #383.

Do not just compare the XML-based syntax tree of whole JSON schemas.

* Update .gitignore per @wendellpiez feedback.

* Add code comment per @wendellpiez feedback.

Explain why we test with contains() and not matching the full field name in the updated
XSpec tests and try to reduce flakiness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request XSLT Implementation Issue relates to the XSLT implementation of Metaschema.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants