diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-schema-gen.xspec b/test-suite/metaschema-xspec/json-schema-gen/json-schema-gen.xspec new file mode 100644 index 000000000..390056de9 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-schema-gen.xspec @@ -0,0 +1,169 @@ + + + + + + + + + + Unconstrained + A field whose value is constrained only by its nominal datatype, 'token'. + #field_oscal-value-testing-mini_unconstrained + object + + + Some Flag + Some flag some flag some flag. + #/definitions/StringDatatype + + + #/definitions/TokenDatatype + + + + token-value + + false + + + + + + + + + Constrained closed + Because allow-other is 'no' an enumeration can be given in the JSON Schema. + #field_oscal-value-testing-mini_constrained-closed + object + + + Some Flag + Some flag some flag some flag. + #/definitions/StringDatatype + + + + + #/definitions/TokenDatatype + + + + one + two + three + four + + + + + + + token-value + + false + + + + + + + + + Constrained open + Because allow-other is 'yes' no enumeration can be given in the JSON Schema. + #field_oscal-value-testing-mini_constrained-open + object + + + Some Flag + Some flag some flag some flag. + #/definitions/StringDatatype + + + + + #/definitions/TokenDatatype + + + + one + two + three + four + + + + + + + token-value + + false + + + + + + + + + Constrained narrow + Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. + #field_oscal-value-testing-mini_constrained-narrow + object + + + Some Flag + Some flag some flag some flag. + #/definitions/StringDatatype + + + #/definitions/TokenDatatype + + + + token-value + + false + + + + + + + + + Constrained, sort of + Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. + #field_oscal-value-testing-mini_constrained-sortof + object + + + Some Flag + Some flag some flag some flag. + #/definitions/StringDatatype + + + #/definitions/TokenDatatype + + + + token-value + + false + + + + + diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema-COMPOSED.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema-COMPOSED.xml new file mode 100644 index 000000000..6f0e831fe --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema-COMPOSED.xml @@ -0,0 +1,244 @@ + + + Seeing assembly#oscal-value-testing-mini:root, field#oscal-value-testing-mini:unconstrained, field#oscal-value-testing-mini:constrained-open, field#oscal-value-testing-mini:constrained-closed, field#oscal-value-testing-mini:constrained-narrow, field#oscal-value-testing-mini:constrained-sortof + JSON value testing mini metaschema + 0.1 + oscal-value-testing-mini + http://csrc.nist.gov/ns/oscal/1.0 + http://csrc.nist.gov/ns/oscal + + Root + Root root root. + root + + + + + + + + + + Unconstrained + A field whose value is constrained only by its nominal datatype, 'token'. + token-value + + Some Flag + Some flag some flag some flag. + + + + Constrained open + Because allow-other is 'yes' no enumeration can be given in the JSON Schema. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + + Constrained closed + Because allow-other is 'no' an enumeration can be given in the JSON Schema. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + + Constrained narrow + Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + + Constrained, sort of + Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema.xml new file mode 100644 index 000000000..b76d841e9 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema.xml @@ -0,0 +1,110 @@ + + + + JSON value testing mini metaschema + 0.1 + oscal-value-testing-mini + http://csrc.nist.gov/ns/oscal/1.0 + http://csrc.nist.gov/ns/oscal + + Root + Root root root. + root + + + + + + + + + + Unconstrained + A field whose value is constrained only by its nominal datatype, 'token'. + token-value + + Some Flag + Some flag some flag some flag. + + + + Constrained open + Because allow-other is 'yes' no enumeration can be given in the JSON Schema. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + + Constrained closed + Because allow-other is 'no' an enumeration can be given in the JSON Schema. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + + Constrained narrow + Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + + Constrained, sort of + Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. + token-value + + Some Flag + Some flag some flag some flag. + + + + + + + + + + + diff --git a/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl b/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl index adf166264..ff22c30fe 100644 --- a/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl +++ b/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl @@ -30,20 +30,9 @@ - - - - - @@ -169,8 +158,7 @@ - - + @@ -200,8 +188,6 @@ - - @@ -250,13 +236,10 @@ - - - - + @@ -310,24 +293,6 @@ - - - @@ -376,49 +341,38 @@ - string - - - - - - - - - { @_in-json-name } @@ -432,7 +386,6 @@ - @@ -675,73 +628,19 @@ - - - - - string ^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?$ - - + string date-time ^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$ - + string email ^.+@.+$ - -