Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
597 lines (587 sloc) 13.6 KB
{
"title": "TypeSchema",
"description": "TypeSchema meta schema which describes a TypeSchema",
"type": "object",
"definitions": {
"commonProperties": {
"description": "Common properties which can be used at any schema",
"type": "object",
"properties": {
"title": {
"description": "Distinct word which represents this schema",
"type": "string"
},
"description": {
"description": "General description of this schema, should not contain any new lines.",
"type": "string"
},
"type": {
"description": "JSON type of the property",
"type": "string",
"enum": [
"object",
"array",
"boolean",
"integer",
"number",
"string"
]
},
"nullable": {
"description": "Indicates whether it is possible to use a null value",
"type": "boolean",
"default": false
},
"deprecated": {
"description": "Indicates whether this schema is deprecated",
"type": "boolean",
"default": false
},
"readonly": {
"description": "Indicates whether this schema is readonly",
"type": "boolean",
"default": false
}
}
},
"scalarProperties": {
"type": "object",
"properties": {
"format": {
"description": "Describes the specific format of this type i.e. date-time or int64",
"type": "string"
},
"enum": {
"$ref": "#/definitions/enumValue"
},
"default": {
"$ref": "#/definitions/scalarValue"
}
}
},
"propertyValue": {
"description": "Allowed values of an object property",
"oneOf": [
{
"$ref": "#/definitions/booleanType"
},
{
"$ref": "#/definitions/numberType"
},
{
"$ref": "#/definitions/stringType"
},
{
"$ref": "#/definitions/arrayType"
},
{
"$ref": "#/definitions/combinationType"
},
{
"$ref": "#/definitions/referenceType"
},
{
"$ref": "#/definitions/genericType"
}
]
},
"properties": {
"description": "Properties of a schema",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/propertyValue"
}
},
"containerProperties": {
"description": "Properties specific for a container",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"object"
]
}
},
"required": [
"type"
]
},
"structProperties": {
"description": "Struct specific properties",
"type": "object",
"properties": {
"properties": {
"$ref": "#/definitions/properties"
},
"required": {
"$ref": "#/definitions/stringArray"
}
},
"required": [
"properties"
]
},
"structType": {
"description": "A struct contains a fix set of defined properties",
"allOf": [
{
"$ref": "#/definitions/commonProperties"
},
{
"$ref": "#/definitions/containerProperties"
},
{
"$ref": "#/definitions/structProperties"
}
]
},
"mapProperties": {
"description": "Map specific properties",
"type": "object",
"properties": {
"additionalProperties": {
"$ref": "#/definitions/propertyValue"
},
"maxProperties": {
"$ref": "#/definitions/positiveInteger"
},
"minProperties": {
"$ref": "#/definitions/positiveInteger"
}
},
"required": [
"additionalProperties"
]
},
"mapType": {
"description": "A map contains variable key value entries of a specific type",
"allOf": [
{
"$ref": "#/definitions/commonProperties"
},
{
"$ref": "#/definitions/containerProperties"
},
{
"$ref": "#/definitions/mapProperties"
}
]
},
"objectType": {
"description": "An object represents either a struct or map type",
"oneOf": [
{
"$ref": "#/definitions/structType"
},
{
"$ref": "#/definitions/mapType"
}
]
},
"arrayValue": {
"description": "Allowed values of an array item",
"oneOf": [
{
"$ref": "#/definitions/booleanType"
},
{
"$ref": "#/definitions/numberType"
},
{
"$ref": "#/definitions/stringType"
},
{
"$ref": "#/definitions/referenceType"
},
{
"$ref": "#/definitions/genericType"
}
]
},
"arrayProperties": {
"description": "Array properties",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"array"
]
},
"items": {
"$ref": "#/definitions/arrayValue"
},
"maxItems": {
"$ref": "#/definitions/positiveInteger"
},
"minItems": {
"$ref": "#/definitions/positiveInteger"
},
"uniqueItems": {
"type": "boolean"
}
},
"required": [
"type",
"items"
]
},
"arrayType": {
"description": "An array contains an ordered list of a specific type",
"allOf": [
{
"$ref": "#/definitions/commonProperties"
},
{
"$ref": "#/definitions/arrayProperties"
}
]
},
"booleanProperties": {
"description": "Boolean properties",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"boolean"
]
}
},
"required": [
"type"
]
},
"booleanType": {
"description": "Represents a boolean value",
"allOf": [
{
"$ref": "#/definitions/commonProperties"
},
{
"$ref": "#/definitions/scalarProperties"
},
{
"$ref": "#/definitions/booleanProperties"
}
]
},
"numberProperties": {
"description": "Number properties",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"number",
"integer"
]
},
"multipleOf": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "boolean",
"default": false
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "boolean",
"default": false
}
},
"required": [
"type"
]
},
"numberType": {
"description": "Represents a number value (contains also integer)",
"allOf": [
{
"$ref": "#/definitions/commonProperties"
},
{
"$ref": "#/definitions/scalarProperties"
},
{
"$ref": "#/definitions/numberProperties"
}
]
},
"stringProperties": {
"description": "String properties",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"maxLength": {
"$ref": "#/definitions/positiveInteger"
},
"minLength": {
"$ref": "#/definitions/positiveInteger"
},
"pattern": {
"type": "string",
"format": "regex"
}
},
"required": [
"type"
]
},
"stringType": {
"description": "Represents a string value",
"allOf": [
{
"$ref": "#/definitions/commonProperties"
},
{
"$ref": "#/definitions/scalarProperties"
},
{
"$ref": "#/definitions/stringProperties"
}
]
},
"ofValue": {
"description": "Allowed values in a combination schema",
"oneOf": [
{
"$ref": "#/definitions/numberType"
},
{
"$ref": "#/definitions/stringType"
},
{
"$ref": "#/definitions/booleanType"
},
{
"$ref": "#/definitions/referenceType"
}
]
},
"discriminatorMapping": {
"description": "An object to hold mappings between payload values and schema names or references",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"discriminator": {
"description": "Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description",
"type": "object",
"properties": {
"propertyName": {
"description": "The name of the property in the payload that will hold the discriminator value",
"type": "string"
},
"mapping": {
"$ref": "#/definitions/discriminatorMapping"
}
},
"required": [
"propertyName"
]
},
"allOfProperties": {
"type": "object",
"description": "An intersection type combines multiple schemas into one",
"properties": {
"description": {
"type": "string"
},
"allOf": {
"description": "Combination values",
"type": "array",
"items": {
"$ref": "#/definitions/ofValue"
}
}
},
"required": [
"allOf"
]
},
"oneOfProperties": {
"description": "An union type can contain one of the provided schemas",
"type": "object",
"properties": {
"description": {
"type": "string"
},
"discriminator": {
"$ref": "#/definitions/discriminator"
},
"oneOf": {
"description": "Combination values",
"type": "array",
"items": {
"$ref": "#/definitions/ofValue"
}
}
},
"required": [
"oneOf"
]
},
"combinationType": {
"description": "A combination type is either a intersection or union type",
"oneOf": [
{
"$ref": "#/definitions/allOfProperties"
},
{
"$ref": "#/definitions/oneOfProperties"
}
]
},
"templateProperties": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/referenceType"
}
},
"referenceType": {
"description": "Represents a reference to another schema",
"type": "object",
"properties": {
"$ref": {
"description": "Reference to the schema under the definitions key",
"type": "string"
},
"$template": {
"description": "Optional concrete schema definitions which replace generic template types",
"$ref": "#/definitions/templateProperties"
}
},
"required": [
"$ref"
]
},
"genericType": {
"description": "Represents a generic type",
"type": "object",
"properties": {
"$generic": {
"type": "string"
}
},
"required": [
"$generic"
]
},
"definitionValue": {
"description": "Represents a concrete type definition",
"oneOf": [
{
"$ref": "#/definitions/objectType"
},
{
"$ref": "#/definitions/arrayType"
},
{
"$ref": "#/definitions/booleanType"
},
{
"$ref": "#/definitions/numberType"
},
{
"$ref": "#/definitions/stringType"
},
{
"$ref": "#/definitions/combinationType"
}
]
},
"definitions": {
"description": "Schema definitions which can be reused",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/definitionValue"
}
},
"enumValue": {
"description": "A list of possible enumeration values",
"oneOf": [{
"$ref": "#/definitions/stringArray"
}, {
"$ref": "#/definitions/numberArray"
}]
},
"scalarValue": {
"description": "Represents a scalar value",
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"positiveInteger": {
"description": "Positive integer value",
"type": "integer",
"minimum": 0
},
"stringArray": {
"description": "Array string values",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
},
"numberArray": {
"description": "Array number values",
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
}
},
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"object"
]
},
"definitions": {
"$ref": "#/definitions/definitions"
},
"properties": {
"$ref": "#/definitions/properties"
},
"required": {
"$ref": "#/definitions/stringArray"
}
},
"required": [
"title",
"type",
"properties"
]
}
You can’t perform that action at this time.