CommonType

Represents a base type. Every type extends from this common type and shares the defined properties
{
  "description": String,
  "type": String,
  "nullable": Boolean,
  "deprecated": Boolean,
  "readonly": Boolean,
}
FieldDescription
descriptionString
General description of this type, should not contain any new lines.
typeString
Type of the property
nullableBoolean
Indicates whether it is possible to use a null value
deprecatedBoolean
Indicates whether this type is deprecated
readonlyBoolean
Indicates whether this type is readonly

AnyType extends CommonType

Represents an any type
{
  "type": String,
}
FieldDescription
typeString

ArrayType extends CommonType

Represents an array type. An array type contains an ordered list of a specific type
{
  "type": String,
  "items": BooleanType | NumberType | StringType | ReferenceType | GenericType | AnyType,
  "maxItems": Integer,
  "minItems": Integer,
}
FieldDescription
typeString
itemsBooleanType | NumberType | StringType | ReferenceType | GenericType | AnyType
maxItemsInteger
Positive integer value
minItemsInteger
Positive integer value

ScalarType extends CommonType

Represents a scalar type
{
  "format": String,
  "enum": Array (String | Number),
  "default": String | Number | Boolean,
}
FieldDescription
formatString
Describes the specific format of this type i.e. date-time or int64
enumArray (String | Number)
defaultString | Number | Boolean

BooleanType extends ScalarType

Represents a boolean type
{
  "type": String,
}
FieldDescription
typeString

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": Map (String),
}
FieldDescription
propertyNameString
The name of the property in the payload that will hold the discriminator value
mappingMap (String)
An object to hold mappings between payload values and schema names or references

GenericType

Represents a generic type. A generic type can be used i.e. at a map or array which then can be replaced on reference via the $template keyword
{
  "$generic": String,
}
FieldDescription
$genericString

IntersectionType

Represents an intersection type
{
  "description": String,
  "allOf": Array (ReferenceType),
}
FieldDescription
descriptionString
allOfArray (ReferenceType)
Contains an array of references. The reference must only point to a struct type

MapType extends CommonType

Represents a map type. A map type contains variable key value entries of a specific type
{
  "type": String,
  "additionalProperties": BooleanType | NumberType | StringType | ArrayType | UnionType | IntersectionType | ReferenceType | GenericType | AnyType,
  "maxProperties": Integer,
  "minProperties": Integer,
}
FieldDescription
typeString
additionalPropertiesBooleanType | NumberType | StringType | ArrayType | UnionType | IntersectionType | ReferenceType | GenericType | AnyType
maxPropertiesInteger
Positive integer value
minPropertiesInteger
Positive integer value

NumberType extends ScalarType

Represents a number type (contains also integer)
{
  "type": String,
  "multipleOf": Number,
  "maximum": Number,
  "exclusiveMaximum": Boolean,
  "minimum": Number,
  "exclusiveMinimum": Boolean,
}
FieldDescription
typeString
multipleOfNumber
maximumNumber
exclusiveMaximumBoolean
minimumNumber
exclusiveMinimumBoolean

ReferenceType

Represents a reference type. A reference type points to a specific type at the definitions map
{
  "$ref": String,
  "$template": Map (String),
}
FieldDescription
$refString
Reference to a type under the definitions map
$templateMap (String)
Optional concrete type definitions which replace generic template types

StringType extends ScalarType

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

StructType extends CommonType

Represents a struct type. A struct type contains a fix set of defined properties
{
  "$final": Boolean,
  "$extends": String,
  "type": String,
  "properties": Map (MapType | ArrayType | BooleanType | NumberType | StringType | AnyType | IntersectionType | UnionType | ReferenceType | GenericType),
  "required": Array (String),
}
FieldDescription
$finalBoolean
Indicates that a struct is final, this means it is not possible to extend this struct
$extendsString
Extends an existing type with the referenced type
typeString
propertiesMap (MapType | ArrayType | BooleanType | NumberType | StringType | AnyType | IntersectionType | UnionType | ReferenceType | GenericType)
requiredArray (String)

TypeSchema

The root TypeSchema
{
  "$import": Map (String),
  "definitions": Map (StructType | MapType | ReferenceType),
  "$ref": String,
}
FieldDescription
$importMap (String)
Contains external definitions which are imported. The imported schemas can be used via the namespace i.e. 'my_namespace:my_type'
definitionsMap (StructType | MapType | ReferenceType)
$refString
Reference to a root schema under the definitions key

UnionType

Represents an union type. An union type can contain one of the provided types
{
  "description": String,
  "discriminator": Discriminator,
  "oneOf": Array (NumberType | StringType | BooleanType | ReferenceType),
}
FieldDescription
descriptionString
discriminatorDiscriminator
oneOfArray (NumberType | StringType | BooleanType | ReferenceType)
Contains an array of references. The reference must only point to a struct type