Schema
Schema is used to define the format of input/output data.
Represents a select subset of an OpenAPI 3.0 schema object.
Constructors
Types
Properties
The value to assume when the property is absent. Must be JSON-native -- a String, number, Boolean, Map or List -- since anything else fails to serialize. Serializing a Schema that sets this needs a Json whose serializersModule carries a contextual serializer for Any; a plain Json throws. JSON also has a single number type, so a numeric default that crosses a JSON boundary comes back as whatever Kotlin type the reader picks, not necessarily the one it was written as.
A human-readable description of the schema.
The format of the data, refining type. The field is free-form, but Gemini accepts only int32 or int64 for Type.INTEGER and Type.NUMBER, and enum or date-time for Type.STRING; it rejects a declaration carrying any other value.
Describes the schema of items in an array. Applicable only if type is Type.ARRAY.
The largest allowed value. Applicable only if type is Type.INTEGER or Type.NUMBER.
The most allowed items. Applicable only if type is Type.ARRAY.
The longest allowed string. Applicable only if type is Type.STRING.
The most allowed properties. Applicable only if type is Type.OBJECT.
The smallest allowed value. Applicable only if type is Type.INTEGER or Type.NUMBER.
The fewest allowed items. Applicable only if type is Type.ARRAY.
The shortest allowed string. Applicable only if type is Type.STRING.
The fewest allowed properties. Applicable only if type is Type.OBJECT.
A regular expression the value must match. Applicable only if type is Type.STRING.
Describes the properties of an object. The keys are property names and values are schemas for corresponding properties. Applicable only if type is Type.OBJECT.
A list of required property names. Applicable only if type is Type.OBJECT.