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