class Gemini::Schema
- Gemini::Schema
- Reference
- Object
Overview
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.
Included Modules
- JSON::Serializable
Defined in:
gemini/types.crConstructors
- .new(pull : JSON::PullParser)
- .new(type : Gemini::Schema::Type, format : Nil | String = nil, description : Nil | String = nil, nullable : Bool | Nil = nil, enumeration : Nil | Array(String) = nil, max_items : Nil | String = nil, min_items : Nil | String = nil, properties : Nil | Hash(String, Gemini::Schema) = nil, required : Nil | Array(String) = nil, items : Nil | Gemini::Schema = nil)
Instance Method Summary
-
#description : String | Nil
A brief description of the parameter.
-
#description=(description : String | Nil)
A brief description of the parameter.
-
#enumeration : Array(String) | Nil
Possible values of the element of
Type::String
with enum format. -
#enumeration=(enumeration : Array(String) | Nil)
Possible values of the element of
Type::String
with enum format. -
#format : String | Nil
The format of the data.
-
#format=(format : String | Nil)
The format of the data.
-
#items : Schema | Nil
Schema of the elements of
Type::Array
. -
#items=(items : Schema | Nil)
Schema of the elements of
Type::Array
. -
#max_items : String | Nil
Maximum number of the elements for
Type::Array
. -
#max_items=(max_items : String | Nil)
Maximum number of the elements for
Type::Array
. -
#min_items : String | Nil
Minimum number of the elements for
Type::Array
. -
#min_items=(min_items : String | Nil)
Minimum number of the elements for
Type::Array
. -
#nullable=(nullable : Bool | Nil)
Indicates if the value may be null.
-
#nullable? : Bool | Nil
Indicates if the value may be null.
-
#properties : Hash(String, Schema) | Nil
Properties of
Type
. -
#properties=(properties : Hash(String, Schema) | Nil)
Properties of
Type
. -
#required : Array(String) | Nil
Required properties of
Type
. -
#required=(required : Array(String) | Nil)
Required properties of
Type
. -
#type : Type
Data type.
-
#type=(type : Type)
Data type.
Constructor Detail
Instance Method Detail
A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown. (Optional)
A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown. (Optional)
Possible values of the element of Type::String
with enum format. For example we can define an Enum Direction as:
Schema.new(
type: :string,
format: "enum",
enumeration: ["EAST", "NORTH", "SOUTH", "WEST"]
)
(Optional)
Possible values of the element of Type::String
with enum format. For example we can define an Enum Direction as:
Schema.new(
type: :string,
format: "enum",
enumeration: ["EAST", "NORTH", "SOUTH", "WEST"]
)
(Optional)
The format of the data. (Optional) Supported formats:
- NUMBER: float, double
- INTEGER: int32, int64
- STRING: enum
The format of the data. (Optional) Supported formats:
- NUMBER: float, double
- INTEGER: int32, int64
- STRING: enum
Maximum number of the elements for Type::Array
. (Optional)
Minimum number of the elements for Type::Array
. (Optional)