oaspec/openapi/schema
Types
Represents a JSON Schema object within OpenAPI 3.x. This is the core building block for all type generation.
pub type SchemaObject {
StringSchema(
description: option.Option(String),
format: option.Option(String),
enum_values: List(String),
min_length: option.Option(Int),
max_length: option.Option(Int),
pattern: option.Option(String),
nullable: Bool,
)
IntegerSchema(
description: option.Option(String),
format: option.Option(String),
minimum: option.Option(Int),
maximum: option.Option(Int),
nullable: Bool,
)
NumberSchema(
description: option.Option(String),
format: option.Option(String),
minimum: option.Option(Float),
maximum: option.Option(Float),
nullable: Bool,
)
BooleanSchema(
description: option.Option(String),
nullable: Bool,
)
ArraySchema(
description: option.Option(String),
items: SchemaRef,
min_items: option.Option(Int),
max_items: option.Option(Int),
nullable: Bool,
)
ObjectSchema(
description: option.Option(String),
properties: dict.Dict(String, SchemaRef),
required: List(String),
additional_properties: option.Option(SchemaRef),
additional_properties_untyped: Bool,
nullable: Bool,
)
AllOfSchema(
description: option.Option(String),
schemas: List(SchemaRef),
)
OneOfSchema(
description: option.Option(String),
schemas: List(SchemaRef),
discriminator: option.Option(Discriminator),
)
AnyOfSchema(
description: option.Option(String),
schemas: List(SchemaRef),
)
}
Constructors
-
StringSchema( description: option.Option(String), format: option.Option(String), enum_values: List(String), min_length: option.Option(Int), max_length: option.Option(Int), pattern: option.Option(String), nullable: Bool, ) -
IntegerSchema( description: option.Option(String), format: option.Option(String), minimum: option.Option(Int), maximum: option.Option(Int), nullable: Bool, ) -
NumberSchema( description: option.Option(String), format: option.Option(String), minimum: option.Option(Float), maximum: option.Option(Float), nullable: Bool, ) -
BooleanSchema(description: option.Option(String), nullable: Bool) -
ArraySchema( description: option.Option(String), items: SchemaRef, min_items: option.Option(Int), max_items: option.Option(Int), nullable: Bool, ) -
ObjectSchema( description: option.Option(String), properties: dict.Dict(String, SchemaRef), required: List(String), additional_properties: option.Option(SchemaRef), additional_properties_untyped: Bool, nullable: Bool, ) -
AllOfSchema( description: option.Option(String), schemas: List(SchemaRef), ) -
OneOfSchema( description: option.Option(String), schemas: List(SchemaRef), discriminator: option.Option(Discriminator), ) -
AnyOfSchema( description: option.Option(String), schemas: List(SchemaRef), )
A reference to a schema, either inline or via $ref.
pub type SchemaRef {
Inline(SchemaObject)
Reference(ref: String)
}
Constructors
-
Inline(SchemaObject) -
Reference(ref: String)
Values
pub fn get_description(
schema: SchemaObject,
) -> option.Option(String)
Get the description from any schema object.