-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add Metaschema support for valid value validation #437
Comments
7/11/2019This issue and the related ones (noted in #435 ) for the metaschema need to be reviewed together and unitested. However, more unit tests need to be created for the other features. |
* Supporting enumerated value lists on flags in XSD and JSON Schema #437 * Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values) * More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators #441 * Updating schemas to current model (transitional); updated docs in resulting XSD per #448; some updates to markdown documentation * Small updates to authoring CSS. * Added design notes on JSON schema bindings. * Including an initial set of unit tests for group-by, some data types, etc. * Updated to new design (#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now * Work on datatyping #436 including support in XML and JSON Schema * Addressed #451: parameter insertion syntax in Markdown * Schema documentation improvements #423 #424 #428 * Addressed feature request #438 * Improving handling of JSON 'key' and 'value-key' settings in docs #428 * Now producing XML and JSON model maps from metaschemas. * Now escaping {{ for Jekyll * Updated component metaschema based on design notes * Fixed schematron assertions to properly work with @ref. * Refactoring of component and SSP metachema. * Fixed website side navigation. Added component and SSP metaschema to site generation process. * Addressed comments in issue #445 * Added site content generation to runall.sh * Started documenting model changes in release notes. More work is still needed to complete this.
* Supporting enumerated value lists on flags in XSD and JSON Schema usnistgov#437 * Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values) * More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators usnistgov#441 * Updating schemas to current model (transitional); updated docs in resulting XSD per usnistgov#448; some updates to markdown documentation * Small updates to authoring CSS. * Added design notes on JSON schema bindings. * Including an initial set of unit tests for group-by, some data types, etc. * Updated to new design (usnistgov#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now * Work on datatyping usnistgov#436 including support in XML and JSON Schema * Addressed usnistgov#451: parameter insertion syntax in Markdown * Schema documentation improvements usnistgov#423 usnistgov#424 usnistgov#428 * Addressed feature request usnistgov#438 * Improving handling of JSON 'key' and 'value-key' settings in docs usnistgov#428 * Now producing XML and JSON model maps from metaschemas. * Now escaping {{ for Jekyll * Updated component metaschema based on design notes * Fixed schematron assertions to properly work with @ref. * Refactoring of component and SSP metachema. * Fixed website side navigation. Added component and SSP metaschema to site generation process. * Addressed comments in issue usnistgov#445 * Added site content generation to runall.sh * Started documenting model changes in release notes. More work is still needed to complete this.
@wendellpiez I don't think this has been fully implemented in JSON schema validation. We also don't have a unit test for this. |
Also to do on this Issue: wire datatype support into Metaschema Schematron so it can validate a set of valid values against a nominal (declared) datatype to ensure they are all acceptable as tokens of that type. Also, @anweiss suggests Metaschema require Short list:
|
…snistgov#437" This reverts commit 2e6944a.
…snistgov#437" This reverts commit 2e6944a.
Development on this is complete in PR #492. This is ready for review. |
* Removed unnecessary metaschema check on json-value-key * Now implementing in-xml="with-wrapper | unwrapped" on markup multiline fields, with default `with-wrapper` and corresponding changes to catalog and profile metaschemas. * Updating catalog and profile schemas for (prose) unwrapping behavior * Renamed 'json-behavior' in Metaschema to 'in-json' for consistency with 'in-xml'. * Updating syntax in metaschemas 'in-json' for 'json-behavior' * Updating json converter generator to provide in-xml behavior 'GROUPED' * Refining json converter production from Metaschema * Repairing egregious syntax error * Rectify bug introduced with new feature * Adding support for 'date' and 'dateTime' datatypes, with no time zones (#480), including unit tests * Improvements and corrections to datatypes docs * More small repairs on datatypes descriptions (table markup) * Built out validations of allowed (enumerated) values, including Metaschema validation checks on whether given allowed values conform to their nominal type. * Straightening kinks in datatype metaschema meta-validation * More special handling of recalcitrant datatypes, this time 'NMTOKENS' and 'IDREFS' * Addressing #463, adding `id`, `class` and `title` to `group` in profiles. * Schematron improvements; documentation revisions (removing references to subcontrols) * New Schematron for SP800-53-style catalogs * Removed using in implementation to new metaschema for storage. Started on example, which is still invalid * More work on an example, which is still not valid * refactored schematron processing * more work on SSP example * Refactored generate-schema.sh to allow a metaschema to be provided on the CLI * refactored SSP model to be more flat, while allowing component references * slight cleanup * old example * Fixed content generation * updated metaschema to new specs * fixed content errors * added metaschema examples * Updated metaschema example. * Adding 'prop' and 'part' to Profile Metaschema per #463 * Added 'param' to profile 'group' model * JSON converter now properly handling flags assigned to assemblies identified by json key * Added 'sort-id' property to controls in SP800-53 catalog * Added support for direct generation of schema and converters * Minor updates to SSP example and metaschema * Adding computer build metaschema examples * Extending allowed-values support to fields; unit tests: #437 * More work on allowed-values, now in XSD with unit tests for #437 * Repairing small datatyping bug thanks to regression testing * Further adjustment for allowed-values in docs * Renamed unit tests, now working * Adding allowed-values unit tests * Addressing #452: cleaned up character handling in XML-to-JSON conversion. Fixed the bug this exposed in markdown->HTML conversion. Added some light unit testing. * More adjustments in view of comments to #452 * Repairing more bugs in character handling in Markdown and plain text, with unit testing: #452 * Improvements to Schematron for SP800-53 #400 * For #452, modified copy-and-convert script to suppress character-level post-processing in generated JSON; added unit tests for URIs to detect issues with solidus characters '/' * Edited docs, including datatypes page per #452 (regarding character escapes). * Cleanup metaschema valdiation errors * changed use of the ID and IDREF datatype to NCName * Removed ID and IDREF datatypes * refactored components out of ssp metaschema * Updated SP800-53 catalog and NIST profiles to current model * Added name to information type. * Continued refinement of the SSP model * Updated metadata syntax * changing CM-6 constraint to guidance * continued work on SSP * refactored responsible party to metadata * fixed validation issues * Fixed overriding enumerated values * Fixed content validation errors based on latest metaschema changes * Completed full pass through ssp model * added prop to resource * Fixed broken links in Markdown files. Small adjustments to SSP example. * FDixed relapath error caused when the generated schema directory doesn't exist. Also attempting a fix for CircleCI colorized escape codes causing extra characters to appear. * Fixed validation issue with component metaschema * attempting to fix extra characters in CircleCI colorized messages * Updated enumerated values to remove values that should appear in a given context * quick reordering of elements * hardcode ascii color codes * Fixing broken links in readmes; file name update for consistency * added unit tests for bug * fixed color escaping in scripts * Removed bogus unit test and fixed a small cardinality issue in the SSP model * Improvements to docs generation * Added JSON value keys to fields with flags (that did not have them) * Bug reduction in XSD production mainly related to datatypes and allowed values * Fixing glitch in JSON converter generator * Adjustments repairing Metaschema issues * CSS tweak in docs (model maps to use USWDS font) * Adding to Milestone 2 release notes (in progress) * Change to parameter setting in profile model (#494, #288); release notes towards M2 * Small improvements to copy in release notes (draft) * Updating metaschemas to latest syntax, with improved Metaschema Schematron and unit test tweakage * Adjustments to flag unit test and release notes * SSP Metaschema review and update * cleanup of unused role-id field * reflactored role-id * updated documentation for release. * cleanup of IDs * Minor schema and metaschema improvements * M1 to M2 content converter * Merging local and upstream changes to json example * Relaxing rule over 'ID' flag to accept any string not only XML NCName * reorganizing content for release * more file moves * Fixed changed path * Updated FedRAMP profiles and catalog to current models * Bug fix to XML-to-JSON converter generator * Fixed copy script * Updated FedRAMP baselines and catalog to match new metaschema syntax * fixed merge error * fixed another merge error * fixed spelling issues * Fix from Wendell
* Supporting enumerated value lists on flags in XSD and JSON Schema usnistgov#437 * Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values) * More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators usnistgov#441 * Updating schemas to current model (transitional); updated docs in resulting XSD per usnistgov#448; some updates to markdown documentation * Small updates to authoring CSS. * Added design notes on JSON schema bindings. * Including an initial set of unit tests for group-by, some data types, etc. * Updated to new design (usnistgov#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now * Work on datatyping usnistgov#436 including support in XML and JSON Schema * Addressed usnistgov#451: parameter insertion syntax in Markdown * Schema documentation improvements usnistgov#423 usnistgov#424 usnistgov#428 * Addressed feature request usnistgov#438 * Improving handling of JSON 'key' and 'value-key' settings in docs usnistgov#428 * Now producing XML and JSON model maps from metaschemas. * Now escaping {{ for Jekyll * Updated component metaschema based on design notes * Fixed schematron assertions to properly work with @ref. * Refactoring of component and SSP metachema. * Fixed website side navigation. Added component and SSP metaschema to site generation process. * Addressed comments in issue usnistgov#445 * Added site content generation to runall.sh * Started documenting model changes in release notes. More work is still needed to complete this.
* Removed unnecessary metaschema check on json-value-key * Now implementing in-xml="with-wrapper | unwrapped" on markup multiline fields, with default `with-wrapper` and corresponding changes to catalog and profile metaschemas. * Updating catalog and profile schemas for (prose) unwrapping behavior * Renamed 'json-behavior' in Metaschema to 'in-json' for consistency with 'in-xml'. * Updating syntax in metaschemas 'in-json' for 'json-behavior' * Updating json converter generator to provide in-xml behavior 'GROUPED' * Refining json converter production from Metaschema * Repairing egregious syntax error * Rectify bug introduced with new feature * Adding support for 'date' and 'dateTime' datatypes, with no time zones (usnistgov#480), including unit tests * Improvements and corrections to datatypes docs * More small repairs on datatypes descriptions (table markup) * Built out validations of allowed (enumerated) values, including Metaschema validation checks on whether given allowed values conform to their nominal type. * Straightening kinks in datatype metaschema meta-validation * More special handling of recalcitrant datatypes, this time 'NMTOKENS' and 'IDREFS' * Addressing usnistgov#463, adding `id`, `class` and `title` to `group` in profiles. * Schematron improvements; documentation revisions (removing references to subcontrols) * New Schematron for SP800-53-style catalogs * Removed using in implementation to new metaschema for storage. Started on example, which is still invalid * More work on an example, which is still not valid * refactored schematron processing * more work on SSP example * Refactored generate-schema.sh to allow a metaschema to be provided on the CLI * refactored SSP model to be more flat, while allowing component references * slight cleanup * old example * Fixed content generation * updated metaschema to new specs * fixed content errors * added metaschema examples * Updated metaschema example. * Adding 'prop' and 'part' to Profile Metaschema per usnistgov#463 * Added 'param' to profile 'group' model * JSON converter now properly handling flags assigned to assemblies identified by json key * Added 'sort-id' property to controls in SP800-53 catalog * Added support for direct generation of schema and converters * Minor updates to SSP example and metaschema * Adding computer build metaschema examples * Extending allowed-values support to fields; unit tests: usnistgov#437 * More work on allowed-values, now in XSD with unit tests for usnistgov#437 * Repairing small datatyping bug thanks to regression testing * Further adjustment for allowed-values in docs * Renamed unit tests, now working * Adding allowed-values unit tests * Addressing usnistgov#452: cleaned up character handling in XML-to-JSON conversion. Fixed the bug this exposed in markdown->HTML conversion. Added some light unit testing. * More adjustments in view of comments to usnistgov#452 * Repairing more bugs in character handling in Markdown and plain text, with unit testing: usnistgov#452 * Improvements to Schematron for SP800-53 usnistgov#400 * For usnistgov#452, modified copy-and-convert script to suppress character-level post-processing in generated JSON; added unit tests for URIs to detect issues with solidus characters '/' * Edited docs, including datatypes page per usnistgov#452 (regarding character escapes). * Cleanup metaschema valdiation errors * changed use of the ID and IDREF datatype to NCName * Removed ID and IDREF datatypes * refactored components out of ssp metaschema * Updated SP800-53 catalog and NIST profiles to current model * Added name to information type. * Continued refinement of the SSP model * Updated metadata syntax * changing CM-6 constraint to guidance * continued work on SSP * refactored responsible party to metadata * fixed validation issues * Fixed overriding enumerated values * Fixed content validation errors based on latest metaschema changes * Completed full pass through ssp model * added prop to resource * Fixed broken links in Markdown files. Small adjustments to SSP example. * FDixed relapath error caused when the generated schema directory doesn't exist. Also attempting a fix for CircleCI colorized escape codes causing extra characters to appear. * Fixed validation issue with component metaschema * attempting to fix extra characters in CircleCI colorized messages * Updated enumerated values to remove values that should appear in a given context * quick reordering of elements * hardcode ascii color codes * Fixing broken links in readmes; file name update for consistency * added unit tests for bug * fixed color escaping in scripts * Removed bogus unit test and fixed a small cardinality issue in the SSP model * Improvements to docs generation * Added JSON value keys to fields with flags (that did not have them) * Bug reduction in XSD production mainly related to datatypes and allowed values * Fixing glitch in JSON converter generator * Adjustments repairing Metaschema issues * CSS tweak in docs (model maps to use USWDS font) * Adding to Milestone 2 release notes (in progress) * Change to parameter setting in profile model (usnistgov#494, usnistgov#288); release notes towards M2 * Small improvements to copy in release notes (draft) * Updating metaschemas to latest syntax, with improved Metaschema Schematron and unit test tweakage * Adjustments to flag unit test and release notes * SSP Metaschema review and update * cleanup of unused role-id field * reflactored role-id * updated documentation for release. * cleanup of IDs * Minor schema and metaschema improvements * M1 to M2 content converter * Merging local and upstream changes to json example * Relaxing rule over 'ID' flag to accept any string not only XML NCName * reorganizing content for release * more file moves * Fixed changed path * Updated FedRAMP profiles and catalog to current models * Bug fix to XML-to-JSON converter generator * Fixed copy script * Updated FedRAMP baselines and catalog to match new metaschema syntax * fixed merge error * fixed another merge error * fixed spelling issues * Fix from Wendell
* Supporting enumerated value lists on flags in XSD and JSON Schema usnistgov#437 * Metaschema improvements and remodeling flags support (local definitions; moving w/in the model; valid values) * More Metaschema syntax remodeling: now using max-occurs and min-occurs for cardinality indicators usnistgov#441 * Updating schemas to current model (transitional); updated docs in resulting XSD per usnistgov#448; some updates to markdown documentation * Small updates to authoring CSS. * Added design notes on JSON schema bindings. * Including an initial set of unit tests for group-by, some data types, etc. * Updated to new design (usnistgov#436): Metaschema schema, Schematron, metaschema update XSLT - will break the build for now * Work on datatyping usnistgov#436 including support in XML and JSON Schema * Addressed usnistgov#451: parameter insertion syntax in Markdown * Schema documentation improvements usnistgov#423 usnistgov#424 usnistgov#428 * Addressed feature request usnistgov#438 * Improving handling of JSON 'key' and 'value-key' settings in docs usnistgov#428 * Now producing XML and JSON model maps from metaschemas. * Now escaping {{ for Jekyll * Updated component metaschema based on design notes * Fixed schematron assertions to properly work with @ref. * Refactoring of component and SSP metachema. * Fixed website side navigation. Added component and SSP metaschema to site generation process. * Addressed comments in issue usnistgov#445 * Added site content generation to runall.sh * Started documenting model changes in release notes. More work is still needed to complete this.
* Removed unnecessary metaschema check on json-value-key * Now implementing in-xml="with-wrapper | unwrapped" on markup multiline fields, with default `with-wrapper` and corresponding changes to catalog and profile metaschemas. * Updating catalog and profile schemas for (prose) unwrapping behavior * Renamed 'json-behavior' in Metaschema to 'in-json' for consistency with 'in-xml'. * Updating syntax in metaschemas 'in-json' for 'json-behavior' * Updating json converter generator to provide in-xml behavior 'GROUPED' * Refining json converter production from Metaschema * Repairing egregious syntax error * Rectify bug introduced with new feature * Adding support for 'date' and 'dateTime' datatypes, with no time zones (usnistgov#480), including unit tests * Improvements and corrections to datatypes docs * More small repairs on datatypes descriptions (table markup) * Built out validations of allowed (enumerated) values, including Metaschema validation checks on whether given allowed values conform to their nominal type. * Straightening kinks in datatype metaschema meta-validation * More special handling of recalcitrant datatypes, this time 'NMTOKENS' and 'IDREFS' * Addressing usnistgov#463, adding `id`, `class` and `title` to `group` in profiles. * Schematron improvements; documentation revisions (removing references to subcontrols) * New Schematron for SP800-53-style catalogs * Removed using in implementation to new metaschema for storage. Started on example, which is still invalid * More work on an example, which is still not valid * refactored schematron processing * more work on SSP example * Refactored generate-schema.sh to allow a metaschema to be provided on the CLI * refactored SSP model to be more flat, while allowing component references * slight cleanup * old example * Fixed content generation * updated metaschema to new specs * fixed content errors * added metaschema examples * Updated metaschema example. * Adding 'prop' and 'part' to Profile Metaschema per usnistgov#463 * Added 'param' to profile 'group' model * JSON converter now properly handling flags assigned to assemblies identified by json key * Added 'sort-id' property to controls in SP800-53 catalog * Added support for direct generation of schema and converters * Minor updates to SSP example and metaschema * Adding computer build metaschema examples * Extending allowed-values support to fields; unit tests: usnistgov#437 * More work on allowed-values, now in XSD with unit tests for usnistgov#437 * Repairing small datatyping bug thanks to regression testing * Further adjustment for allowed-values in docs * Renamed unit tests, now working * Adding allowed-values unit tests * Addressing usnistgov#452: cleaned up character handling in XML-to-JSON conversion. Fixed the bug this exposed in markdown->HTML conversion. Added some light unit testing. * More adjustments in view of comments to usnistgov#452 * Repairing more bugs in character handling in Markdown and plain text, with unit testing: usnistgov#452 * Improvements to Schematron for SP800-53 #400 * For usnistgov#452, modified copy-and-convert script to suppress character-level post-processing in generated JSON; added unit tests for URIs to detect issues with solidus characters '/' * Edited docs, including datatypes page per usnistgov#452 (regarding character escapes). * Cleanup metaschema valdiation errors * changed use of the ID and IDREF datatype to NCName * Removed ID and IDREF datatypes * refactored components out of ssp metaschema * Updated SP800-53 catalog and NIST profiles to current model * Added name to information type. * Continued refinement of the SSP model * Updated metadata syntax * changing CM-6 constraint to guidance * continued work on SSP * refactored responsible party to metadata * fixed validation issues * Fixed overriding enumerated values * Fixed content validation errors based on latest metaschema changes * Completed full pass through ssp model * added prop to resource * Fixed broken links in Markdown files. Small adjustments to SSP example. * FDixed relapath error caused when the generated schema directory doesn't exist. Also attempting a fix for CircleCI colorized escape codes causing extra characters to appear. * Fixed validation issue with component metaschema * attempting to fix extra characters in CircleCI colorized messages * Updated enumerated values to remove values that should appear in a given context * quick reordering of elements * hardcode ascii color codes * Fixing broken links in readmes; file name update for consistency * added unit tests for bug * fixed color escaping in scripts * Removed bogus unit test and fixed a small cardinality issue in the SSP model * Improvements to docs generation * Added JSON value keys to fields with flags (that did not have them) * Bug reduction in XSD production mainly related to datatypes and allowed values * Fixing glitch in JSON converter generator * Adjustments repairing Metaschema issues * CSS tweak in docs (model maps to use USWDS font) * Adding to Milestone 2 release notes (in progress) * Change to parameter setting in profile model (usnistgov#494, #288); release notes towards M2 * Small improvements to copy in release notes (draft) * Updating metaschemas to latest syntax, with improved Metaschema Schematron and unit test tweakage * Adjustments to flag unit test and release notes * SSP Metaschema review and update * cleanup of unused role-id field * reflactored role-id * updated documentation for release. * cleanup of IDs * Minor schema and metaschema improvements * M1 to M2 content converter * Merging local and upstream changes to json example * Relaxing rule over 'ID' flag to accept any string not only XML NCName * reorganizing content for release * more file moves * Fixed changed path * Updated FedRAMP profiles and catalog to current models * Bug fix to XML-to-JSON converter generator * Fixed copy script * Updated FedRAMP baselines and catalog to match new metaschema syntax * fixed merge error * fixed another merge error * fixed spelling issues * Fix from Wendell
User Story:
As an OSCAL model developer, I need to be able to define a set of valid values that are then checked for in the JSON and XML schema generated from my Metaschema-based model.
Goals:
The Metaschema allows for a set of valid values to be defined for a
flag
orfield
. For example:For a given list of valid values, the specified values can be inclusive, allowing other values to be provided that are not in the list, or exclusive (the default), restricting allowed values to only those on the list. The inclusive behavior is used if the
<valid-values @allow-other="yes"/>
is provided.These values are displayed in the schema documentation, but when the exclusive case is selected, the values are not constrained by the generated XML or JSON schema. This support needs to be implemented.
A valid values list can be included in the JSON schema using the
enum
keyword as follows:Dependencies:
This issue will also partially address issue #390, by providing for validation of valid values.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: