Here's a pseudo-JSON representation of all the `Schema` fields:
```
{
"type": enum (Type),
"format": string,
"description": string,
"nullable": boolean,
"enum": [
string
],
"maxItems": integer,
"minItems": integer,
"properties": {
string: {
object (Schema)
},
...
},
"required": [
string
],
"propertyOrdering": [
string
],
"items": {
object (Schema)
}
}
```
The `Type` of the schema must be one of the OpenAPI [Data Types](https://spec.openapis.org/oas/v3.0.3#data-types), or a union of those types (using `anyOf`). Only a subset of fields is valid for each `Type`. The following list maps each `Type` to a subset of the fields that are valid for that type:
- `string` -> `enum`, `format`, `nullable`
- `integer` -> `format`, `minimum`, `maximum`, `enum`, `nullable`
- `number` -> `format`, `minimum`, `maximum`, `enum`, `nullable`
- `boolean` -> `nullable`
- `array` -> `minItems`, `maxItems`, `items`, `nullable`
- `object` -> `properties`, `required`, `propertyOrdering`, `nullable`
Here are some example schemas showing valid type-and-field combinations:
Here are some example schemas showing valid type-and-field combinations:
```
{ "type": "string", "enum": ["a", "b", "c"] }
{ "type": "string", "format": "date-time" }
{ "type": "integer", "format": "int64" }
{ "type": "number", "format": "double" }
{ "type": "boolean" }
{ "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": ... } }
{ "type": "object",
"properties": {
"a": { "type": ... },
"b": { "type": ... },
"c": { "type": ... }
},
"nullable": true,
"required": ["c"],
"propertyOrdering": ["c", "b", "a"]
}
```