diff --git a/test/programs/annotation-default/schema.json b/test/programs/annotation-default/schema.json index e227243a..671b0a1e 100644 --- a/test/programs/annotation-default/schema.json +++ b/test/programs/annotation-default/schema.json @@ -1,95 +1,66 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "varBoolean": { - "default": true, - "type": "boolean" - }, - "varBooleanArray": { - "default": [ - true, - false, - true - ], - "items": { - "type": "boolean" - }, - "type": "array" - }, - "varFloat": { - "default": 3.21, - "type": "number" - }, - "varFloatArray": { - "default": [ - 1.23, - 65.21, - -123.4, - 0, - 1000000.0001 - ], - "items": { - "type": "number" - }, - "type": "array" - }, - "varInteger": { - "default": 123, - "type": "number" - }, - "varIntegerArray": { - "default": [ - 1, - 2, - 3, - 4, - 5 - ], - "items": { - "type": "number" - }, - "type": "array" - }, - "varMixedArray": { - "default": [ - true, - 123, - 3.21, - "foo" - ], - "items": { - }, - "type": "array" - }, - "varString": { - "default": "foo", - "type": "string" - }, - "varStringArray": { - "default": [ - "a", - "b", - "c", - "..." - ], - "items": { - "type": "string" - }, - "type": "array" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "varBoolean": { + "default": true, + "type": "boolean" }, - "required": [ - "varBoolean", - "varBooleanArray", - "varFloat", - "varFloatArray", - "varInteger", - "varIntegerArray", - "varMixedArray", - "varString", - "varStringArray" - ], - "type": "object" + "varBooleanArray": { + "default": [ true, false, true ], + "items": { + "type": "boolean" + }, + "type": "array" + }, + "varFloat": { + "default": 3.21, + "type": "number" + }, + "varFloatArray": { + "default": [ 1.23, 65.21, -123.4, 0, 1e+06 ], + "items": { + "type": "number" + }, + "type": "array" + }, + "varInteger": { + "default": 123, + "type": "number" + }, + "varIntegerArray": { + "default": [ 1, 2, 3, 4, 5 ], + "items": { + "type": "number" + }, + "type": "array" + }, + "varMixedArray": { + "default": [ true, 123, 3.21, "foo" ], + "type": "array" + }, + "varString": { + "default": "foo", + "type": "string" + }, + "varStringArray": { + "default": [ "a", "b", "c", "..." ], + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "varBoolean", + "varBooleanArray", + "varFloat", + "varFloatArray", + "varInteger", + "varIntegerArray", + "varMixedArray", + "varString", + "varStringArray" + ], + "type": "object" } - diff --git a/test/programs/annotation-required/schema.json b/test/programs/annotation-required/schema.json index c8c4f2c8..d1385261 100644 --- a/test/programs/annotation-required/schema.json +++ b/test/programs/annotation-required/schema.json @@ -15,7 +15,7 @@ "type": "string" } }, - "required": ["age", "name"], + "required": [ "age", "name" ], "type": "object" }, "MySubObject": { @@ -25,8 +25,6 @@ "type": "boolean" }, "object": { - "additionalProperties": true, - "properties": {}, "type": "object" }, "string": { @@ -45,7 +43,7 @@ ] } }, - "required": ["bool", "object", "string"], + "required": [ "bool", "object", "string" ], "type": "object" }, "MySubObject2": { @@ -55,15 +53,13 @@ "type": "boolean" }, "object": { - "additionalProperties": true, - "properties": {}, "type": "object" }, "string": { "type": "string" } }, - "required": ["bool", "object", "string"], + "required": [ "bool", "object", "string" ], "type": "object" } }, @@ -89,6 +85,6 @@ ] } }, - "required": ["defaultObject", "filled"], + "required": [ "defaultObject", "filled" ], "type": "object" } diff --git a/test/programs/annotation-tjs/schema.json b/test/programs/annotation-tjs/schema.json index 477f8bd1..9bf06cdf 100644 --- a/test/programs/annotation-tjs/schema.json +++ b/test/programs/annotation-tjs/schema.json @@ -1,93 +1,88 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "dateTime": { - "format": "date-time", - "type": "string" - }, - "email": { - "format": "email", - "type": "string" - }, - "examples": { - "examples": [ - "foo", - 1 - ], - "type": "string" - }, - "hostname": { - "format": "hostname", - "type": "string" - }, - "ipv4": { - "format": "ipv4", - "type": "string" - }, - "ipv6": { - "format": "ipv6", - "type": "string" - }, - "jsonPointer": { - "format": "json-pointer", - "type": "string" - }, - "oneCharacter": { - "minimum": 5, - "type": "number" - }, - "regexPattern": { - "pattern": "^[a-zA-Z0-9]{4}-abc_123$", - "type": "string" - }, - "regexPatternWithWhitespace": { - "pattern": "^[a-zA-Z0-9]{4}-abc_123$", - "type": "string" - }, - "uri": { - "format": "uri", - "type": "string" - }, - "uriReference": { - "format": "uri-reference", - "type": "string" - }, - "uriTemplate": { - "format": "uri-template", - "type": "string" - }, - "booleanAnnotationDefaultValue": { - "hide": true, - "type": "string" - }, - "booleanAnnotationWithTrue": { - "hide": true, - "type": "string" - }, - "booleanAnnotationWithFalse": { - "hide": false, - "type": "string" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "dateTime": { + "format": "date-time", + "type": "string" }, - "required": [ - "booleanAnnotationDefaultValue", - "booleanAnnotationWithFalse", - "booleanAnnotationWithTrue", - "dateTime", - "email", - "examples", - "hostname", - "ipv4", - "ipv6", - "jsonPointer", - "oneCharacter", - "regexPattern", - "regexPatternWithWhitespace", - "uri", - "uriReference", - "uriTemplate" - ], - "type": "object" + "email": { + "format": "email", + "type": "string" + }, + "examples": { + "type": "string" + }, + "hostname": { + "format": "hostname", + "type": "string" + }, + "ipv4": { + "format": "ipv4", + "type": "string" + }, + "ipv6": { + "format": "ipv6", + "type": "string" + }, + "jsonPointer": { + "format": "json-pointer", + "type": "string" + }, + "oneCharacter": { + "minimum": 5, + "type": "number" + }, + "regexPattern": { + "pattern": "^[a-zA-Z0-9]{4}-abc_123$", + "type": "string" + }, + "regexPatternWithWhitespace": { + "pattern": "^[a-zA-Z0-9]{4}-abc_123$", + "type": "string" + }, + "uri": { + "format": "uri", + "type": "string" + }, + "uriReference": { + "format": "uri-reference", + "type": "string" + }, + "uriTemplate": { + "format": "uri-template", + "type": "string" + }, + "booleanAnnotationDefaultValue": { + "x-hide": true, + "type": "string" + }, + "booleanAnnotationWithTrue": { + "x-hide": true, + "type": "string" + }, + "booleanAnnotationWithFalse": { + "x-hide": false, + "type": "string" + } + }, + "required": [ + "booleanAnnotationDefaultValue", + "booleanAnnotationWithFalse", + "booleanAnnotationWithTrue", + "dateTime", + "email", + "examples", + "hostname", + "ipv4", + "ipv6", + "jsonPointer", + "oneCharacter", + "regexPattern", + "regexPatternWithWhitespace", + "uri", + "uriReference", + "uriTemplate" + ], + "type": "object" } - diff --git a/test/programs/array-and-description/schema.json b/test/programs/array-and-description/schema.json index 14126456..85586388 100644 --- a/test/programs/array-and-description/schema.json +++ b/test/programs/array-and-description/schema.json @@ -1,23 +1,18 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "description": { - "type": "string" - }, - "name": { - "description": "A name", - "type": "string" - }, - "test": { - "items": { - }, - "type": "array" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "description": { + "type": "string" }, - "required": [ - "test" - ], - "type": "object" + "name": { + "description": "A name", + "type": "string" + }, + "test": { + "type": "array" + } + }, + "required": [ "test" ], + "type": "object" } - diff --git a/test/programs/comments-override/schema.json b/test/programs/comments-override/schema.json index 360ce985..3de646fe 100644 --- a/test/programs/comments-override/schema.json +++ b/test/programs/comments-override/schema.json @@ -1,47 +1,38 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "MySubObject": { - "additionalProperties": true, - "description": "Type-level description", - "properties": { - "value": { - "type": "string" - } - }, - "required": [ - "value" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "MySubObject": { + "description": "Type-level description", + "properties": { + "value": { + "type": "string" } + }, + "required": [ "value" ], + "type": "object" + } + }, + "properties": { + "date": { + "description": "Date property description", + "format": "date-time", + "type": "string" }, - "properties": { - "date": { - "description": "Date property description", - "format": "date-time", - "type": "string" - }, - "list": { - "items": { - "$ref": "#/definitions/MySubObject" - }, - "type": "array" - }, - "sub1": { - "$ref": "#/definitions/MySubObject" - }, - "sub2": { - "$ref": "#/definitions/MySubObject", - "description": "Property-level description" - } + "list": { + "items": { + "$ref": "#/definitions/MySubObject" + }, + "type": "array" + }, + "sub1": { + "$ref": "#/definitions/MySubObject" }, - "required": [ - "date", - "list", - "sub1", - "sub2" - ], - "type": "object" + "sub2": { + "$ref": "#/definitions/MySubObject", + "description": "Property-level description" + } + }, + "required": [ "date", "list", "sub1", "sub2" ], + "type": "object" } - diff --git a/test/programs/const-as-enum/schema.json b/test/programs/const-as-enum/schema.json index 061c10c0..9fb99e86 100644 --- a/test/programs/const-as-enum/schema.json +++ b/test/programs/const-as-enum/schema.json @@ -1,16 +1,11 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "reference": { - "enum": [ - true - ], - "type": "boolean" - } - }, - "required": [ - "reference" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "reference": { + "const": true + } + }, + "required": [ "reference" ], + "type": "object" } diff --git a/test/programs/const-keyword/schema.json b/test/programs/const-keyword/schema.json index c2a28b7c..97532268 100644 --- a/test/programs/const-keyword/schema.json +++ b/test/programs/const-keyword/schema.json @@ -1,13 +1,11 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "value": { - "const": "value", - "type": "string" - } - }, - "required": ["value"], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "value": { + "const": "value" + } + }, + "required": [ "value" ], + "type": "object" } - diff --git a/test/programs/enums-compiled-compute/schema.json b/test/programs/enums-compiled-compute/schema.json index 5e9df0b4..4f7c3eba 100644 --- a/test/programs/enums-compiled-compute/schema.json +++ b/test/programs/enums-compiled-compute/schema.json @@ -1,11 +1,4 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "enum": [ - 2, - 4, - 6, - 1 - ], - "type": "number" + "$schema": "http://json-schema.org/draft-07/schema#", + "enum": [ 2, 4, 6, 1 ] } - diff --git a/test/programs/enums-mixed/schema.json b/test/programs/enums-mixed/schema.json index 3b91d6a3..5ae37160 100644 --- a/test/programs/enums-mixed/schema.json +++ b/test/programs/enums-mixed/schema.json @@ -1,31 +1,16 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "Enum": { - "enum": [ - 0, - 1, - true, - "str", - null - ], - "type": [ - "number", - "boolean", - "string", - "null" - ] - } - }, - "properties": { - "foo": { - "$ref": "#/definitions/Enum" - } - }, - "required": [ - "foo" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "Enum": { + "enum": [ 0, 1, true, "str", null ] + } + }, + "properties": { + "foo": { + "$ref": "#/definitions/Enum" + } + }, + "required": [ "foo" ], + "type": "object" } - diff --git a/test/programs/enums-number-initialized/schema.json b/test/programs/enums-number-initialized/schema.json index 01c66c33..48a347ad 100644 --- a/test/programs/enums-number-initialized/schema.json +++ b/test/programs/enums-number-initialized/schema.json @@ -1,11 +1,4 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "enum": [ - 10, - 11, - 12, - 1 - ], - "type": "number" + "$schema": "http://json-schema.org/draft-07/schema#", + "enum": [ 10, 11, 12, 1 ] } - diff --git a/test/programs/enums-number/schema.json b/test/programs/enums-number/schema.json index 0f43dc0b..eb8148ad 100644 --- a/test/programs/enums-number/schema.json +++ b/test/programs/enums-number/schema.json @@ -1,23 +1,16 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "Enum": { - "enum": [ - 1, - 2 - ], - "type": "number" - } - }, - "properties": { - "foo": { - "$ref": "#/definitions/Enum" - } - }, - "required": [ - "foo" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "Enum": { + "enum": [ 1, 2 ] + } + }, + "properties": { + "foo": { + "$ref": "#/definitions/Enum" + } + }, + "required": [ "foo" ], + "type": "object" } - diff --git a/test/programs/enums-string/schema.json b/test/programs/enums-string/schema.json index 1f7e1e67..c852fff0 100644 --- a/test/programs/enums-string/schema.json +++ b/test/programs/enums-string/schema.json @@ -1,24 +1,16 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "Enum": { - "enum": [ - "x", - "y", - "123" - ], - "type": "string" - } - }, - "properties": { - "foo": { - "$ref": "#/definitions/Enum" - } - }, - "required": [ - "foo" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "Enum": { + "enum": [ "x", "y", "123" ] + } + }, + "properties": { + "foo": { + "$ref": "#/definitions/Enum" + } + }, + "required": [ "foo" ], + "type": "object" } - diff --git a/test/programs/enums-value-in-interface/schema.json b/test/programs/enums-value-in-interface/schema.json index 6bf5f6b6..b2a68351 100644 --- a/test/programs/enums-value-in-interface/schema.json +++ b/test/programs/enums-value-in-interface/schema.json @@ -1,20 +1,16 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "A.B": { - "const": 0, - "type": "number" - } - }, - "properties": { - "code": { - "$ref": "#/definitions/A.B" - } - }, - "required": [ - "code" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "A.B": { + "const": 0 + } + }, + "properties": { + "code": { + "$ref": "#/definitions/A.B" + } + }, + "required": [ "code" ], + "type": "object" } - diff --git a/test/programs/generate-all-types/schema.json b/test/programs/generate-all-types/schema.json index 80abeced..01eb3195 100644 --- a/test/programs/generate-all-types/schema.json +++ b/test/programs/generate-all-types/schema.json @@ -1,18 +1,16 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "MyEnum": { - "const": 0, - "type": "number" - }, - "MyInterface": { - "additionalProperties": false, - "type": "object" - }, - "MyObject": { - "additionalProperties": false, - "type": "object" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "MyEnum": { + "const": 0 + }, + "MyInterface": { + "additionalProperties": false, + "type": "object" + }, + "MyObject": { + "additionalProperties": false, + "type": "object" } + } } - diff --git a/test/programs/interface-extra-props/schema.json b/test/programs/interface-extra-props/schema.json index 4dfbcb5a..dd8b3b2a 100644 --- a/test/programs/interface-extra-props/schema.json +++ b/test/programs/interface-extra-props/schema.json @@ -1,26 +1,4 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "MyObject": { - "type": "object", - "properties": { - "required": { - "type": "string" - }, - "optional": { - "type": "number" - } - }, - "required": [ - "required" - ], - "additionalProperties": { - "type": [ - "string", - "number" - ] - } - } - }, - "$ref": "#/definitions/MyObject" + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/MyObject" } diff --git a/test/programs/module-interface-deep/schema.json b/test/programs/module-interface-deep/schema.json index 4dbc0b74..2488eea0 100644 --- a/test/programs/module-interface-deep/schema.json +++ b/test/programs/module-interface-deep/schema.json @@ -1,64 +1,53 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "MyModule.Def": { - "id": "MyModule.Def", - "type": "object", - "properties": { - "nest": { - "$ref": "#/definitions/MyModule.Def" - }, - "prev": { - "$ref": "#/definitions/MyModule.Def" - }, - "propA": { - "$ref": "#/definitions/MyModule.SubModule.HelperA" - }, - "propB": { - "$ref": "#/definitions/MyModule.SubModule.HelperB" - } - }, - "required": [ - "nest", - "prev", - "propA", - "propB" - ], - "additionalProperties": false + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "MyModule.Def": { + "x-id": "MyModule.Def", + "type": "object", + "properties": { + "nest": { + "$ref": "#/definitions/MyModule.Def" }, - "MyModule.SubModule.HelperA": { - "id": "MyModule.SubModule.HelperA", - "type": "object", - "properties": { - "propA": { - "type": "number" - }, - "propB": { - "$ref": "#/definitions/MyModule.SubModule.HelperB" - } - }, - "required": [ - "propA", - "propB" - ], - "additionalProperties": false + "prev": { + "$ref": "#/definitions/MyModule.Def" }, - "MyModule.SubModule.HelperB": { - "id": "MyModule.SubModule.HelperB", - "type": "object", - "properties": { - "propA": { - "$ref": "#/definitions/MyModule.SubModule.HelperA" - }, - "propB": { - "$ref": "#/definitions/MyModule.Def" - } - }, - "required": [ - "propA", - "propB" - ], - "additionalProperties": false + "propA": { + "$ref": "#/definitions/MyModule.SubModule.HelperA" + }, + "propB": { + "$ref": "#/definitions/MyModule.SubModule.HelperB" + } + }, + "required": [ "nest", "prev", "propA", "propB" ], + "additionalProperties": false + }, + "MyModule.SubModule.HelperA": { + "x-id": "MyModule.SubModule.HelperA", + "type": "object", + "properties": { + "propA": { + "type": "number" + }, + "propB": { + "$ref": "#/definitions/MyModule.SubModule.HelperB" + } + }, + "required": [ "propA", "propB" ], + "additionalProperties": false + }, + "MyModule.SubModule.HelperB": { + "x-id": "MyModule.SubModule.HelperB", + "type": "object", + "properties": { + "propA": { + "$ref": "#/definitions/MyModule.SubModule.HelperA" + }, + "propB": { + "$ref": "#/definitions/MyModule.Def" } + }, + "required": [ "propA", "propB" ], + "additionalProperties": false } + } } diff --git a/test/programs/namespace/schema.json b/test/programs/namespace/schema.json index 8a26e93e..c831cf32 100644 --- a/test/programs/namespace/schema.json +++ b/test/programs/namespace/schema.json @@ -1,9 +1,4 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "enum": [ - "x", - "y" - ], - "type": "string" + "$schema": "http://json-schema.org/draft-07/schema#", + "enum": [ "x", "y" ] } - diff --git a/test/programs/satisfies-keyword/schema.json b/test/programs/satisfies-keyword/schema.json index 77121303..a87a4557 100644 --- a/test/programs/satisfies-keyword/schema.json +++ b/test/programs/satisfies-keyword/schema.json @@ -1,24 +1,17 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "a": { - "const": "a", - "type": "string" - }, - "b": { - "const": 1, - "type": "number" - }, - "c": { - "const": true, - "type": "boolean" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "a": { + "const": "a" }, - "required": [ - "a", - "b", - "c" - ], - "type": "object" + "b": { + "const": 1 + }, + "c": { + "const": true + } + }, + "required": [ "a", "b", "c" ], + "type": "object" } diff --git a/test/programs/strict-null-checks/schema.json b/test/programs/strict-null-checks/schema.json index 6b9965b6..03993420 100644 --- a/test/programs/strict-null-checks/schema.json +++ b/test/programs/strict-null-checks/schema.json @@ -1,51 +1,39 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "val": { - "type": "number" - }, - "valNullable": { - "type": [ - "null", - "number" - ] - }, - "valOpt": { - "type": "number" - }, - "valTrue": { - "const": true, - "type": "boolean" - }, - "valTrueOpt": { - "const": true, - "type": "boolean" - }, - "valTrueOrNull": { - "anyOf": [ - { - "const": true, - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "valUndef": { - "type": "number" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "val": { + "type": "number" + }, + "valNullable": { + "type": [ "null", "number" ] + }, + "valOpt": { + "type": "number" + }, + "valTrue": { + "const": true + }, + "valTrueOpt": { + "const": true + }, + "valTrueOrNull": { + "anyOf": [ + { + "const": true }, - "valVoid": { - "type": "number" + { + "type": "null" } + ] + }, + "valUndef": { + "type": "number" }, - "required": [ - "val", - "valNullable", - "valTrue", - "valTrueOrNull" - ], - "type": "object" + "valVoid": { + "type": "number" + } + }, + "required": [ "val", "valNullable", "valTrue", "valTrueOrNull" ], + "type": "object" } - diff --git a/test/programs/string-literals-inline/schema.json b/test/programs/string-literals-inline/schema.json index 55c215f2..d30f8f2b 100644 --- a/test/programs/string-literals-inline/schema.json +++ b/test/programs/string-literals-inline/schema.json @@ -1,24 +1,14 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "bar": { - "type": "string" - }, - "foo": { - "enum": [ - "", - "abort", - "fail", - "ok" - ], - "type": "string" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "bar": { + "type": "string" }, - "required": [ - "bar", - "foo" - ], - "type": "object" + "foo": { + "enum": [ "", "abort", "fail", "ok" ] + } + }, + "required": [ "bar", "foo" ], + "type": "object" } - diff --git a/test/programs/string-literals/schema.json b/test/programs/string-literals/schema.json index de00a89d..c3b241a4 100644 --- a/test/programs/string-literals/schema.json +++ b/test/programs/string-literals/schema.json @@ -1,29 +1,19 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "result": { - "enum": [ - "", - "abort", - "fail", - "ok" - ], - "type": "string" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "result": { + "enum": [ "", "abort", "fail", "ok" ] + } + }, + "properties": { + "bar": { + "type": "string" }, - "properties": { - "bar": { - "type": "string" - }, - "foo": { - "$ref": "#/definitions/result" - } - }, - "required": [ - "bar", - "foo" - ], - "type": "object" + "foo": { + "$ref": "#/definitions/result" + } + }, + "required": [ "bar", "foo" ], + "type": "object" } - diff --git a/test/programs/string-template-literal/schema.json b/test/programs/string-template-literal/schema.json index cc1e1e08..86b011ed 100644 --- a/test/programs/string-template-literal/schema.json +++ b/test/programs/string-template-literal/schema.json @@ -1,62 +1,45 @@ { - "type": "object", - "properties": { - "a": { - "type": "string", - "pattern": "^@.*$" - }, - "b": { - "type": "string", - "pattern": "^@[0-9]*$" - }, - "c": { - "type": "string", - "pattern": "^@[0-9]*$" - }, - "d": { - "enum": [ - "@false", - "@true" - ], - "type": "string" - }, - "e": { - "type": "string", - "const": "@undefined" - }, - "f": { - "type": "string", - "const": "@null" - }, - "g": { - "type": "string", - "pattern": "^.*@$" - }, - "h": { - "type": "string", - "pattern": "^[0-9]*@$" - }, - "i": { - "type": "string", - "pattern": "^.*@[0-9]*$" - }, - "j": { - "type": "string", - "pattern": "^.*\\..*$" - } - }, - "additionalProperties": false, - "required": [ - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j" - ], - "$schema": "http://json-schema.org/draft-07/schema#" -} \ No newline at end of file + "type": "object", + "properties": { + "a": { + "type": "string", + "pattern": "^@.*$" + }, + "b": { + "type": "string", + "pattern": "^@[0-9]*$" + }, + "c": { + "type": "string", + "pattern": "^@[0-9]*$" + }, + "d": { + "enum": [ "@false", "@true" ] + }, + "e": { + "const": "@undefined" + }, + "f": { + "const": "@null" + }, + "g": { + "type": "string", + "pattern": "^.*@$" + }, + "h": { + "type": "string", + "pattern": "^[0-9]*@$" + }, + "i": { + "type": "string", + "pattern": "^.*@[0-9]*$" + }, + "j": { + "type": "string", + "pattern": "^.*\\..*$" + } + }, + "additionalProperties": false, + "required": [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" ], + "$schema": "http://json-schema.org/draft-07/schema#" +} diff --git a/test/programs/type-aliases-primitive/schema.json b/test/programs/type-aliases-primitive/schema.json index d38e7834..4c5a495b 100644 --- a/test/programs/type-aliases-primitive/schema.json +++ b/test/programs/type-aliases-primitive/schema.json @@ -1,9 +1,4 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "MyString": { - "type": "string" - } - }, - "$ref": "#/definitions/MyString" + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/MyString" } diff --git a/test/programs/type-aliases-tuple-with-names/schema.json b/test/programs/type-aliases-tuple-with-names/schema.json index e33e4866..27f1ea14 100644 --- a/test/programs/type-aliases-tuple-with-names/schema.json +++ b/test/programs/type-aliases-tuple-with-names/schema.json @@ -8,7 +8,6 @@ }, { "title": "b", - "type": "number", "const": 123 }, { diff --git a/test/programs/type-aliases-tuple/schema.json b/test/programs/type-aliases-tuple/schema.json index 7fb6e5af..888ed27f 100644 --- a/test/programs/type-aliases-tuple/schema.json +++ b/test/programs/type-aliases-tuple/schema.json @@ -1,28 +1,4 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "MyTuple": { - "type": "array", - "items": [ - { - "type": "string" - }, - { - "type": "number" - } - ], - "additionalItems": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - }, - "minItems": 2 - } - }, - "$ref": "#/definitions/MyTuple" -} \ No newline at end of file + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/MyTuple" +} diff --git a/test/programs/type-aliases-union-namespace/schema.json b/test/programs/type-aliases-union-namespace/schema.json index ee00df40..a86c5c28 100644 --- a/test/programs/type-aliases-union-namespace/schema.json +++ b/test/programs/type-aliases-union-namespace/schema.json @@ -1,25 +1,16 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "Cardinal": { - "enum": [ - "east", - "north", - "south", - "west" - ], - "type": "string" - } - }, - "properties": { - "direction": { - "$ref": "#/definitions/Cardinal" - } - }, - "required": [ - "direction" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "Cardinal": { + "enum": [ "east", "north", "south", "west" ] + } + }, + "properties": { + "direction": { + "$ref": "#/definitions/Cardinal" + } + }, + "required": [ "direction" ], + "type": "object" } - diff --git a/test/programs/type-literals/schema.json b/test/programs/type-literals/schema.json index ce97b1df..745799e7 100644 --- a/test/programs/type-literals/schema.json +++ b/test/programs/type-literals/schema.json @@ -3,20 +3,18 @@ "additionalProperties": false, "properties": { "param1": { - "enum": ["1", "2", "3"], - "type": "string" + "enum": [ "1", "2", "3" ] }, "param2": { - "enum": ["1", "2", 3, true] + "enum": [ "1", "2", 3, true ] }, "param3": { - "enum": ["1", "2", "3"], - "type": "string" + "enum": [ "1", "2", "3" ] }, "param4": { - "enum": ["1", "2", 3, true] + "enum": [ "1", "2", 3, true ] } }, - "required": ["param1", "param2", "param3", "param4"], + "required": [ "param1", "param2", "param3", "param4" ], "type": "object" } diff --git a/test/programs/type-primitives/schema.json b/test/programs/type-primitives/schema.json index dadd3a34..cb8694ef 100644 --- a/test/programs/type-primitives/schema.json +++ b/test/programs/type-primitives/schema.json @@ -1,69 +1,57 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "array1": { - "default": null, - "items": { - }, - "type": "array" - }, - "array2": { - "default": null, - "items": { - "type": "number" - }, - "type": "array" - }, - "boolean1": { - "default": true, - "type": "boolean" - }, - "integer1": { - "default": 1, - "type": "integer" - }, - "integer2": { - "default": 1, - "type": "integer" - }, - "number1": { - "default": 1, - "type": "number" - }, - "object1": { - "default": null - }, - "object2": { - "default": null, - "properties": { - }, - "type": "object" - }, - "object3": { - "default": null, - "properties": { - }, - "additionalProperties": true, - "type": "object" - }, - "string1": { - "default": "defaultValue", - "type": "string" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "array1": { + "type": "array" }, - "required": [ - "array1", - "array2", - "boolean1", - "integer1", - "integer2", - "number1", - "object1", - "object2", - "object3", - "string1" - ], - "type": "object" + "array2": { + "items": { + "type": "number" + }, + "type": "array" + }, + "boolean1": { + "default": true, + "type": "boolean" + }, + "integer1": { + "default": 1, + "type": "integer" + }, + "integer2": { + "default": 1, + "type": "integer" + }, + "number1": { + "default": 1, + "type": "number" + }, + "object1": { + "default": null + }, + "object2": { + "type": "object" + }, + "object3": { + "type": "object" + }, + "string1": { + "default": "defaultValue", + "type": "string" + } + }, + "required": [ + "array1", + "array2", + "boolean1", + "integer1", + "integer2", + "number1", + "object1", + "object2", + "object3", + "string1" + ], + "type": "object" } - diff --git a/test/programs/type-union-tagged/schema.json b/test/programs/type-union-tagged/schema.json index 47ffa0b0..ed270335 100644 --- a/test/programs/type-union-tagged/schema.json +++ b/test/programs/type-union-tagged/schema.json @@ -1,72 +1,58 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "anyOf": [ - { - "$ref": "#/definitions/Square" - }, - { - "$ref": "#/definitions/Rectangle" + "$schema": "http://json-schema.org/draft-07/schema#", + "anyOf": [ + { + "$ref": "#/definitions/Square" + }, + { + "$ref": "#/definitions/Rectangle" + }, + { + "$ref": "#/definitions/Circle" + } + ], + "definitions": { + "Circle": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "circle" }, - { - "$ref": "#/definitions/Circle" + "radius": { + "type": "number" } - ], - "definitions": { - "Circle": { - "additionalProperties": false, - "properties": { - "kind": { - "const": "circle", - "type": "string" - }, - "radius": { - "type": "number" - } - }, - "required": [ - "kind", - "radius" - ], - "type": "object" + }, + "required": [ "kind", "radius" ], + "type": "object" + }, + "Rectangle": { + "additionalProperties": false, + "properties": { + "height": { + "type": "number" }, - "Rectangle": { - "additionalProperties": false, - "properties": { - "height": { - "type": "number" - }, - "kind": { - "const": "rectangle", - "type": "string" - }, - "width": { - "type": "number" - } - }, - "required": [ - "height", - "kind", - "width" - ], - "type": "object" + "kind": { + "const": "rectangle" + }, + "width": { + "type": "number" + } + }, + "required": [ "height", "kind", "width" ], + "type": "object" + }, + "Square": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "square" }, - "Square": { - "additionalProperties": false, - "properties": { - "kind": { - "const": "square", - "type": "string" - }, - "size": { - "type": "number" - } - }, - "required": [ - "kind", - "size" - ], - "type": "object" + "size": { + "type": "number" } + }, + "required": [ "kind", "size" ], + "type": "object" } + } } - diff --git a/test/programs/typeof-keyword/schema.json b/test/programs/typeof-keyword/schema.json index 77b9eecf..b7bed421 100644 --- a/test/programs/typeof-keyword/schema.json +++ b/test/programs/typeof-keyword/schema.json @@ -1,14 +1,11 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "foo": { - "typeof": "function" - } - }, - "required": [ - "foo" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "foo": { + "x-typeof": "function" + } + }, + "required": [ "foo" ], + "type": "object" } - diff --git a/test/programs/unique-names-multiple-subdefinitions/schema.json b/test/programs/unique-names-multiple-subdefinitions/schema.json index e738adaa..20b97b5f 100644 --- a/test/programs/unique-names-multiple-subdefinitions/schema.json +++ b/test/programs/unique-names-multiple-subdefinitions/schema.json @@ -1,29 +1,23 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "sub": { - "$ref": "#/definitions/SubObject.0eb4e9af" - } - }, - "type": "object", - "required": [ - "sub" - ], - "definitions": { - "SubObject.0eb4e9af": { - "additionalProperties": false, - "properties": { - "is": { - "const": "SubObject_1", - "type": "string" - } - }, - "required": [ - "is" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "sub": { + "$ref": "#/definitions/SubObject.0eb4e9af" + } + }, + "type": "object", + "required": [ "sub" ], + "definitions": { + "SubObject.0eb4e9af": { + "additionalProperties": false, + "properties": { + "is": { + "const": "SubObject_1" } + }, + "required": [ "is" ], + "type": "object" } + } } - diff --git a/test/programs/user-validation-keywords/schema.json b/test/programs/user-validation-keywords/schema.json index 3726a3b6..fd3e1923 100644 --- a/test/programs/user-validation-keywords/schema.json +++ b/test/programs/user-validation-keywords/schema.json @@ -1,25 +1,19 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "name": { - "chance": { - "pickone": [ - [ - "first", - "last" - ] - ] - }, - "description": "Must be 'first' or 'last'", - "important": "", - "minLength": 1, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "name": { + "x-chance": { + "pickone": [ + [ "first", "last" ] + ] + }, + "description": "Must be 'first' or 'last'", + "x-important": "", + "minLength": 1, + "type": "string" + } + }, + "required": [ "name" ], + "type": "object" } -