Struct utoipa::openapi::example::ExampleBuilder
source · pub struct ExampleBuilder { /* private fields */ }
Expand description
Implementations§
source§impl ExampleBuilder
impl ExampleBuilder
sourcepub fn new() -> ExampleBuilder
pub fn new() -> ExampleBuilder
Constructs a new ExampleBuilder
.
source§impl ExampleBuilder
impl ExampleBuilder
sourcepub fn summary<S: Into<String>>(self, summary: S) -> Self
pub fn summary<S: Into<String>>(self, summary: S) -> Self
Add or change a short description for the Example
. Setting this to empty String
will make it not render in the generated OpenAPI document.
sourcepub fn description<D: Into<String>>(self, description: D) -> Self
pub fn description<D: Into<String>>(self, description: D) -> Self
Add or change a long description for the Example
. Markdown syntax is supported for rich
text representation.
Setting this to empty String
will make it not render in the generated
OpenAPI document.
sourcepub fn value(self, value: Option<Value>) -> Self
pub fn value(self, value: Option<Value>) -> Self
Add or change embedded literal example value. Example::value
and Example::external_value
are mutually exclusive.
sourcepub fn external_value<E: Into<String>>(self, external_value: E) -> Self
pub fn external_value<E: Into<String>>(self, external_value: E) -> Self
Add or change an URI that points to a literal example value. Example::external_value
provides the capability to references an example that cannot be easily included
in JSON or YAML. Example::value
and Example::external_value
are mutually exclusive.
Setting this to an empty String will make the field not to render in the generated OpenAPI document.