Regenerate example schemas
This commit is contained in:
parent
f5d2142714
commit
8c2c32bce0
19 changed files with 244 additions and 242 deletions
|
@ -1,4 +1,4 @@
|
|||
use schemars::schema::{Schema, SchemaObject};
|
||||
use schemars::Schema;
|
||||
use schemars::{gen::SchemaGenerator, schema_for, JsonSchema};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -21,9 +21,11 @@ pub struct MyStruct {
|
|||
}
|
||||
|
||||
fn make_custom_schema(gen: &mut SchemaGenerator) -> Schema {
|
||||
let mut schema: SchemaObject = <String>::json_schema(gen).into();
|
||||
schema.format = Some("boolean".to_owned());
|
||||
schema.into()
|
||||
let mut schema = String::json_schema(gen);
|
||||
schema
|
||||
.ensure_object()
|
||||
.insert("format".into(), "boolean".into());
|
||||
schema
|
||||
}
|
||||
|
||||
fn eight() -> i32 {
|
||||
|
|
|
@ -4,22 +4,22 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"bool_as_string": {
|
||||
"default": "false",
|
||||
"type": "string",
|
||||
"format": "boolean"
|
||||
"format": "boolean",
|
||||
"default": "false"
|
||||
},
|
||||
"bool_normal": {
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"int_as_string": {
|
||||
"default": "8",
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"default": "8"
|
||||
},
|
||||
"int_normal": {
|
||||
"default": 8,
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"default": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"type": "boolean"
|
||||
|
@ -23,32 +19,30 @@
|
|||
"nullable": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -57,10 +51,16 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
"title": "My Amazing Struct",
|
||||
"description": "This struct shows off generating a schema with a custom title and description.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"description": "This bool has a description, but no title.",
|
||||
|
@ -30,6 +26,10 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"title": "My Amazing Enum",
|
||||
|
@ -37,28 +37,22 @@
|
|||
{
|
||||
"description": "A wrapper around a `String`",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "A struct-like enum variant which contains some floats",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"description": "The floats themselves",
|
||||
|
@ -68,10 +62,16 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"examples": [
|
||||
{
|
||||
"my_bool": true,
|
||||
"my_int": 123,
|
||||
"my_nullable_enum": {
|
||||
"StringNewType": "foo"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
|
@ -19,5 +10,14 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"my_nullable_enum": true
|
||||
}
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"my_bool": true,
|
||||
"my_int": 123,
|
||||
"my_nullable_enum": {
|
||||
"StringNewType": "foo"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"type": "boolean"
|
||||
|
@ -25,32 +21,30 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -59,10 +53,16 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Process",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"command_line",
|
||||
"durations",
|
||||
"wall_time"
|
||||
],
|
||||
"properties": {
|
||||
"command_line": {
|
||||
"type": "string"
|
||||
|
@ -21,13 +16,14 @@
|
|||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command_line",
|
||||
"wall_time",
|
||||
"durations"
|
||||
],
|
||||
"definitions": {
|
||||
"Duration": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"nanos",
|
||||
"secs"
|
||||
],
|
||||
"properties": {
|
||||
"nanos": {
|
||||
"type": "integer",
|
||||
|
@ -37,7 +33,11 @@
|
|||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"secs",
|
||||
"nanos"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,11 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"myBool",
|
||||
"myNumber",
|
||||
"myVecStr"
|
||||
],
|
||||
"properties": {
|
||||
"myBool": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"myNullableEnum": {
|
||||
"default": null,
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/MyEnum"
|
||||
|
@ -20,13 +14,14 @@
|
|||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
],
|
||||
"default": null
|
||||
},
|
||||
"myNumber": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"maximum": 10.0,
|
||||
"minimum": 1.0
|
||||
"maximum": 10,
|
||||
"minimum": 1
|
||||
},
|
||||
"myVecStr": {
|
||||
"type": "array",
|
||||
|
@ -37,6 +32,11 @@
|
|||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"myNumber",
|
||||
"myBool",
|
||||
"myVecStr"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"anyOf": [
|
||||
|
@ -46,9 +46,6 @@
|
|||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -59,7 +56,10 @@
|
|||
"maxItems": 100,
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,16 +2,11 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"myBool",
|
||||
"myNumber"
|
||||
],
|
||||
"properties": {
|
||||
"myBool": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"myNullableEnum": {
|
||||
"default": null,
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/MyEnum"
|
||||
|
@ -19,7 +14,8 @@
|
|||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
],
|
||||
"default": null
|
||||
},
|
||||
"myNumber": {
|
||||
"type": "integer",
|
||||
|
@ -27,6 +23,10 @@
|
|||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"myNumber",
|
||||
"myBool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"anyOf": [
|
||||
|
@ -35,9 +35,6 @@
|
|||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -46,7 +43,10 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int",
|
||||
"my_nullable_enum"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"type": "boolean"
|
||||
|
@ -14,35 +9,29 @@
|
|||
"my_int": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"maximum": 10.0,
|
||||
"minimum": 1.0
|
||||
"maximum": 10,
|
||||
"minimum": 1
|
||||
},
|
||||
"my_nullable_enum": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string",
|
||||
"format": "phone"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -53,12 +42,23 @@
|
|||
"maxItems": 100,
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool",
|
||||
"my_nullable_enum"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -4,22 +4,22 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"bool_as_string": {
|
||||
"default": "false",
|
||||
"type": "string",
|
||||
"format": "boolean"
|
||||
"format": "boolean",
|
||||
"default": "false"
|
||||
},
|
||||
"bool_normal": {
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"int_as_string": {
|
||||
"default": "8",
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"default": "8"
|
||||
},
|
||||
"int_normal": {
|
||||
"default": 8,
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"default": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"type": "boolean"
|
||||
|
@ -23,32 +19,30 @@
|
|||
"nullable": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -57,10 +51,16 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
"title": "My Amazing Struct",
|
||||
"description": "This struct shows off generating a schema with a custom title and description.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"description": "This bool has a description, but no title.",
|
||||
|
@ -30,6 +26,10 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"title": "My Amazing Enum",
|
||||
|
@ -37,28 +37,22 @@
|
|||
{
|
||||
"description": "A wrapper around a `String`",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "A struct-like enum variant which contains some floats",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"description": "The floats themselves",
|
||||
|
@ -68,10 +62,16 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"examples": [
|
||||
{
|
||||
"my_bool": true,
|
||||
"my_int": 123,
|
||||
"my_nullable_enum": {
|
||||
"StringNewType": "foo"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
|
@ -19,5 +10,14 @@
|
|||
"type": "integer"
|
||||
},
|
||||
"my_nullable_enum": true
|
||||
}
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"my_bool": true,
|
||||
"my_int": 123,
|
||||
"my_nullable_enum": {
|
||||
"StringNewType": "foo"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"type": "boolean"
|
||||
|
@ -25,32 +21,30 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -59,10 +53,16 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Process",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"command_line",
|
||||
"durations",
|
||||
"wall_time"
|
||||
],
|
||||
"properties": {
|
||||
"command_line": {
|
||||
"type": "string"
|
||||
|
@ -21,13 +16,14 @@
|
|||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command_line",
|
||||
"wall_time",
|
||||
"durations"
|
||||
],
|
||||
"definitions": {
|
||||
"Duration": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"nanos",
|
||||
"secs"
|
||||
],
|
||||
"properties": {
|
||||
"nanos": {
|
||||
"type": "integer",
|
||||
|
@ -37,7 +33,11 @@
|
|||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"secs",
|
||||
"nanos"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,11 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"myBool",
|
||||
"myNumber",
|
||||
"myVecStr"
|
||||
],
|
||||
"properties": {
|
||||
"myBool": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"myNullableEnum": {
|
||||
"default": null,
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/MyEnum"
|
||||
|
@ -20,13 +14,14 @@
|
|||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
],
|
||||
"default": null
|
||||
},
|
||||
"myNumber": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"maximum": 10.0,
|
||||
"minimum": 1.0
|
||||
"maximum": 10,
|
||||
"minimum": 1
|
||||
},
|
||||
"myVecStr": {
|
||||
"type": "array",
|
||||
|
@ -37,6 +32,11 @@
|
|||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"myNumber",
|
||||
"myBool",
|
||||
"myVecStr"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"anyOf": [
|
||||
|
@ -46,9 +46,6 @@
|
|||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -59,7 +56,10 @@
|
|||
"maxItems": 100,
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,16 +2,11 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"myBool",
|
||||
"myNumber"
|
||||
],
|
||||
"properties": {
|
||||
"myBool": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"myNullableEnum": {
|
||||
"default": null,
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/MyEnum"
|
||||
|
@ -19,7 +14,8 @@
|
|||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
],
|
||||
"default": null
|
||||
},
|
||||
"myNumber": {
|
||||
"type": "integer",
|
||||
|
@ -27,6 +23,10 @@
|
|||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"myNumber",
|
||||
"myBool"
|
||||
],
|
||||
"definitions": {
|
||||
"MyEnum": {
|
||||
"anyOf": [
|
||||
|
@ -35,9 +35,6 @@
|
|||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -46,7 +43,10 @@
|
|||
"format": "float"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"my_bool",
|
||||
"my_int",
|
||||
"my_nullable_enum"
|
||||
],
|
||||
"properties": {
|
||||
"my_bool": {
|
||||
"type": "boolean"
|
||||
|
@ -14,35 +9,29 @@
|
|||
"my_int": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"maximum": 10.0,
|
||||
"minimum": 1.0
|
||||
"maximum": 10,
|
||||
"minimum": 1
|
||||
},
|
||||
"my_nullable_enum": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StringNewType"
|
||||
],
|
||||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string",
|
||||
"format": "phone"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StringNewType"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"StructVariant"
|
||||
],
|
||||
"properties": {
|
||||
"StructVariant": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"floats"
|
||||
],
|
||||
"properties": {
|
||||
"floats": {
|
||||
"type": "array",
|
||||
|
@ -53,12 +42,23 @@
|
|||
"maxItems": 100,
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"floats"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"StructVariant"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"my_int",
|
||||
"my_bool",
|
||||
"my_nullable_enum"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue