pub struct OpenApiBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> OpenApiBuilder<S>
impl<S: State> OpenApiBuilder<S>
Sourcepub fn build(self) -> OpenApiwhere
S: IsComplete,
pub fn build(self) -> OpenApiwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn openapi(
self,
value: impl Into<OpenApiVersion>,
) -> OpenApiBuilder<SetOpenapi<S>>where
S::Openapi: IsUnset,
pub fn openapi(
self,
value: impl Into<OpenApiVersion>,
) -> OpenApiBuilder<SetOpenapi<S>>where
S::Openapi: IsUnset,
Sourcepub fn maybe_openapi(
self,
value: Option<impl Into<OpenApiVersion>>,
) -> OpenApiBuilder<SetOpenapi<S>>where
S::Openapi: IsUnset,
pub fn maybe_openapi(
self,
value: Option<impl Into<OpenApiVersion>>,
) -> OpenApiBuilder<SetOpenapi<S>>where
S::Openapi: IsUnset,
Sourcepub fn info(self, value: impl Into<Info>) -> OpenApiBuilder<SetInfo<S>>where
S::Info: IsUnset,
pub fn info(self, value: impl Into<Info>) -> OpenApiBuilder<SetInfo<S>>where
S::Info: IsUnset,
Optional (Some / Option setters). Default: <Info as Default>::default()
.
Provides metadata about the API.
See more details at https://spec.openapis.org/oas/latest.html#info-object.
Sourcepub fn maybe_info(
self,
value: Option<impl Into<Info>>,
) -> OpenApiBuilder<SetInfo<S>>where
S::Info: IsUnset,
pub fn maybe_info(
self,
value: Option<impl Into<Info>>,
) -> OpenApiBuilder<SetInfo<S>>where
S::Info: IsUnset,
Optional (Some / Option setters). Default: <Info as Default>::default()
.
Provides metadata about the API.
See more details at https://spec.openapis.org/oas/latest.html#info-object.
Sourcepub fn servers(
self,
value: impl Into<Vec<Server>>,
) -> OpenApiBuilder<SetServers<S>>where
S::Servers: IsUnset,
pub fn servers(
self,
value: impl Into<Vec<Server>>,
) -> OpenApiBuilder<SetServers<S>>where
S::Servers: IsUnset,
Optional (Some / Option setters).
Optional list of servers that provides the connectivity information to target servers.
This is implicitly one server with url
set to /
.
See more details at https://spec.openapis.org/oas/latest.html#server-object.
Sourcepub fn maybe_servers(
self,
value: Option<impl Into<Vec<Server>>>,
) -> OpenApiBuilder<SetServers<S>>where
S::Servers: IsUnset,
pub fn maybe_servers(
self,
value: Option<impl Into<Vec<Server>>>,
) -> OpenApiBuilder<SetServers<S>>where
S::Servers: IsUnset,
Optional (Some / Option setters).
Optional list of servers that provides the connectivity information to target servers.
This is implicitly one server with url
set to /
.
See more details at https://spec.openapis.org/oas/latest.html#server-object.
Sourcepub fn paths(self, value: impl Into<Paths>) -> OpenApiBuilder<SetPaths<S>>where
S::Paths: IsUnset,
pub fn paths(self, value: impl Into<Paths>) -> OpenApiBuilder<SetPaths<S>>where
S::Paths: IsUnset,
Optional (Some / Option setters). Default: <Paths as Default>::default()
.
Available paths and operations for the API.
See more details at https://spec.openapis.org/oas/latest.html#paths-object.
Sourcepub fn maybe_paths(
self,
value: Option<impl Into<Paths>>,
) -> OpenApiBuilder<SetPaths<S>>where
S::Paths: IsUnset,
pub fn maybe_paths(
self,
value: Option<impl Into<Paths>>,
) -> OpenApiBuilder<SetPaths<S>>where
S::Paths: IsUnset,
Optional (Some / Option setters). Default: <Paths as Default>::default()
.
Available paths and operations for the API.
See more details at https://spec.openapis.org/oas/latest.html#paths-object.
Sourcepub fn components(
self,
value: impl Into<Components>,
) -> OpenApiBuilder<SetComponents<S>>where
S::Components: IsUnset,
pub fn components(
self,
value: impl Into<Components>,
) -> OpenApiBuilder<SetComponents<S>>where
S::Components: IsUnset,
Optional (Some / Option setters).
Holds various reusable schemas for the OpenAPI document.
Few of these elements are security schemas and object schemas.
See more details at https://spec.openapis.org/oas/latest.html#components-object.
Sourcepub fn maybe_components(
self,
value: Option<impl Into<Components>>,
) -> OpenApiBuilder<SetComponents<S>>where
S::Components: IsUnset,
pub fn maybe_components(
self,
value: Option<impl Into<Components>>,
) -> OpenApiBuilder<SetComponents<S>>where
S::Components: IsUnset,
Optional (Some / Option setters).
Holds various reusable schemas for the OpenAPI document.
Few of these elements are security schemas and object schemas.
See more details at https://spec.openapis.org/oas/latest.html#components-object.
Sourcepub fn security(
self,
value: impl Into<Vec<SecurityRequirement>>,
) -> OpenApiBuilder<SetSecurity<S>>where
S::Security: IsUnset,
pub fn security(
self,
value: impl Into<Vec<SecurityRequirement>>,
) -> OpenApiBuilder<SetSecurity<S>>where
S::Security: IsUnset,
Optional (Some / Option setters).
Declaration of global security mechanisms that can be used across the API. The individual operations
can override the declarations. You can use SecurityRequirement::default()
if you wish to make security
optional by adding it to the list of securities.
See more details at https://spec.openapis.org/oas/latest.html#security-requirement-object.
Sourcepub fn maybe_security(
self,
value: Option<impl Into<Vec<SecurityRequirement>>>,
) -> OpenApiBuilder<SetSecurity<S>>where
S::Security: IsUnset,
pub fn maybe_security(
self,
value: Option<impl Into<Vec<SecurityRequirement>>>,
) -> OpenApiBuilder<SetSecurity<S>>where
S::Security: IsUnset,
Optional (Some / Option setters).
Declaration of global security mechanisms that can be used across the API. The individual operations
can override the declarations. You can use SecurityRequirement::default()
if you wish to make security
optional by adding it to the list of securities.
See more details at https://spec.openapis.org/oas/latest.html#security-requirement-object.
Optional (Some / Option setters).
Optional list of tags can be used to add additional documentation to matching tags of operations.
See more details at https://spec.openapis.org/oas/latest.html#tag-object.
Optional (Some / Option setters).
Optional list of tags can be used to add additional documentation to matching tags of operations.
See more details at https://spec.openapis.org/oas/latest.html#tag-object.
Sourcepub fn external_docs(
self,
value: impl Into<ExternalDocs>,
) -> OpenApiBuilder<SetExternalDocs<S>>where
S::ExternalDocs: IsUnset,
pub fn external_docs(
self,
value: impl Into<ExternalDocs>,
) -> OpenApiBuilder<SetExternalDocs<S>>where
S::ExternalDocs: IsUnset,
Optional (Some / Option setters).
Optional global additional documentation reference.
See more details at https://spec.openapis.org/oas/latest.html#external-documentation-object.
Sourcepub fn maybe_external_docs(
self,
value: Option<impl Into<ExternalDocs>>,
) -> OpenApiBuilder<SetExternalDocs<S>>where
S::ExternalDocs: IsUnset,
pub fn maybe_external_docs(
self,
value: Option<impl Into<ExternalDocs>>,
) -> OpenApiBuilder<SetExternalDocs<S>>where
S::ExternalDocs: IsUnset,
Optional (Some / Option setters).
Optional global additional documentation reference.
See more details at https://spec.openapis.org/oas/latest.html#external-documentation-object.
Sourcepub fn schema(self, value: impl Into<String>) -> OpenApiBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn schema(self, value: impl Into<String>) -> OpenApiBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Optional (Some / Option setters). Default: ""
.
Schema keyword can be used to override default $schema
dialect which is by default
“https://spec.openapis.org/oas/3.1/dialect/base”.
All the references and individual files could use their own schema dialect.
Sourcepub fn maybe_schema(
self,
value: Option<impl Into<String>>,
) -> OpenApiBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn maybe_schema(
self,
value: Option<impl Into<String>>,
) -> OpenApiBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Optional (Some / Option setters). Default: ""
.
Schema keyword can be used to override default $schema
dialect which is by default
“https://spec.openapis.org/oas/3.1/dialect/base”.
All the references and individual files could use their own schema dialect.