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 index ae5dac3dc..0dbb8f096 100644 --- a/test-suite/metaschema-xspec/json-schema-gen/json-schema-gen.xspec +++ b/test-suite/metaschema-xspec/json-schema-gen/json-schema-gen.xspec @@ -1,171 +1,38 @@ - - - + stylesheet="../../../toolchains/xslt-M4/nist-metaschema-MAKE-JSON-SCHEMA.xsl" run-as="external"> - - - - 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.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema.xml deleted file mode 100644 index b76d841e9..000000000 --- a/test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - 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_constrained-closed.json b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-closed.json new file mode 100644 index 000000000..60f2b2734 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-closed.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://csrc.nist.gov/ns/metaschema-tests/0.1/json-schema-value-test-constrained-closed-schema.json", + "$comment": "JSON value testing mini metaschema: JSON Schema", + "type": "object", + "definitions": { + "json-schema-value-test-constrained-closed-json-schema-value-test-constrained-closed:root": { + "title": "Root", + "description": "Root root root.", + "$id": "#assembly_json-schema-value-test-constrained-closed_root", + "type": "object", + "properties": { + "constrained-closed": { + "$ref": "#field_json-schema-value-test-constrained-closed_constrained-closed" + } + }, + "additionalProperties": false + }, + "json-schema-value-test-constrained-closed-json-schema-value-test-constrained-closed:constrained-closed": { + "title": "Constrained closed", + "description": "Because allow-other is 'no' an enumeration can be given in the JSON Schema.", + "$id": "#field_json-schema-value-test-constrained-closed_constrained-closed", + "type": "object", + "properties": { + "some": { + "title": "Some Flag", + "description": "Some flag some flag some flag.", + "$ref": "#/definitions/StringDatatype" + }, + "token-value": { + "allOf": [ + { + "$ref": "#/definitions/TokenDatatype" + }, + { + "enum": [ + "one", + "two", + "three", + "four" + ] + } + ] + } + }, + "required": [ + "token-value" + ], + "additionalProperties": false + }, + "StringDatatype": { + "type": "string", + "pattern": "^\\S(.*\\S)?$" + }, + "TokenDatatype": { + "type": "string", + "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" + } + }, + "properties": { + "root": { + "$ref": "#assembly_json-schema-value-test-constrained-closed_root" + } + }, + "required": [ + "root" + ], + "additionalProperties": false, + "maxProperties": 1 +} \ No newline at end of file diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-closed_metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-closed_metaschema.xml new file mode 100644 index 000000000..b7cf2f044 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-closed_metaschema.xml @@ -0,0 +1,38 @@ + + + + JSON value testing mini metaschema + 0.1 + json-schema-value-test-constrained-closed + http://csrc.nist.gov/ns/metaschema-tests/1.0 + http://csrc.nist.gov/ns/metaschema-tests + + Root + Root root root. + root + + + + + + 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. + + + + + + + + + + + diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-narrow.json b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-narrow.json new file mode 100644 index 000000000..29a7bc7af --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-narrow.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://csrc.nist.gov/ns/metaschema-tests/0.1/json-schema-value-test-constrained-narrow-schema.json", + "$comment": "JSON value testing mini metaschema: JSON Schema", + "type": "object", + "definitions": { + "json-schema-value-test-constrained-narrow-json-schema-value-test-constrained-narrow:root": { + "title": "Root", + "description": "Root root root.", + "$id": "#assembly_json-schema-value-test-constrained-narrow_root", + "type": "object", + "properties": { + "constrained-narrow": { + "$ref": "#field_json-schema-value-test-constrained-narrow_constrained-narrow" + } + }, + "additionalProperties": false + }, + "json-schema-value-test-constrained-narrow-json-schema-value-test-constrained-narrow:constrained-narrow": { + "title": "Constrained narrow", + "description": "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.", + "$id": "#field_json-schema-value-test-constrained-narrow_constrained-narrow", + "type": "object", + "properties": { + "some": { + "title": "Some Flag", + "description": "Some flag some flag some flag.", + "$ref": "#/definitions/StringDatatype" + }, + "token-value": { + "$ref": "#/definitions/TokenDatatype" + } + }, + "required": [ + "token-value" + ], + "additionalProperties": false + }, + "StringDatatype": { + "type": "string", + "pattern": "^\\S(.*\\S)?$" + }, + "TokenDatatype": { + "type": "string", + "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" + } + }, + "properties": { + "root": { + "$ref": "#assembly_json-schema-value-test-constrained-narrow_root" + } + }, + "required": [ + "root" + ], + "additionalProperties": false, + "maxProperties": 1 +} \ No newline at end of file diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-narrow_metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-narrow_metaschema.xml new file mode 100644 index 000000000..dcb921049 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-narrow_metaschema.xml @@ -0,0 +1,39 @@ + + + + JSON value testing mini metaschema + 0.1 + json-schema-value-test-constrained-narrow + http://csrc.nist.gov/ns/metaschema-tests/1.0 + http://csrc.nist.gov/ns/metaschema-tests + + Root + Root root root. + root + + + + + + + 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. + + + + + + + + + + + diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-open.json b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-open.json new file mode 100644 index 000000000..9c44e32d6 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-open.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://csrc.nist.gov/ns/metaschema-tests/0.1/json-schema-value-test-constrained-open-schema.json", + "$comment": "JSON value testing mini metaschema: JSON Schema", + "type": "object", + "definitions": { + "json-schema-value-test-constrained-open-json-schema-value-test-constrained-open:root": { + "title": "Root", + "description": "Root root root.", + "$id": "#assembly_json-schema-value-test-constrained-open_root", + "type": "object", + "properties": { + "constrained-open": { + "$ref": "#field_json-schema-value-test-constrained-open_constrained-open" + } + }, + "additionalProperties": false + }, + "json-schema-value-test-constrained-open-json-schema-value-test-constrained-open:constrained-open": { + "title": "Constrained open", + "description": "Because allow-other is 'yes' no enumeration can be given in the JSON Schema.", + "$id": "#field_json-schema-value-test-constrained-open_constrained-open", + "type": "object", + "properties": { + "some": { + "title": "Some Flag", + "description": "Some flag some flag some flag.", + "$ref": "#/definitions/StringDatatype" + }, + "token-value": { + "anyOf": [ + { + "$ref": "#/definitions/TokenDatatype" + }, + { + "enum": [ + "one", + "two", + "three", + "four" + ] + } + ] + } + }, + "required": [ + "token-value" + ], + "additionalProperties": false + }, + "StringDatatype": { + "type": "string", + "pattern": "^\\S(.*\\S)?$" + }, + "TokenDatatype": { + "type": "string", + "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" + } + }, + "properties": { + "root": { + "$ref": "#assembly_json-schema-value-test-constrained-open_root" + } + }, + "required": [ + "root" + ], + "additionalProperties": false, + "maxProperties": 1 +} \ No newline at end of file diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-open_metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-open_metaschema.xml new file mode 100644 index 000000000..a2760aee7 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-open_metaschema.xml @@ -0,0 +1,38 @@ + + + + JSON value testing mini metaschema + 0.1 + json-schema-value-test-constrained-open + http://csrc.nist.gov/ns/metaschema-tests/1.0 + http://csrc.nist.gov/ns/metaschema-tests + + Root + Root root root. + root + + + + + + 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. + + + + + + + + + + + diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-sortof.json b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-sortof.json new file mode 100644 index 000000000..e82778626 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-sortof.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://csrc.nist.gov/ns/metaschema-tests/0.1/json-schema-value-test-constrained-sortof-schema.json", + "$comment": "JSON value testing mini metaschema: JSON Schema", + "type": "object", + "definitions": { + "json-schema-value-test-constrained-sortof-json-schema-value-test-constrained-sortof:root": { + "title": "Root", + "description": "Root root root.", + "$id": "#assembly_json-schema-value-test-constrained-sortof_root", + "type": "object", + "properties": { + "constrained-sortof": { + "$ref": "#field_json-schema-value-test-constrained-sortof_constrained-sortof" + } + }, + "additionalProperties": false + }, + "json-schema-value-test-constrained-sortof-json-schema-value-test-constrained-sortof:constrained-sortof": { + "title": "Constrained, sort of", + "description": "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.", + "$id": "#field_json-schema-value-test-constrained-sortof_constrained-sortof", + "type": "object", + "properties": { + "some": { + "title": "Some Flag", + "description": "Some flag some flag some flag.", + "$ref": "#/definitions/StringDatatype" + }, + "token-value": { + "$ref": "#/definitions/TokenDatatype" + } + }, + "required": [ + "token-value" + ], + "additionalProperties": false + }, + "StringDatatype": { + "type": "string", + "pattern": "^\\S(.*\\S)?$" + }, + "TokenDatatype": { + "type": "string", + "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" + } + }, + "properties": { + "root": { + "$ref": "#assembly_json-schema-value-test-constrained-sortof_root" + } + }, + "required": [ + "root" + ], + "additionalProperties": false, + "maxProperties": 1 +} \ No newline at end of file diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-sortof_metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-sortof_metaschema.xml new file mode 100644 index 000000000..7b28d4f01 --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_constrained-sortof_metaschema.xml @@ -0,0 +1,38 @@ + + + + JSON value testing mini metaschema + 0.1 + json-schema-value-test-constrained-sortof + http://csrc.nist.gov/ns/metaschema-tests/1.0 + http://csrc.nist.gov/ns/metaschema-tests + + Root + Root root root. + root + + + + + + 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_unconstrained.json b/test-suite/metaschema-xspec/json-schema-gen/json-value_unconstrained.json new file mode 100644 index 000000000..b2533606f --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_unconstrained.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://csrc.nist.gov/ns/metaschema-tests/0.1/json-schema-value-test-unconstrained-schema.json", + "$comment": "JSON value testing mini metaschema: JSON Schema", + "type": "object", + "definitions": { + "json-schema-value-test-unconstrained-json-schema-value-test-unconstrained:root": { + "title": "Root", + "description": "Root root root.", + "$id": "#assembly_json-schema-value-test-unconstrained_root", + "type": "object", + "properties": { + "unconstrained": { + "$ref": "#field_json-schema-value-test-unconstrained_unconstrained" + } + }, + "additionalProperties": false + }, + "json-schema-value-test-unconstrained-json-schema-value-test-unconstrained:unconstrained": { + "title": "Unconstrained", + "description": "A field whose value is constrained only by its nominal datatype, 'token'.", + "$id": "#field_json-schema-value-test-unconstrained_unconstrained", + "type": "object", + "properties": { + "some": { + "title": "Some Flag", + "description": "Some flag some flag some flag.", + "$ref": "#/definitions/StringDatatype" + }, + "token-value": { + "$ref": "#/definitions/TokenDatatype" + } + }, + "required": [ + "token-value" + ], + "additionalProperties": false + }, + "StringDatatype": { + "type": "string", + "pattern": "^\\S(.*\\S)?$" + }, + "TokenDatatype": { + "type": "string", + "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" + } + }, + "properties": { + "root": { + "$ref": "#assembly_json-schema-value-test-unconstrained_root" + } + }, + "required": [ + "root" + ], + "additionalProperties": false, + "maxProperties": 1 +} \ No newline at end of file diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_unconstrained_metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value_unconstrained_metaschema.xml new file mode 100644 index 000000000..69d7ad4ce --- /dev/null +++ b/test-suite/metaschema-xspec/json-schema-gen/json-value_unconstrained_metaschema.xml @@ -0,0 +1,30 @@ + + + + JSON value testing mini metaschema + 0.1 + json-schema-value-test-unconstrained + http://csrc.nist.gov/ns/metaschema-tests/1.0 + http://csrc.nist.gov/ns/metaschema-tests + + 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. + + +