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

Completed work reflecting schema version in XSD and JSON schema (#57) #415

Merged
merged 2 commits into from
Jun 11, 2019

Conversation

wendellpiez
Copy link
Contributor

@wendellpiez wendellpiez commented Jun 10, 2019

Committer Notes

Completing Issue #57 by adding version info to XSD and JSON Schema (but see comments for any unresolved questions).

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]

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)?

@wendellpiez
Copy link
Contributor Author

Current status:

  • New element schema-version is permitted (not required) at the top level of a metaschema
  • The metaschema Schematron checks for this value and issues a warning if it is not given (non-ws) - with current settings this is a blocking error even if XSD validation passes
  • In schema generation, it maps to a representation of the version in the XSD and JSON schemas as specified above (by a xs:schema/@version attribute or $id property)
  • Using this element, all the metaschemas (and hence all schemas) now also show <schema-version>1.0-M1</schema-version> (and validate with no warnings from Metaschema Schematron)
  • The metadata module declares element oscal-version for any metaschema that uses its metadata model; its value is still unconstrained
  • All the sample data (catalogs and profiles) show <oscal-version>1.0-M1</oscal-version> in their metadata

We could add a static or dynamic check for the value of oscal-version, in OSCAL instances, into a Schematron (cf #400 for gathering Schematron requirements).

We could also tighten the requirements by removing the test from the Metaschema Schematron and making the schema-version element required in the Metaschema XSD. The main question there is, is it an error if no version is given in a metaschema module that is never used for a schema directly, but only by calling from other modules. Without further qualification, a dummy value (i.e. <schema-version/>) would be XSD valid (one reason I opted for Schematron-only checking at present).

Copy link
Contributor

@david-waltermire david-waltermire left a comment

Choose a reason for hiding this comment

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

LGTM

@david-waltermire david-waltermire merged commit 0aa15e7 into usnistgov:master Jun 11, 2019
@david-waltermire david-waltermire deleted the issue57-revisited branch June 11, 2019 09:38
david-waltermire pushed a commit that referenced this pull request Jun 11, 2019
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