Skip to content

Commit

Permalink
Adjustments to debug charstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed May 2, 2022
1 parent f43944c commit db52cc7
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 315 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "../../../../../metaschema-schema-generator/test-schemagen/choice-schema.json",
"parent": {
"children": [
{
Expand Down
123 changes: 77 additions & 46 deletions test-suite/schema-generation/datatypes/charstrings_json-schema.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,77 @@

{ "$schema" : "http://json-schema.org/draft-07/schema#",
"$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime-schema.json",
"$comment" : "Metaschema Unit Test: datatypes-dateTime: JSON Schema",
"type" : "object",
"definitions" :
{ "examples" :
{ "title" : "Examples",
"description" : "Some character strings of different sorts",
"$id" : "#/definitions/examples",
"type" : "object",
"properties" :
{ "character-strings" :
{ "anyOf" :
[
{ "$ref" : "#/definitions/charstring" },

{ "type" : "array",
"items" :
{ "$ref" : "#/definitions/charstring" },
"minItems" : 2 } ] },
"markup-lines" :
{ "anyOf" :
[
{ "$ref" : "#/definitions/markupline" },

{ "type" : "array",
"items" :
{ "$ref" : "#/definitions/markupline" },
"minItems" : 2 } ] } },
"additionalProperties" : false },
"charstring" :
{ "title" : "Character string",
"description" : "String of characters",
"$id" : "#/definitions/charstring",
"type" : "string" },
"markupline" :
{ "title" : "Markup line",
"description" : "Characters, and more",
"$id" : "#/definitions/markupline",
"type" : "string" } },
"properties" :
{ "examples" :
{ "$ref" : "#/definitions/examples" } },
"additionalProperties" : false,
"maxProperties" : 1 }
{
"$schema" : "http://json-schema.org/draft-07/schema#",
"$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime/metaschema-datatypes-dateTime-1.0-milestone1-schema.json",
"$comment" : "Metaschema Unit Test: datatypes-dateTime",
"type" : "object",
"definitions" : {
"MetaschemaDatatypesDatetimeExamplesAssemblyType" : {
"$id" : "#/definitions/MetaschemaDatatypesDatetimeExamplesAssemblyType",
"$comment" : "Definition MetaschemaDatatypesDatetimeExamplesAssemblyType: inline(false:false)",
"title" : "Examples",
"description" : "Some character strings of different sorts",
"type" : "object",
"properties" : {
"character-strings" : {
"oneOf" : [ {
"$comment" : "InstancePropertyDefinitionOrRef MetaschemaDatatypesDatetimeCharstringFieldType: inline(false:false)",
"$ref" : "#/definitions/MetaschemaDatatypesDatetimeCharstringFieldType"
}, {
"type" : "array",
"items" : {
"$comment" : "InstancePropertyDefinitionOrRef MetaschemaDatatypesDatetimeCharstringFieldType: inline(false:false)",
"$ref" : "#/definitions/MetaschemaDatatypesDatetimeCharstringFieldType"
},
"minItems" : 2
} ]
},
"markup-lines" : {
"oneOf" : [ {
"$comment" : "InstancePropertyDefinitionOrRef MetaschemaDatatypesDatetimeMarkuplineFieldType: inline(false:false)",
"$ref" : "#/definitions/MetaschemaDatatypesDatetimeMarkuplineFieldType"
}, {
"type" : "array",
"items" : {
"$comment" : "InstancePropertyDefinitionOrRef MetaschemaDatatypesDatetimeMarkuplineFieldType: inline(false:false)",
"$ref" : "#/definitions/MetaschemaDatatypesDatetimeMarkuplineFieldType"
},
"minItems" : 2
} ]
}
},
"additionalProperties" : false
},
"MetaschemaDatatypesDatetimeCharstringFieldType" : {
"$id" : "#/definitions/MetaschemaDatatypesDatetimeCharstringFieldType",
"$comment" : "Definition MetaschemaDatatypesDatetimeCharstringFieldType: inline(false:false)",
"title" : "Character string",
"description" : "String of characters",
"$ref" : "#/definitions/StringDatatype"
},
"MetaschemaDatatypesDatetimeMarkuplineFieldType" : {
"$id" : "#/definitions/MetaschemaDatatypesDatetimeMarkuplineFieldType",
"$comment" : "Definition MetaschemaDatatypesDatetimeMarkuplineFieldType: inline(false:false)",
"title" : "Markup line",
"description" : "Characters, and more",
"$ref" : "#/definitions/MarkupLineDatatype"
},
"MarkupLineDatatype" : {
"type" : "string",
"pattern" : "^[^\n]+$"
},
"StringDatatype" : {
"type" : "string",
"pattern" : "^\\S(.*\\S)?$"
}
},
"properties" : {
"$schema" : {
"type" : "string",
"format" : "uri-reference"
},
"examples" : {
"$ref" : "#/definitions/MetaschemaDatatypesDatetimeExamplesAssemblyType"
}
},
"required" : [ "examples" ],
"additionalProperties" : false
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@

{ "examples" :
{ "character-strings" :
[ "Here's a string including punctuation ' \" \\ . $",
"Here's a string with an ampersand &",
"Less-than and greater-than, as <delimiters> ...",
"The star aka asterisk * may be magical and maybe also the tick `" ],
"markup-lines" :
[ "Also, occasionally we have [links](w3.org) and *other markup*.",
"And *sometimes*, we have \\*very confusing stuff\\* as well." ] } }
{
"$schema": "charstrings_json-schema.json",
"examples": {
"character-strings": [
"Here's a string including punctuation ' \" \\ . $",
"Here's a string with an ampersand &",
"Less-than and greater-than, as <delimiters> ...",
"The star aka asterisk * may be magical and maybe also the tick `"
],
"markup-lines": [
"Also, occasionally we have [links](w3.org) and *other markup*.",
"And *sometimes*, we have \\*very confusing stuff\\* as well."
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime charstrings-test_xml-schema.xsd"
xsi:schemaLocation="http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime charstrings_xml-schema.xsd"
xmlns="http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime">
<charstring>Here's a string including punctuation ' " \ . $</charstring>
<charstring>Here's a string with an ampersand &amp;</charstring>
Expand Down
Loading

0 comments on commit db52cc7

Please sign in to comment.