Base property type
{
"deprecated": Boolean,
"description": String,
"nullable": Boolean,
"type": String,
}
Represents an any value which allows any kind of value
{
"type": String = "any",
}
Base definition type
{
"deprecated": Boolean,
"description": String,
"type": String,
}
Base collection type
{
"schema": PropertyType,
"type": String,
}
Represents an array which contains a dynamic list of values of the same type
{
"type": String = "array",
}
Base collection property type
{
"schema": PropertyType,
"type": String,
}
Represents an array which contains a dynamic list of values of the same type
{
"type": String = "array",
}
Base scalar property type
{
"type": String,
}
Represents a boolean value
{
"type": String = "boolean",
}
Represents a generic value which can be replaced with a concrete type
{
"name": String,
"type": String = "generic",
}| Field | Description |
|---|
| name | String
The name of the generic, it is recommended to use common generic names like T or TValue. These generics can then be replaced on usage with a concrete type through the template property at a reference |
| type | String
|
Represents an integer value
{
"type": String = "integer",
}
Represents a map which contains a dynamic set of key value entries of the same type
{
"type": String = "map",
}
Represents a map which contains a dynamic set of key value entries of the same type
{
"type": String = "map",
}
Represents a float value
{
"type": String = "number",
}
Represents a reference to a definition type
{
"target": String,
"template": Map (String),
"type": String = "reference",
}| Field | Description |
|---|
| target | String
The target type, this must be a key which is available at the definitions map |
| template | Map (String)
A map where the key is the name of the generic and the value must point to a key under the definitions keyword. This can be used in case the target points to a type which contains generics, then it is possible to replace those generics with a concrete type |
| type | String
|
Represents a string value
{
"default": String,
"format": String,
"type": String = "string",
}| Field | Description |
|---|
| default | String
Optional a default value for this property |
| format | String
Optional describes the format of the string. Supported are the following types: date, date-time and time. A code generator may use a fitting data type to represent such a format, if not supported it should fallback to a string |
| type | String
|
A struct represents a class/structure with a fix set of defined properties
{
"base": Boolean,
"discriminator": String,
"mapping": Map (String),
"parent": ReferencePropertyType,
"properties": Map (PropertyType),
"type": String = "struct",
}| Field | Description |
|---|
| base | Boolean
Indicates whether this is a base structure, default is false. If true the structure is used a base type, this means it is not possible to create an instance from this structure |
| discriminator | String
Optional the property name of a discriminator property. This should be only used in case this is also a base structure |
| mapping | Map (String)
In case a discriminator is configured it is required to configure a mapping. The mapping is a map where the key is the type name (a key from the definitions map) and the value the actual discriminator type value |
| parent | ReferencePropertyType
Defines a parent type, all properties from the parent type are inherited |
| properties | Map (PropertyType)
Contains a map of available properties for this struct |
| type | String
|
TypeSchema specification
{
"definitions": Map (DefinitionType),
"import": Map (String),
"root": String,
}| Field | Description |
|---|
| definitions | Map (DefinitionType)
|
| import | Map (String)
Allows to import other TypeSchema documents. It contains a map where the key is the namespace and the value points to a remote document. The value is a URL and a code generator should support at least the following schemes: file, http, https |
| root | String
Specifies the root type of your specification, this must be a key which is available at the definitions map |