Regenerate test schemas

This commit is contained in:
Graham Esau 2024-05-13 18:33:48 +01:00
parent 4dde683358
commit f5d2142714
62 changed files with 1135 additions and 1124 deletions

View file

@ -179,8 +179,17 @@ mod ser {
use serde::ser::{Serialize, SerializeMap, SerializeSeq};
use serde_json::Value;
const ORDERED_KEYWORDS_START: [&str; 6] =
["$id", "$schema", "title", "description", "type", "format"];
// The order of properties in a JSON Schema object is insignificant, but we explicitly order
// some of them here to make them easier for a human to read.
const ORDERED_KEYWORDS_START: [&str; 7] = [
"$id",
"$schema",
"title",
"description",
"type",
"format",
"properties",
];
const ORDERED_KEYWORDS_END: [&str; 2] = ["$defs", "definitions"];
pub(super) struct OrderedKeywordWrapper<'a>(pub &'a Value);

View file

@ -2,10 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyContainer",
"type": "object",
"required": [
"associated",
"generic"
],
"properties": {
"associated": {
"type": "string"
@ -13,5 +9,9 @@
"generic": {
"type": "null"
}
}
},
"required": [
"associated",
"generic"
]
}

View file

@ -2,26 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ChronoTypes",
"type": "object",
"required": [
"date_time",
"naive_date",
"naive_date_time",
"naive_time",
"weekday"
],
"properties": {
"weekday": {
"type": "string",
"enum": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
]
},
"date_time": {
"type": "string",
"format": "date-time"
@ -37,6 +18,25 @@
"naive_time": {
"type": "string",
"format": "partial-date-time"
},
"weekday": {
"type": "string",
"enum": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
]
}
}
},
"required": [
"date_time",
"naive_date",
"naive_date_time",
"naive_time",
"weekday"
]
}

View file

@ -2,18 +2,18 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct",
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
},
"foo": {
"description": "This is a document",
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
}
}
},
"required": [
"bar",
"foo"
]
}

View file

@ -3,22 +3,22 @@
"title": "MyStruct",
"type": "object",
"properties": {
"my_int": {
"default": 0,
"type": "integer",
"format": "int32"
},
"my_bool": {
"default": false,
"type": "boolean"
"type": "boolean",
"default": false
},
"my_int": {
"type": "integer",
"format": "int32",
"default": 0
},
"my_struct2": {
"default": "i:0 b:false",
"allOf": [
{
"$ref": "#/definitions/MyStruct2"
}
]
],
"default": "i:0 b:false"
},
"my_struct2_default_skipped": {
"$ref": "#/definitions/MyStruct2"
@ -31,14 +31,14 @@
"MyStruct2": {
"type": "object",
"properties": {
"my_int": {
"default": 6,
"type": "integer",
"format": "int32"
},
"my_bool": {
"default": true,
"type": "boolean"
"type": "boolean",
"default": true
},
"my_int": {
"type": "integer",
"format": "int32",
"default": 6
}
}
},

View file

@ -10,38 +10,38 @@
]
},
{
"deprecated": true,
"type": "string",
"deprecated": true,
"enum": [
"DeprecatedUnitVariant"
]
},
{
"deprecated": true,
"type": "object",
"required": [
"DeprecatedStructVariant"
],
"properties": {
"DeprecatedStructVariant": {
"type": "object",
"required": [
"deprecated_field",
"foo"
],
"properties": {
"deprecated_field": {
"deprecated": true,
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"foo": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"deprecated_field",
"foo"
]
}
},
"additionalProperties": false
"additionalProperties": false,
"deprecated": true,
"required": [
"DeprecatedStructVariant"
]
}
]
}

View file

@ -1,20 +1,20 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "DeprecatedStruct",
"deprecated": true,
"type": "object",
"required": [
"deprecated_field",
"foo"
],
"properties": {
"deprecated_field": {
"type": "boolean",
"deprecated": true
},
"foo": {
"type": "integer",
"format": "int32"
},
"deprecated_field": {
"deprecated": true,
"type": "boolean"
}
}
},
"deprecated": true,
"required": [
"deprecated_field",
"foo"
]
}

View file

@ -21,9 +21,6 @@
"title": "Complex variant",
"description": "This is a struct-like variant.",
"type": "object",
"required": [
"Complex"
],
"properties": {
"Complex": {
"type": "object",
@ -39,7 +36,10 @@
}
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"Complex"
]
}
]
}

View file

@ -3,10 +3,6 @@
"title": "OverrideDocs struct",
"description": "New description",
"type": "object",
"required": [
"my_int",
"my_undocumented_bool"
],
"properties": {
"my_int": {
"title": "My integer",
@ -17,5 +13,9 @@
"my_undocumented_bool": {
"type": "boolean"
}
}
},
"required": [
"my_int",
"my_undocumented_bool"
]
}

View file

@ -3,11 +3,6 @@
"title": "This is the struct's title",
"description": "This is the struct's description.",
"type": "object",
"required": [
"my_int",
"my_undocumented_bool",
"my_unit"
],
"properties": {
"my_int": {
"title": "An integer",
@ -26,6 +21,11 @@
]
}
},
"required": [
"my_int",
"my_undocumented_bool",
"my_unit"
],
"definitions": {
"MyUnitStruct": {
"title": "A Unit",

View file

@ -3,11 +3,6 @@
"title": "This is the struct's title",
"description": "This is the struct's description.",
"type": "object",
"required": [
"my_int",
"my_undocumented_bool",
"my_unit"
],
"properties": {
"my_int": {
"title": "An integer",
@ -22,6 +17,11 @@
"$ref": "#/definitions/MyUnitStruct"
}
},
"required": [
"my_int",
"my_undocumented_bool",
"my_unit"
],
"definitions": {
"MyUnitStruct": {
"title": "A Unit",

View file

@ -2,10 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"required": [
"duration",
"time"
],
"properties": {
"duration": {
"$ref": "#/definitions/Duration"
@ -14,44 +10,48 @@
"$ref": "#/definitions/SystemTime"
}
},
"required": [
"duration",
"time"
],
"definitions": {
"Duration": {
"type": "object",
"required": [
"nanos",
"secs"
],
"properties": {
"secs": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"nanos": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
}
},
"SystemTime": {
"type": "object",
"required": [
"nanos_since_epoch",
"secs_since_epoch"
],
"properties": {
"secs_since_epoch": {
},
"secs": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
}
},
"required": [
"nanos",
"secs"
]
},
"SystemTime": {
"type": "object",
"properties": {
"nanos_since_epoch": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"secs_since_epoch": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
},
"required": [
"nanos_since_epoch",
"secs_since_epoch"
]
}
}
}

View file

@ -4,9 +4,6 @@
"oneOf": [
{
"type": "object",
"required": [
"t"
],
"properties": {
"t": {
"type": "string",
@ -15,14 +12,13 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"t"
]
},
{
"type": "object",
"required": [
"c",
"t"
],
"properties": {
"c": {
"type": "object",
@ -37,14 +33,14 @@
]
}
},
"additionalProperties": false
},
{
"type": "object",
"additionalProperties": false,
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"$ref": "#/definitions/UnitStruct"
@ -56,14 +52,14 @@
]
}
},
"additionalProperties": false
},
{
"type": "object",
"additionalProperties": false,
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"$ref": "#/definitions/Struct"
@ -75,21 +71,17 @@
]
}
},
"additionalProperties": false
},
{
"type": "object",
"additionalProperties": false,
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -99,7 +91,11 @@
"format": "int32"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"bar",
"foo"
]
},
"t": {
"type": "string",
@ -108,14 +104,14 @@
]
}
},
"additionalProperties": false
},
{
"type": "object",
"additionalProperties": false,
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"type": "array",
@ -138,13 +134,14 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"c",
"t"
]
},
{
"type": "object",
"required": [
"t"
],
"properties": {
"t": {
"type": "string",
@ -153,14 +150,13 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"t"
]
},
{
"type": "object",
"required": [
"c",
"t"
],
"properties": {
"c": {
"type": "integer",
@ -173,16 +169,16 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"c",
"t"
]
}
],
"definitions": {
"Struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -191,7 +187,11 @@
"type": "integer",
"format": "int32"
}
}
},
"required": [
"bar",
"foo"
]
},
"UnitStruct": {
"type": "null"

View file

@ -4,9 +4,6 @@
"oneOf": [
{
"type": "object",
"required": [
"t"
],
"properties": {
"t": {
"type": "string",
@ -14,14 +11,13 @@
"UnitOne"
]
}
}
},
"required": [
"t"
]
},
{
"type": "object",
"required": [
"c",
"t"
],
"properties": {
"c": {
"type": "object",
@ -35,14 +31,14 @@
"StringMap"
]
}
}
},
{
"type": "object",
},
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"$ref": "#/definitions/UnitStruct"
@ -53,14 +49,14 @@
"UnitStructNewType"
]
}
}
},
{
"type": "object",
},
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"$ref": "#/definitions/Struct"
@ -71,21 +67,17 @@
"StructNewType"
]
}
}
},
{
"type": "object",
},
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -94,7 +86,11 @@
"type": "integer",
"format": "int32"
}
}
},
"required": [
"bar",
"foo"
]
},
"t": {
"type": "string",
@ -102,14 +98,14 @@
"Struct"
]
}
}
},
{
"type": "object",
},
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"type": "array",
@ -131,13 +127,14 @@
"Tuple"
]
}
}
},
"required": [
"c",
"t"
]
},
{
"type": "object",
"required": [
"t"
],
"properties": {
"t": {
"type": "string",
@ -145,14 +142,13 @@
"UnitTwo"
]
}
}
},
"required": [
"t"
]
},
{
"type": "object",
"required": [
"c",
"t"
],
"properties": {
"c": {
"type": "integer",
@ -164,16 +160,16 @@
"WithInt"
]
}
}
},
"required": [
"c",
"t"
]
}
],
"definitions": {
"Struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -182,7 +178,11 @@
"type": "integer",
"format": "int32"
}
}
},
"required": [
"bar",
"foo"
]
},
"UnitStruct": {
"type": "null"

View file

@ -11,9 +11,6 @@
},
{
"type": "object",
"required": [
"stringMap"
],
"properties": {
"stringMap": {
"type": "object",
@ -22,44 +19,40 @@
}
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"stringMap"
]
},
{
"type": "object",
"required": [
"unitStructNewType"
],
"properties": {
"unitStructNewType": {
"$ref": "#/definitions/UnitStruct"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"unitStructNewType"
]
},
{
"type": "object",
"required": [
"structNewType"
],
"properties": {
"structNewType": {
"$ref": "#/definitions/Struct"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"structNewType"
]
},
{
"type": "object",
"required": [
"struct"
],
"properties": {
"struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -69,16 +62,20 @@
"format": "int32"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"bar",
"foo"
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"struct"
]
},
{
"type": "object",
"required": [
"tuple"
],
"properties": {
"tuple": {
"type": "array",
@ -95,29 +92,28 @@
"minItems": 2
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"tuple"
]
},
{
"type": "object",
"required": [
"withInt"
],
"properties": {
"withInt": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"withInt"
]
}
],
"definitions": {
"Struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -126,7 +122,11 @@
"type": "integer",
"format": "int32"
}
}
},
"required": [
"bar",
"foo"
]
},
"UnitStruct": {
"type": "null"

View file

@ -11,9 +11,6 @@
},
{
"type": "object",
"required": [
"stringMap"
],
"properties": {
"stringMap": {
"type": "object",
@ -22,44 +19,40 @@
}
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"stringMap"
]
},
{
"type": "object",
"required": [
"unitStructNewType"
],
"properties": {
"unitStructNewType": {
"$ref": "#/definitions/UnitStruct"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"unitStructNewType"
]
},
{
"type": "object",
"required": [
"structNewType"
],
"properties": {
"structNewType": {
"$ref": "#/definitions/Struct"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"structNewType"
]
},
{
"type": "object",
"required": [
"struct"
],
"properties": {
"struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -68,16 +61,20 @@
"type": "integer",
"format": "int32"
}
}
},
"required": [
"bar",
"foo"
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"struct"
]
},
{
"type": "object",
"required": [
"tuple"
],
"properties": {
"tuple": {
"type": "array",
@ -94,29 +91,28 @@
"minItems": 2
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"tuple"
]
},
{
"type": "object",
"required": [
"withInt"
],
"properties": {
"withInt": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"withInt"
]
}
],
"definitions": {
"Struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
@ -125,7 +121,11 @@
"type": "integer",
"format": "int32"
}
}
},
"required": [
"bar",
"foo"
]
},
"UnitStruct": {
"type": "null"

View file

@ -4,9 +4,6 @@
"oneOf": [
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -15,13 +12,13 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -32,13 +29,13 @@
},
"additionalProperties": {
"type": "string"
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -47,15 +44,13 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"bar",
"foo",
"typeProperty"
],
"properties": {
"bar": {
"type": "boolean"
@ -70,15 +65,15 @@
"StructNewType"
]
}
}
},
{
"type": "object",
},
"required": [
"bar",
"foo",
"typeProperty"
],
]
},
{
"type": "object",
"properties": {
"bar": {
"type": "boolean"
@ -94,13 +89,15 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"bar",
"foo",
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -109,14 +106,14 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"typeProperty"
]
},
{
"type": "object",
"format": "int32",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -124,7 +121,10 @@
"WithInt"
]
}
}
},
"required": [
"typeProperty"
]
}
]
}

View file

@ -4,9 +4,6 @@
"oneOf": [
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -14,13 +11,13 @@
"UnitOne"
]
}
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -31,13 +28,13 @@
},
"additionalProperties": {
"type": "string"
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -45,15 +42,13 @@
"UnitStructNewType"
]
}
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"bar",
"foo",
"typeProperty"
],
"properties": {
"bar": {
"type": "boolean"
@ -68,15 +63,15 @@
"StructNewType"
]
}
}
},
{
"type": "object",
},
"required": [
"bar",
"foo",
"typeProperty"
],
]
},
{
"type": "object",
"properties": {
"bar": {
"type": "boolean"
@ -91,13 +86,15 @@
"Struct"
]
}
}
},
"required": [
"bar",
"foo",
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -105,14 +102,14 @@
"UnitTwo"
]
}
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"format": "int32",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -120,7 +117,10 @@
"WithInt"
]
}
}
},
"required": [
"typeProperty"
]
}
]
}

View file

@ -4,9 +4,6 @@
"oneOf": [
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -15,13 +12,13 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -30,13 +27,13 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -45,7 +42,10 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"typeProperty"
]
}
]
}

View file

@ -4,9 +4,6 @@
"oneOf": [
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -14,13 +11,13 @@
"A"
]
}
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -28,13 +25,13 @@
"B"
]
}
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -42,7 +39,10 @@
"C"
]
}
}
},
"required": [
"typeProperty"
]
}
]
}

View file

@ -19,20 +19,20 @@
},
{
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
},
"foo": {
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"bar",
"foo"
]
},
{
"type": "array",
@ -54,24 +54,24 @@
}
],
"definitions": {
"UnitStruct": {
"type": "null"
},
"Struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
},
"foo": {
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
}
}
},
"required": [
"bar",
"foo"
]
},
"UnitStruct": {
"type": "null"
}
}
}

View file

@ -19,19 +19,19 @@
},
{
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
},
"foo": {
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
}
}
},
"required": [
"bar",
"foo"
]
},
{
"type": "array",
@ -53,24 +53,24 @@
}
],
"definitions": {
"UnitStruct": {
"type": "null"
},
"Struct": {
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"bar": {
"type": "boolean"
},
"foo": {
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
}
}
},
"required": [
"bar",
"foo"
]
},
"UnitStruct": {
"type": "null"
}
}
}

View file

@ -15,4 +15,4 @@
]
}
}
}
}

View file

@ -1,6 +1,29 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct",
"type": "object",
"properties": {
"bar": {
"type": "boolean"
},
"baz": {
"type": [
"string",
"null"
],
"examples": [
null
]
},
"foo": {
"type": "integer",
"format": "int32",
"examples": [
8,
null
]
}
},
"examples": [
{
"bar": false,
@ -9,31 +32,8 @@
},
null
],
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"foo": {
"examples": [
8,
null
],
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
},
"baz": {
"examples": [
null
],
"type": [
"string",
"null"
]
}
}
]
}

View file

@ -2,27 +2,21 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Flat",
"type": "object",
"required": [
"b",
"f",
"s",
"v"
],
"properties": {
"b": {
"type": "boolean"
},
"f": {
"type": "number",
"format": "float"
},
"b": {
"type": "boolean"
"os": {
"type": "string",
"default": ""
},
"s": {
"type": "string"
},
"os": {
"default": "",
"type": "string"
},
"v": {
"type": "array",
"items": {
@ -30,5 +24,11 @@
"format": "int32"
}
}
}
},
"required": [
"b",
"f",
"s",
"v"
]
}

View file

@ -1,21 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"examples": [
{
"bool": true,
"minusOne": -1,
"null": null,
"object": {
"array": [
"foo",
"bar"
]
},
"one": 1,
"zero": 0,
"zeroPointZero": 0.0
}
],
"type": "object",
"properties": {
"bool": {
@ -45,5 +29,21 @@
"zeroPointZero": {
"type": "number"
}
}
},
"examples": [
{
"bool": true,
"minusOne": -1,
"null": null,
"object": {
"array": [
"foo",
"bar"
]
},
"one": 1,
"zero": 0,
"zeroPointZero": 0.0
}
]
}

View file

@ -1,6 +1,56 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "MyStruct",
"type": "object",
"properties": {
"myBool": {
"type": "boolean"
},
"myInnerStruct": {
"type": "object",
"properties": {
"my_empty_map": {
"type": "object",
"additionalProperties": true
},
"my_empty_vec": {
"type": "array",
"items": true
},
"my_map": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"my_tuple": {
"type": "array",
"items": [
{
"type": "string",
"maxLength": 1,
"minLength": 1
},
{
"type": "integer"
}
],
"maxItems": 2,
"minItems": 2
},
"my_vec": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"myInt": {
"type": "integer"
},
"myNullableEnum": true
},
"examples": [
{
"myBool": true,
@ -22,55 +72,5 @@
"myInt": 123,
"myNullableEnum": null
}
],
"type": "object",
"properties": {
"myInt": {
"type": "integer"
},
"myBool": {
"type": "boolean"
},
"myNullableEnum": true,
"myInnerStruct": {
"type": "object",
"properties": {
"my_map": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"my_vec": {
"type": "array",
"items": {
"type": "string"
}
},
"my_empty_map": {
"type": "object",
"additionalProperties": true
},
"my_empty_vec": {
"type": "array",
"items": true
},
"my_tuple": {
"type": "array",
"items": [
{
"type": "string",
"maxLength": 1,
"minLength": 1
},
{
"type": "integer"
}
],
"maxItems": 2,
"minItems": 2
}
}
}
}
]
}

View file

@ -1,6 +1,56 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"properties": {
"myBool": {
"type": "boolean"
},
"myInnerStruct": {
"type": "object",
"properties": {
"my_empty_map": {
"type": "object",
"additionalProperties": true
},
"my_empty_vec": {
"type": "array",
"items": true
},
"my_map": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"my_tuple": {
"type": "array",
"items": [
{
"type": "string",
"maxLength": 1,
"minLength": 1
},
{
"type": "integer"
}
],
"maxItems": 2,
"minItems": 2
},
"my_vec": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"myInt": {
"type": "integer"
},
"myNullableEnum": true
},
"examples": [
{
"myBool": true,
@ -22,55 +72,5 @@
"myInt": 123,
"myNullableEnum": null
}
],
"type": "object",
"properties": {
"myInt": {
"type": "integer"
},
"myBool": {
"type": "boolean"
},
"myNullableEnum": true,
"myInnerStruct": {
"type": "object",
"properties": {
"my_map": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"my_vec": {
"type": "array",
"items": {
"type": "string"
}
},
"my_empty_map": {
"type": "object",
"additionalProperties": true
},
"my_empty_vec": {
"type": "array",
"items": true
},
"my_tuple": {
"type": "array",
"items": [
{
"type": "string",
"maxLength": 1,
"minLength": 1
},
{
"type": "integer"
}
],
"maxItems": 2,
"minItems": 2
}
}
}
}
]
}

View file

@ -2,26 +2,6 @@
"$schema": "https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Schema",
"title": "MyStruct",
"type": "object",
"example": {
"myBool": true,
"myInnerStruct": {
"my_empty_map": {},
"my_empty_vec": [],
"my_map": {
"": 0.0
},
"my_tuple": [
"💩",
42
],
"my_vec": [
"hello",
"world"
]
},
"myInt": 123,
"myNullableEnum": null
},
"properties": {
"myBool": {
"type": "boolean"
@ -72,5 +52,25 @@
"myNullableEnum": {
"nullable": true
}
},
"example": {
"myBool": true,
"myInnerStruct": {
"my_empty_map": {},
"my_empty_vec": [],
"my_map": {
"": 0.0
},
"my_tuple": [
"💩",
42
],
"my_vec": [
"hello",
"world"
]
},
"myInt": 123,
"myNullableEnum": null
}
}

View file

@ -2,10 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "IndexMapTypes",
"type": "object",
"required": [
"map",
"set"
],
"properties": {
"map": {
"type": "object",
@ -21,5 +17,9 @@
},
"uniqueItems": true
}
}
},
"required": [
"map",
"set"
]
}

View file

@ -18,14 +18,14 @@
"object",
"null"
],
"required": [
"recursive"
],
"properties": {
"recursive": {
"$ref": "#/definitions/RecursiveOuter"
}
}
},
"required": [
"recursive"
]
}
},
"definitions": {
@ -47,14 +47,14 @@
"object",
"null"
],
"required": [
"recursive"
],
"properties": {
"recursive": {
"$ref": "#/definitions/RecursiveOuter"
}
}
},
"required": [
"recursive"
]
}
}
}

View file

@ -2,22 +2,22 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyJob",
"type": "object",
"required": [
"spec"
],
"properties": {
"spec": {
"type": "object",
"required": [
"replicas"
],
"properties": {
"replicas": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
}
},
"required": [
"replicas"
]
}
}
},
"required": [
"spec"
]
}

View file

@ -4,29 +4,29 @@
"oneOf": [
{
"type": "object",
"required": [
"InnerStruct"
],
"properties": {
"InnerStruct": {
"$ref": "#/definitions/InnerStruct"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"InnerStruct"
]
}
],
"definitions": {
"InnerStruct": {
"type": "object",
"required": [
"x"
],
"properties": {
"x": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"x"
]
}
}
}

View file

@ -2,19 +2,19 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "A",
"type": "object",
"required": [
"v",
"x"
],
"properties": {
"v": {
"type": "integer",
"format": "int32"
},
"x": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
},
"v": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"v",
"x"
]
}

View file

@ -2,17 +2,13 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"required": [
"nonzero_signed",
"nonzero_unsigned",
"signed",
"unsigned"
],
"properties": {
"unsigned": {
"nonzero_signed": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
"format": "int32",
"not": {
"const": 0
}
},
"nonzero_unsigned": {
"type": "integer",
@ -23,12 +19,16 @@
"type": "integer",
"format": "int32"
},
"nonzero_signed": {
"unsigned": {
"type": "integer",
"format": "int32",
"not": {
"const": 0
}
"format": "uint32",
"minimum": 0.0
}
}
},
"required": [
"nonzero_signed",
"nonzero_unsigned",
"signed",
"unsigned"
]
}

View file

@ -2,26 +2,23 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OsStrings",
"type": "object",
"properties": {
"borrowed": {
"$ref": "#/definitions/OsString"
},
"owned": {
"$ref": "#/definitions/OsString"
}
},
"required": [
"borrowed",
"owned"
],
"properties": {
"owned": {
"$ref": "#/definitions/OsString"
},
"borrowed": {
"$ref": "#/definitions/OsString"
}
},
"definitions": {
"OsString": {
"oneOf": [
{
"type": "object",
"required": [
"Unix"
],
"properties": {
"Unix": {
"type": "array",
@ -31,13 +28,13 @@
"minimum": 0.0
}
}
}
},
"required": [
"Unix"
]
},
{
"type": "object",
"required": [
"Windows"
],
"properties": {
"Windows": {
"type": "array",
@ -47,7 +44,10 @@
"minimum": 0.0
}
}
}
},
"required": [
"Windows"
]
}
]
}

View file

@ -2,11 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"required": [
"camelCase",
"new_name_1",
"new_name_2"
],
"properties": {
"camelCase": {
"type": "integer",
@ -20,5 +15,10 @@
"type": "integer",
"format": "int32"
}
}
},
"required": [
"camelCase",
"new_name_1",
"new_name_2"
]
}

View file

@ -2,88 +2,88 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"properties": {
"bound": {
"$ref": "#/definitions/Bound_of_string"
},
"inclusive": {
"$ref": "#/definitions/Range_of_double"
},
"range": {
"$ref": "#/definitions/Range_of_uint"
}
},
"required": [
"bound",
"inclusive",
"range"
],
"properties": {
"range": {
"$ref": "#/definitions/Range_of_uint"
},
"inclusive": {
"$ref": "#/definitions/Range_of_double"
},
"bound": {
"$ref": "#/definitions/Bound_of_string"
}
},
"definitions": {
"Range_of_uint": {
"type": "object",
"required": [
"end",
"start"
],
"properties": {
"start": {
"type": "integer",
"format": "uint",
"minimum": 0.0
},
"end": {
"type": "integer",
"format": "uint",
"minimum": 0.0
}
}
},
"Range_of_double": {
"type": "object",
"required": [
"end",
"start"
],
"properties": {
"start": {
"type": "number",
"format": "double"
},
"end": {
"type": "number",
"format": "double"
}
}
},
"Bound_of_string": {
"oneOf": [
{
"type": "object",
"required": [
"Included"
],
"properties": {
"Included": {
"type": "string"
}
}
},
"required": [
"Included"
]
},
{
"type": "object",
"required": [
"Excluded"
],
"properties": {
"Excluded": {
"type": "string"
}
}
},
"required": [
"Excluded"
]
},
{
"type": "string",
"const": "Unbounded"
}
]
},
"Range_of_double": {
"type": "object",
"properties": {
"end": {
"type": "number",
"format": "double"
},
"start": {
"type": "number",
"format": "double"
}
},
"required": [
"end",
"start"
]
},
"Range_of_uint": {
"type": "object",
"properties": {
"end": {
"type": "integer",
"format": "uint",
"minimum": 0.0
},
"start": {
"type": "integer",
"format": "uint",
"minimum": 0.0
}
},
"required": [
"end",
"start"
]
}
}
}

View file

@ -2,54 +2,54 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Process",
"type": "object",
"required": [
"command_line",
"wall_time"
],
"properties": {
"command_line": {
"type": "string"
},
"wall_time": {
"$ref": "#/definitions/Duration"
"system_cpu_time": {
"allOf": [
{
"$ref": "#/definitions/Duration"
}
],
"default": "0.000000000s"
},
"user_cpu_time": {
"allOf": [
{
"$ref": "#/definitions/Duration"
}
],
"default": {
"nanos": 0,
"secs": 0
},
"allOf": [
{
"$ref": "#/definitions/Duration"
}
]
}
},
"system_cpu_time": {
"default": "0.000000000s",
"allOf": [
{
"$ref": "#/definitions/Duration"
}
]
"wall_time": {
"$ref": "#/definitions/Duration"
}
},
"required": [
"command_line",
"wall_time"
],
"definitions": {
"Duration": {
"type": "object",
"required": [
"nanos",
"secs"
],
"properties": {
"secs": {
"type": "integer",
"format": "int64"
},
"nanos": {
"type": "integer",
"format": "int32"
},
"secs": {
"type": "integer",
"format": "int64"
}
}
},
"required": [
"nanos",
"secs"
]
}
}
}

View file

@ -2,22 +2,10 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct_for_int32",
"type": "object",
"required": [
"byte_or_bool2",
"fake_map",
"s",
"unit_or_t2"
],
"properties": {
"byte_or_bool2": {
"$ref": "#/definitions/Or_for_uint8_and_boolean"
},
"unit_or_t2": {
"$ref": "#/definitions/Or_for_null_and_int32"
},
"s": {
"$ref": "#/definitions/Str"
},
"fake_map": {
"type": "object",
"additionalProperties": {
@ -27,9 +15,32 @@
},
"uniqueItems": true
}
},
"s": {
"$ref": "#/definitions/Str"
},
"unit_or_t2": {
"$ref": "#/definitions/Or_for_null_and_int32"
}
},
"required": [
"byte_or_bool2",
"fake_map",
"s",
"unit_or_t2"
],
"definitions": {
"Or_for_null_and_int32": {
"anyOf": [
{
"type": "null"
},
{
"type": "integer",
"format": "int32"
}
]
},
"Or_for_uint8_and_boolean": {
"anyOf": [
{
@ -42,17 +53,6 @@
}
]
},
"Or_for_null_and_int32": {
"anyOf": [
{
"type": "null"
},
{
"type": "integer",
"format": "int32"
}
]
},
"Str": {
"type": "string"
}

View file

@ -2,10 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Container",
"type": "object",
"required": [
"result1",
"result2"
],
"properties": {
"result1": {
"$ref": "#/definitions/Result_of_MyStruct_or_Array_of_string"
@ -14,25 +10,38 @@
"$ref": "#/definitions/Result_of_boolean_or_null"
}
},
"required": [
"result1",
"result2"
],
"definitions": {
"MyStruct": {
"type": "object",
"properties": {
"foo": {
"type": "integer",
"format": "int32"
}
},
"required": [
"foo"
]
},
"Result_of_MyStruct_or_Array_of_string": {
"oneOf": [
{
"type": "object",
"required": [
"Ok"
],
"properties": {
"Ok": {
"$ref": "#/definitions/MyStruct"
}
}
},
"required": [
"Ok"
]
},
{
"type": "object",
"required": [
"Err"
],
"properties": {
"Err": {
"type": "array",
@ -40,45 +49,36 @@
"type": "string"
}
}
}
},
"required": [
"Err"
]
}
]
},
"MyStruct": {
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "integer",
"format": "int32"
}
}
},
"Result_of_boolean_or_null": {
"oneOf": [
{
"type": "object",
"required": [
"Ok"
],
"properties": {
"Ok": {
"type": "boolean"
}
}
},
"required": [
"Ok"
]
},
{
"type": "object",
"required": [
"Err"
],
"properties": {
"Err": {
"type": "null"
}
}
},
"required": [
"Err"
]
}
]
}

View file

@ -2,10 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Config2",
"type": "object",
"required": [
"a_cfg",
"b_cfg"
],
"properties": {
"a_cfg": {
"$ref": "#/definitions/Config"
@ -14,28 +10,32 @@
"$ref": "#/definitions/Config2"
}
},
"required": [
"a_cfg",
"b_cfg"
],
"definitions": {
"Config": {
"type": "object",
"required": [
"test"
],
"properties": {
"test": {
"type": "string"
}
}
},
"required": [
"test"
]
},
"Config2": {
"type": "object",
"required": [
"test2"
],
"properties": {
"test2": {
"type": "string"
}
}
},
"required": [
"test2"
]
}
}
}

View file

@ -2,13 +2,13 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "const-generics-z-42",
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"foo"
]
}

View file

@ -2,14 +2,10 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "a-new-name-Array_of_string-int32-int32",
"type": "object",
"required": [
"inner",
"t",
"u",
"v",
"w"
],
"properties": {
"inner": {
"$ref": "#/definitions/another-new-name"
},
"t": {
"type": "integer",
"format": "int32"
@ -25,23 +21,27 @@
"items": {
"type": "string"
}
},
"inner": {
"$ref": "#/definitions/another-new-name"
}
},
"required": [
"inner",
"t",
"u",
"v",
"w"
],
"definitions": {
"another-new-name": {
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"foo"
]
}
}
}

View file

@ -2,10 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MixedGenericStruct_for_MyStruct_for_int32_and_null_and_boolean_and_Array_of_string_and_42_and_z",
"type": "object",
"required": [
"foo",
"generic"
],
"properties": {
"foo": {
"type": "integer",
@ -15,28 +11,25 @@
"$ref": "#/definitions/MyStruct_for_int32_and_null_and_boolean_and_Array_of_string"
}
},
"required": [
"foo",
"generic"
],
"definitions": {
"MySimpleStruct": {
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"foo"
]
},
"MyStruct_for_int32_and_null_and_boolean_and_Array_of_string": {
"type": "object",
"required": [
"inner",
"t",
"u",
"v",
"w"
],
"properties": {
"inner": {
"$ref": "#/definitions/MySimpleStruct"
@ -57,7 +50,14 @@
"type": "string"
}
}
}
},
"required": [
"inner",
"t",
"u",
"v",
"w"
]
}
}
}

View file

@ -2,25 +2,7 @@
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "Outer",
"type": "object",
"required": [
"int",
"value",
"values"
],
"properties": {
"int": {
"examples": [
8,
null
],
"type": "integer",
"format": "int32"
},
"values": {
"type": "object",
"additionalProperties": true
},
"value": true,
"inner": {
"anyOf": [
{
@ -30,8 +12,26 @@
"type": "null"
}
]
},
"int": {
"type": "integer",
"format": "int32",
"examples": [
8,
null
]
},
"value": true,
"values": {
"type": "object",
"additionalProperties": true
}
},
"required": [
"int",
"value",
"values"
],
"definitions": {
"Inner": {
"oneOf": [
@ -51,13 +51,13 @@
},
{
"type": "object",
"required": [
"ValueNewType"
],
"properties": {
"ValueNewType": true
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"ValueNewType"
]
}
]
}

View file

@ -46,10 +46,10 @@
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"ValueNewType": {}
},
"additionalProperties": false,
"required": [
"ValueNewType"
]

View file

@ -2,25 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Outer",
"type": "object",
"required": [
"int",
"value",
"values"
],
"properties": {
"int": {
"examples": [
8,
null
],
"type": "integer",
"format": "int32"
},
"values": {
"type": "object",
"additionalProperties": true
},
"value": true,
"inner": {
"anyOf": [
{
@ -30,8 +12,26 @@
"type": "null"
}
]
},
"int": {
"type": "integer",
"format": "int32",
"examples": [
8,
null
]
},
"value": true,
"values": {
"type": "object",
"additionalProperties": true
}
},
"required": [
"int",
"value",
"values"
],
"definitions": {
"Inner": {
"oneOf": [
@ -51,13 +51,13 @@
},
{
"type": "object",
"required": [
"ValueNewType"
],
"properties": {
"ValueNewType": true
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"ValueNewType"
]
}
]
}

View file

@ -4,21 +4,17 @@
"oneOf": [
{
"type": "object",
"required": [
"c",
"t"
],
"properties": {
"c": {
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "boolean"
}
}
},
"required": [
"foo"
]
},
"t": {
"type": "string",
@ -26,14 +22,14 @@
"Struct"
]
}
}
},
{
"type": "object",
},
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"type": "boolean"
@ -44,14 +40,14 @@
"NewType"
]
}
}
},
{
"type": "object",
},
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"type": "array",
@ -73,14 +69,14 @@
"Tuple"
]
}
}
},
{
"type": "object",
},
"required": [
"c",
"t"
],
]
},
{
"type": "object",
"properties": {
"c": {
"type": "boolean"
@ -91,7 +87,11 @@
"Unit"
]
}
}
},
"required": [
"c",
"t"
]
}
]
}

View file

@ -4,41 +4,38 @@
"oneOf": [
{
"type": "object",
"required": [
"struct"
],
"properties": {
"struct": {
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "boolean"
}
}
},
"required": [
"foo"
]
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"struct"
]
},
{
"type": "object",
"required": [
"newType"
],
"properties": {
"newType": {
"type": "boolean"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"newType"
]
},
{
"type": "object",
"required": [
"tuple"
],
"properties": {
"tuple": {
"type": "array",
@ -55,19 +52,22 @@
"minItems": 2
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"tuple"
]
},
{
"type": "object",
"required": [
"unit"
],
"properties": {
"unit": {
"type": "boolean"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"unit"
]
}
]
}

View file

@ -4,10 +4,6 @@
"oneOf": [
{
"type": "object",
"required": [
"foo",
"typeProperty"
],
"properties": {
"foo": {
"type": "boolean"
@ -18,13 +14,14 @@
"Struct"
]
}
}
},
"required": [
"foo",
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -32,13 +29,13 @@
"NewType"
]
}
}
},
"required": [
"typeProperty"
]
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
@ -46,7 +43,10 @@
"Unit"
]
}
}
},
"required": [
"typeProperty"
]
}
]
}

View file

@ -4,14 +4,14 @@
"anyOf": [
{
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "boolean"
}
}
},
"required": [
"foo"
]
},
{
"type": "boolean"

View file

@ -2,21 +2,21 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct",
"type": "object",
"required": [
"bar",
"baz",
"foo"
],
"properties": {
"foo": {
"type": "boolean"
},
"bar": {
"type": "integer",
"format": "int32"
},
"baz": {
"type": "boolean"
},
"foo": {
"type": "boolean"
}
}
},
"required": [
"bar",
"baz",
"foo"
]
}

View file

@ -2,11 +2,13 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "SemverTypes",
"type": "object",
"required": ["version"],
"properties": {
"version": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
}
}
}
},
"required": [
"version"
]
}

View file

@ -10,16 +10,16 @@
},
{
"type": "object",
"required": [
"Included1"
],
"properties": {
"Included1": {
"type": "number",
"format": "float"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"Included1"
]
}
]
}

View file

@ -2,23 +2,23 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"properties": {
"included": {
"type": "null"
},
"readable": {
"type": "string",
"default": "",
"readOnly": true
},
"writable": {
"type": "number",
"format": "float",
"writeOnly": true
}
},
"required": [
"included",
"writable"
],
"properties": {
"readable": {
"default": "",
"readOnly": true,
"type": "string"
},
"writable": {
"writeOnly": true,
"type": "number",
"format": "float"
},
"included": {
"type": "null"
}
}
]
}

View file

@ -2,15 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct",
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"foo": {
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
},
@ -19,7 +11,15 @@
"string",
"null"
]
},
"foo": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": [
"bar",
"foo"
]
}

View file

@ -2,15 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct",
"type": "object",
"required": [
"bar",
"foo"
],
"properties": {
"foo": {
"type": "integer",
"format": "int32"
},
"bar": {
"type": "boolean"
},
@ -19,6 +11,14 @@
"string",
"null"
]
},
"foo": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"bar",
"foo"
]
}

View file

@ -2,13 +2,13 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "UrlTypes",
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"required": [
"url"
]
}

View file

@ -2,49 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct",
"type": "object",
"required": [
"contains_str1",
"contains_str2",
"email_address",
"homepage",
"map_contains",
"min_max",
"min_max2",
"non_empty_str",
"non_empty_str2",
"pair",
"regex_str1",
"regex_str2",
"regex_str3",
"required_option",
"tel",
"x"
],
"properties": {
"min_max": {
"type": "number",
"format": "float",
"maximum": 100.0,
"minimum": 0.01
},
"min_max2": {
"type": "number",
"format": "float",
"maximum": 1000.0,
"minimum": 1.0
},
"regex_str1": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str2": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str3": {
"type": "string",
"pattern": "^\\d+$"
},
"contains_str1": {
"type": "string",
"pattern": "substring\\.\\.\\."
@ -57,14 +15,31 @@
"type": "string",
"format": "email"
},
"tel": {
"type": "string",
"format": "phone"
},
"homepage": {
"type": "string",
"format": "uri"
},
"map_contains": {
"type": "object",
"additionalProperties": {
"type": "null"
},
"required": [
"map_key"
]
},
"min_max": {
"type": "number",
"format": "float",
"maximum": 100.0,
"minimum": 0.01
},
"min_max2": {
"type": "number",
"format": "float",
"maximum": 1000.0,
"minimum": 1.0
},
"non_empty_str": {
"type": "string",
"maxLength": 100,
@ -84,21 +59,46 @@
"maxItems": 2,
"minItems": 2
},
"map_contains": {
"type": "object",
"required": [
"map_key"
],
"additionalProperties": {
"type": "null"
}
"regex_str1": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str2": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str3": {
"type": "string",
"pattern": "^\\d+$"
},
"required_option": {
"type": "boolean"
},
"tel": {
"type": "string",
"format": "phone"
},
"x": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"contains_str1",
"contains_str2",
"email_address",
"homepage",
"map_contains",
"min_max",
"min_max2",
"non_empty_str",
"non_empty_str2",
"pair",
"regex_str1",
"regex_str2",
"regex_str3",
"required_option",
"tel",
"x"
]
}

View file

@ -2,15 +2,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct",
"type": "object",
"required": [
"array_str_length",
"slice_str_contains",
"vec_i32_range",
"vec_str_length",
"vec_str_length2",
"vec_str_regex",
"vec_str_url"
],
"properties": {
"array_str_length": {
"type": "array",
@ -70,5 +61,14 @@
"format": "uri"
}
}
}
},
"required": [
"array_str_length",
"slice_str_contains",
"vec_i32_range",
"vec_str_length",
"vec_str_length2",
"vec_str_regex",
"vec_str_url"
]
}

View file

@ -2,49 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Struct2",
"type": "object",
"required": [
"contains_str1",
"contains_str2",
"email_address",
"homepage",
"map_contains",
"min_max",
"min_max2",
"non_empty_str",
"non_empty_str2",
"pair",
"regex_str1",
"regex_str2",
"regex_str3",
"required_option",
"tel",
"x"
],
"properties": {
"min_max": {
"type": "number",
"format": "float",
"maximum": 100.0,
"minimum": 0.01
},
"min_max2": {
"type": "number",
"format": "float",
"maximum": 1000.0,
"minimum": 1.0
},
"regex_str1": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str2": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str3": {
"type": "string",
"pattern": "^\\d+$"
},
"contains_str1": {
"type": "string",
"pattern": "substring\\.\\.\\."
@ -57,14 +15,31 @@
"type": "string",
"format": "email"
},
"tel": {
"type": "string",
"format": "phone"
},
"homepage": {
"type": "string",
"format": "uri"
},
"map_contains": {
"type": "object",
"additionalProperties": {
"type": "null"
},
"required": [
"map_key"
]
},
"min_max": {
"type": "number",
"format": "float",
"maximum": 100.0,
"minimum": 0.01
},
"min_max2": {
"type": "number",
"format": "float",
"maximum": 1000.0,
"minimum": 1.0
},
"non_empty_str": {
"type": "string",
"maxLength": 100,
@ -84,21 +59,46 @@
"maxItems": 2,
"minItems": 2
},
"map_contains": {
"type": "object",
"required": [
"map_key"
],
"additionalProperties": {
"type": "null"
}
"regex_str1": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str2": {
"type": "string",
"pattern": "^[Hh]ello\\b"
},
"regex_str3": {
"type": "string",
"pattern": "^\\d+$"
},
"required_option": {
"type": "boolean"
},
"tel": {
"type": "string",
"format": "phone"
},
"x": {
"type": "integer",
"format": "int32"
}
}
},
"required": [
"contains_str1",
"contains_str2",
"email_address",
"homepage",
"map_contains",
"min_max",
"min_max2",
"non_empty_str",
"non_empty_str2",
"pair",
"regex_str1",
"regex_str2",
"regex_str3",
"required_option",
"tel",
"x"
]
}