CommonProperties

Common properties which can be used at any schema
{
  "title": String,
  "description": String,
  "type": String,
  "nullable": Boolean,
  "deprecated": Boolean,
  "readonly": Boolean,
}
FieldDescription
titleString
Distinct word which represents this schema
descriptionString
General description of this schema, should not contain any new lines.
typeString
JSON type of the property
Enum
  • "object"
  • "array"
  • "boolean"
  • "integer"
  • "number"
  • "string"
nullableBoolean
Indicates whether it is possible to use a null value
deprecatedBoolean
Indicates whether this schema is deprecated
readonlyBoolean
Indicates whether this schema is readonly

ScalarProperties

{
  "format": String,
  "enum": EnumValue,
  "default": ScalarValue,
}
FieldDescription
formatString
Describes the specific format of this type i.e. date-time or int64
enumEnumValue
defaultScalarValue

PropertyValue

Allowed values of an object property
OneOf: BooleanType | NumberType | StringType | ArrayType | CombinationType | ReferenceType | GenericType

Properties

Properties of a schema
Map (PropertyValue)

ContainerProperties

Properties specific for a container
{
  "type": String,
}
FieldDescription
typeString
Enum
  • "object"

StructProperties

Struct specific properties
{
  "properties": Properties,
  "required": StringArray,
}
FieldDescription
propertiesProperties
requiredStringArray

StructType

A struct contains a fix set of defined properties
AllOf: CommonProperties & ContainerProperties & StructProperties

MapProperties

Map specific properties
{
  "additionalProperties": PropertyValue,
  "maxProperties": Integer,
  "minProperties": Integer,
}
FieldDescription
additionalPropertiesPropertyValue
maxPropertiesInteger
Positive integer value
minPropertiesInteger
Positive integer value

MapType

A map contains variable key value entries of a specific type
AllOf: CommonProperties & ContainerProperties & MapProperties

ObjectType

An object represents either a struct or map type
OneOf: StructType | MapType

ArrayValue

Allowed values of an array item
OneOf: BooleanType | NumberType | StringType | ReferenceType | GenericType

ArrayProperties

Array properties
{
  "type": String,
  "items": ArrayValue,
  "maxItems": Integer,
  "minItems": Integer,
  "uniqueItems": Boolean,
}
FieldDescription
typeString
Enum
  • "array"
itemsArrayValue
maxItemsInteger
Positive integer value
minItemsInteger
Positive integer value
uniqueItemsBoolean

ArrayType

An array contains an ordered list of a specific type
AllOf: CommonProperties & ArrayProperties

BooleanProperties

Boolean properties
{
  "type": String,
}
FieldDescription
typeString
Enum
  • "boolean"

BooleanType

Represents a boolean value
AllOf: CommonProperties & ScalarProperties & BooleanProperties

NumberProperties

Number properties
{
  "type": String,
  "multipleOf": Number,
  "maximum": Number,
  "exclusiveMaximum": Boolean,
  "minimum": Number,
  "exclusiveMinimum": Boolean,
}
FieldDescription
typeString
Enum
  • "number"
  • "integer"
multipleOfNumber
maximumNumber
exclusiveMaximumBoolean
minimumNumber
exclusiveMinimumBoolean

NumberType

Represents a number value (contains also integer)
AllOf: CommonProperties & ScalarProperties & NumberProperties

StringProperties

String properties
{
  "type": String,
  "maxLength": Integer,
  "minLength": Integer,
  "pattern": String,
}
FieldDescription
typeString
Enum
  • "string"
maxLengthInteger
Positive integer value
minLengthInteger
Positive integer value
patternString

StringType

Represents a string value
AllOf: CommonProperties & ScalarProperties & StringProperties

OfValue

Allowed values in a combination schema
OneOf: NumberType | StringType | BooleanType | ReferenceType

DiscriminatorMapping

An object to hold mappings between payload values and schema names or references
Map (String)

Discriminator

Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description
{
  "propertyName": String,
  "mapping": DiscriminatorMapping,
}
FieldDescription
propertyNameString
The name of the property in the payload that will hold the discriminator value
mappingDiscriminatorMapping

AllOfProperties

An intersection type combines multiple schemas into one
{
  "description": String,
  "allOf": Array (OfValue),
}
FieldDescription
descriptionString
allOfArray (OfValue)
Combination values

OneOfProperties

An union type can contain one of the provided schemas
{
  "description": String,
  "discriminator": Discriminator,
  "oneOf": Array (OfValue),
}
FieldDescription
descriptionString
discriminatorDiscriminator
oneOfArray (OfValue)
Combination values

CombinationType

A combination type is either a intersection or union type
OneOf: AllOfProperties | OneOfProperties

TemplateProperties

Map (ReferenceType)

ReferenceType

Represents a reference to another schema
{
  "$ref": String,
  "$template": TemplateProperties,
}
FieldDescription
$refString
Reference to the schema under the definitions key
$templateTemplateProperties
Optional concrete schema definitions which replace generic template types

GenericType

Represents a generic type
{
  "$generic": String,
}
FieldDescription
$genericString

DefinitionValue

Represents a concrete type definition
OneOf: ObjectType | ArrayType | BooleanType | NumberType | StringType | CombinationType

Definitions

Schema definitions which can be reused
Map (DefinitionValue)

Import

Contains external definitions which are imported. The imported schemas can be used via the namespace
Map (String)

EnumValue

A list of possible enumeration values
OneOf: StringArray | NumberArray

ScalarValue

Represents a scalar value
OneOf: String | Number | Boolean

StringArray

Array string values
Array (String)

NumberArray

Array number values
Array (Number)

TypeSchema

TypeSchema meta schema which describes a TypeSchema
{
  "$import": Import,
  "title": String,
  "description": String,
  "type": String,
  "definitions": Definitions,
  "properties": Properties,
  "required": StringArray,
}
FieldDescription
$importImport
titleString
descriptionString
typeString
Enum
  • "object"
definitionsDefinitions
propertiesProperties
requiredStringArray