Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed.
JSON representation |
---|
{ "type": enum ( |
Fields | |
---|---|
type |
Optional. The type of the data. |
format |
Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc |
title |
Optional. The title of the Schema. |
description |
Optional. The description of the data. |
nullable |
Optional. Indicates if the value may be null. |
default |
Optional. Default value of the data. |
items |
Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of type.ARRAY. |
minItems |
Optional. Minimum number of the elements for type.ARRAY. |
maxItems |
Optional. Maximum number of the elements for type.ARRAY. |
enum[] |
Optional. Possible values of the element of type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} |
properties |
Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of type.OBJECT. |
required[] |
Optional. Required properties of type.OBJECT. |
minProperties |
Optional. Minimum number of the properties for type.OBJECT. |
maxProperties |
Optional. Maximum number of the properties for type.OBJECT. |
minimum |
Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the type.INTEGER and type.NUMBER |
maximum |
Optional. Maximum value of the type.INTEGER and type.NUMBER |
minLength |
Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the type.STRING |
maxLength |
Optional. Maximum length of the type.STRING |
pattern |
Optional. Pattern of the type.STRING to restrict a string to a regular expression. |
example |
Optional. Example of the object. Will only populated when the object is the root. |
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 |