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

Fixed invalid schema generation test content #408

Conversation

david-waltermire
Copy link
Collaborator

Committer Notes

Updated invalid content causing tests to fail. Also alternated value named to make debugging easier.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you squashed any non-relevant commits and commit messages? [instructions]
  • Do all automated CI/CD checks pass?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all website](https://pages.nist.gov/metaschema) and readme documentation affected by the changes you made? Changes to the website can be made in the website/content directory of your branch.

@david-waltermire
Copy link
Collaborator Author

@wendellpiez As part of your review, please check if this change will break your tests.

@wendellpiez
Copy link
Collaborator

Executing these tests over generated schemas in metaschema-xslt is still a to-do, so this should have no direct impact.

However, there is a question of what may happen higher in the (refactored) stack, e.g. OSCAL, where tests are run over generated schemas.

@nikitawootten-nist @aj-stein-nist would you be able to confirm this is not a breaking change anywhere?

@wendellpiez
Copy link
Collaborator

@aj-stein-nist also, per our conversation - usnistgov/metaschema-xslt#56 provides a scaffolding for XProc-based schema testing including sets of known-valid and known-invalid instances; a next step would be harnessing this set of unit tests under it.

Except this is a JSON test. So, another thing we need to determine is how to run those under metaschema-xslt. Do we need to find a way to use XProc 3.0? https://spec.xproc.org/master/head/validation/#c.validate-with-json-schema

Copy link
Collaborator

@wendellpiez wendellpiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a sanity check here - 'prop1', 'prop2' and 'prop3' become the name property on the property (object) while 'value1'-'value3' are the (nominal) field values. But the error being corrected is actually the repeated ID, not the "prop1", which is actually permitted to be the name of the field in both places (according to the schema).

Suggestion (non-blocking) - since in OSCAL, prop objects are not fields but assemblies (with value flags), this is now somewhat confusing. Maybe the elements in the test need to be named something else, to illustrate this feature on fields?

@david-waltermire david-waltermire merged commit 550d876 into usnistgov:develop Aug 16, 2023
3 checks passed
@david-waltermire david-waltermire deleted the fix-json-value-key-schema-generation-tests branch August 16, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants