pub struct OpenapiSchema {
    pub name: Option<String>,
    pub nullable: bool,
    pub schema: SchemaKind,
    pub dependencies: IndexMap<String, OpenapiSchema>,
}
Expand description

This struct needs to be available for every type that can be part of an OpenAPI Spec. It is already implemented for primitive types, String, Vec, Option and the like. To have it available for your type, simply derive from OpenapiType.

Fields

name: Option<String>

The name of this schema. If it is None, the schema will be inlined.

nullable: bool

Whether this particular schema is nullable. Note that there is no guarantee that this will make it into the final specification, it might just be interpreted as a hint to make it an optional parameter.

schema: SchemaKind

The actual OpenAPI schema.

dependencies: IndexMap<String, OpenapiSchema>

Other schemas that this schema depends on. They will be included in the final OpenAPI Spec along with this schema.

Implementations

Create a new schema that has no name.

Convert this schema to a Schema that can be serialized to the OpenAPI Spec.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.