diff --git a/build/ci-cd/copy-and-convert-content.sh b/build/ci-cd/copy-and-convert-content.sh index ad69c070c2..f6635d911e 100755 --- a/build/ci-cd/copy-and-convert-content.sh +++ b/build/ci-cd/copy-and-convert-content.sh @@ -151,7 +151,7 @@ while IFS="|" read path format model converttoformats || [[ -n "$path" ]]; do case $altformat in json) # Remove extra slashes - perl -pi -e 's,\\/,/,g' "${dest}" + # perl -pi -e 's,\\/,/,g' "${dest}" # translate OSCAL mime types perl -pi -e 's,(application/oscal\.[a-z]+\+)xml\",\1json\",g' "${dest}" # relative content paths diff --git a/build/metaschema/unit-testing/datatypes/datatypes-prose_test-valid-PASS.json b/build/metaschema/unit-testing/datatypes/datatypes-prose_test_valid_PASS.json similarity index 100% rename from build/metaschema/unit-testing/datatypes/datatypes-prose_test-valid-PASS.json rename to build/metaschema/unit-testing/datatypes/datatypes-prose_test_valid_PASS.json diff --git a/build/metaschema/unit-testing/datatypes/datatypes-uri_json-schema.json b/build/metaschema/unit-testing/datatypes/datatypes-uri_json-schema.json new file mode 100644 index 0000000000..b57380947d --- /dev/null +++ b/build/metaschema/unit-testing/datatypes/datatypes-uri_json-schema.json @@ -0,0 +1,59 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri-schema.json", + "$comment" : "Metaschema Unit Test: URIs: JSON Schema", + "type" : "object", + "definitions" : + { "parent" : + { "title" : "parent", + "description" : "parent assembly", + "$id" : "#/definitions/parent", + "type" : "object", + "properties" : + { "uri-flag" : + { "title" : "Universal Resource Identifier Flag", + "description" : "Per W3C", + "type" : "string", + "format" : "uri" }, + "uri-reference-flag" : + { "title" : "Universal Resource Identifier Reference Flag", + "description" : "Per W3C, can be a relative URI", + "type" : "string", + "format" : "uri-reference" }, + "uri-fields" : + { "anyOf" : + [ + { "$ref" : "#/definitions/uri-field" }, + + { "type" : "array", + "items" : + { "$ref" : "#/definitions/uri-field" }, + "minItems" : 2 } ] }, + "uri-reference-fields" : + { "anyOf" : + [ + { "$ref" : "#/definitions/uri-reference-field" }, + + { "type" : "array", + "items" : + { "$ref" : "#/definitions/uri-reference-field" }, + "minItems" : 2 } ] } }, + "required" : + [ "uri-flag", + "uri-reference-flag" ], + "additionalProperties" : false }, + "uri-field" : + { "title" : "Universal Resource Identifier Flag", + "description" : "Per W3C", + "$id" : "#/definitions/uri-field", + "type" : "string", + "format" : "uri" }, + "uri-reference-field" : + { "title" : "Universal Resource Identifier Flag", + "description" : "Per W3C", + "$id" : "#/definitions/uri-reference-field", + "type" : "string", + "format" : "uri-reference" } }, + "properties" : + { "parent" : + { "$ref" : "#/definitions/parent" } } } \ No newline at end of file diff --git a/build/metaschema/unit-testing/datatypes/datatypes-uri_metaschema.xml b/build/metaschema/unit-testing/datatypes/datatypes-uri_metaschema.xml new file mode 100644 index 0000000000..8438508592 --- /dev/null +++ b/build/metaschema/unit-testing/datatypes/datatypes-uri_metaschema.xml @@ -0,0 +1,48 @@ + + + + + + + Metaschema Unit Test: URIs + 1.0-milestone1 + metaschema-datatypes-uri + http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri + + + parent + parent assembly + + Universal Resource Identifier Flag + Per W3C + + + Universal Resource Identifier Reference Flag + Per W3C, can be a relative URI + + + + + + + + + + + + + + Universal Resource Identifier Flag + Per W3C + + + + Universal Resource Identifier Flag + Per W3C + + + diff --git a/build/metaschema/unit-testing/datatypes/datatypes-uri_test_broken_FAIL.json b/build/metaschema/unit-testing/datatypes/datatypes-uri_test_broken_FAIL.json new file mode 100644 index 0000000000..f3d397c104 --- /dev/null +++ b/build/metaschema/unit-testing/datatypes/datatypes-uri_test_broken_FAIL.json @@ -0,0 +1,13 @@ +{ + "parent": { + "uri-flag": "//pages.nist.gov/OSCAL", + "uri-reference-flag": "c:\\OSCAL", + "uri-fields": [ + "https://www.w3.org{}", + "https://www.w3.org/%%%%", + "http://www.nist.gov?x-y=z" + ], + "uri-reference-fields": [ "(|)" ] + + } +} diff --git a/build/metaschema/unit-testing/datatypes/datatypes-uri_test_valid_PASS.json b/build/metaschema/unit-testing/datatypes/datatypes-uri_test_valid_PASS.json new file mode 100644 index 0000000000..a9ccf6c8b7 --- /dev/null +++ b/build/metaschema/unit-testing/datatypes/datatypes-uri_test_valid_PASS.json @@ -0,0 +1,12 @@ +{ + "parent": { + "uri-flag": "http://pages.nist.gov/OSCAL", + "uri-reference-flag": "OSCAL", + "uri-fields": [ + "gopher://loc.gov", + "https://www.w3.org", + "http://www.nist.gov" + ], + "uri-reference-fields": "myhomepage.html" + } +}