Schema

The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object.

JSON representation
{
  "type": enum (Type),
  "format": string,
  "description": string,
  "nullable": boolean,
  "enum": [
    string
  ],
  "properties": {
    string: {
      object (Schema)
    },
    ...
  },
  "required": [
    string
  ],
  "items": {
    object (Schema)
  }
}
Fields
type

enum (Type)

Required. Data type.

format

string

Optional. The format of the data. This is used only for primitive datatypes. Supported formats: for NUMBER type: float, double for INTEGER type: int32, int64

description

string

Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.

nullable

boolean

Optional. Indicates if the value may be null.

enum[]

string

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

map (key: string, value: object (Schema))

Optional. Properties of Type.OBJECT.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

required[]

string

Optional. Required properties of Type.OBJECT.

items

object (Schema)

Optional. Schema of the elements of Type.ARRAY.

Type

Type contains the list of OpenAPI data types as defined by https://spec.openapis.org/oas/v3.0.3#data-types

Enums
TYPE_UNSPECIFIED Not specified, should not be used.
STRING String type.
NUMBER Number type.
INTEGER Integer type.
BOOLEAN Boolean type.
ARRAY Array type.
OBJECT Object type.