Defines the schema of input and output data. This is a subset of the OpenAPI 3.0 Schema Object.
Optional. data type of the schema field.
formatstring
Optional. The format of the data. For NUMBER type, format can be float or double. For INTEGER type, format can be int32 or int64. For STRING type, format can be email, byte, date, date-time, password, and other formats to further refine the data type.
titlestring
Optional. title for the schema.
descriptionstring
Optional. description of the schema.
nullableboolean
Optional. Indicates if the value of this field can be null.
Optional. Default value to use if the field is not specified.
Optional. If type is ARRAY, items specifies the schema of elements in the array.
Optional. If type is ARRAY, minItems specifies the minimum number of items in an array.
Optional. If type is ARRAY, maxItems specifies the maximum number of items in an array.
enum[]string
Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set format to enum and provide the list of possible values in enum. For example: 1. To define directions: {type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]} 2. To define apartment numbers: {type:INTEGER, format:enum, enum:["101", "201", "301"]}
Optional. If type is OBJECT, properties is a map of property names to schema definitions for each property of the object.
propertyOrdering[]string
Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.
required[]string
Optional. If type is OBJECT, required lists the names of properties that must be present.
Optional. If type is OBJECT, minProperties specifies the minimum number of properties that can be provided.
Optional. If type is OBJECT, maxProperties specifies the maximum number of properties that can be provided.
minimumnumber
Optional. If type is INTEGER or NUMBER, minimum specifies the minimum allowed value.
maximumnumber
Optional. If type is INTEGER or NUMBER, maximum specifies the maximum allowed value.
Optional. If type is STRING, minLength specifies the minimum length of the string.
Optional. If type is STRING, maxLength specifies the maximum length of the string.
patternstring
Optional. If type is STRING, pattern specifies a regular expression that the string must match.
Optional. Example of an instance of this schema.
Optional. The instance must be valid against any (one or more) of the subschemas listed in anyOf.
Optional. If type is OBJECT, specifies how to handle properties not defined in properties. If it is a boolean false, no additional properties are allowed. If it is a schema, additional properties are allowed if they conform to the schema.
refstring
Optional. Allows referencing another schema definition to use in place of this schema. The value must be a valid reference to a schema in defs.
For example, the following schema defines a reference to a schema node named "Pet":
type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string
The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
Optional. defs provides a map of schema definitions that can be reused by ref elsewhere in the schema. Only allowed at root level of the schema.
| JSON representation |
|---|
{ "type": enum ( |
Type
type contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/
| Enums | |
|---|---|
TYPE_UNSPECIFIED |
Not specified, should not be used. |
STRING |
OpenAPI string type |
NUMBER |
OpenAPI number type |
INTEGER |
OpenAPI integer type |
BOOLEAN |
OpenAPI boolean type |
ARRAY |
OpenAPI array type |
OBJECT |
OpenAPI object type |
NULL |
Null type |