Struct openapi_type::OpenapiSchema [−][src]
#[non_exhaustive]pub struct OpenapiSchema {
pub name: Option<String>,
pub description: Option<String>,
pub nullable: bool,
pub schema: SchemaKind,
pub dependencies: IndexMap<String, OpenapiSchema>,
}
Expand description
This struct is used to generate the OpenAPI specification for a particular type. It is already made available for all primitives and some other types from the rust standard library, and you can also make your own types provide one through the OpenapiType trait and derive macro.
Note that this struct is marked non-exhaustive. This means that new attributes might be added at any point in time without a breaking change. The only way to obtain a value is through the OpenapiSchema::new method.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.name: Option<String>
The name of this schema. If it is None, the schema will be inlined.
description: Option<String>
The description of this schema. Optional and only makes sense when a [name] is set as well.
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for OpenapiSchema
impl Send for OpenapiSchema
impl Sync for OpenapiSchema
impl Unpin for OpenapiSchema
impl UnwindSafe for OpenapiSchema
Blanket Implementations
Mutably borrows from an owned value. Read more