Struct Swagger

Source
pub struct Swagger {
Show 16 fields pub swagger: String, pub info: Info, pub host: Option<String>, pub base_path: Option<String>, pub schemas: Option<Vec<TransferProtocol>>, pub consumes: Option<String>, pub produces: Option<String>, pub paths: BTreeMap<String, PathItem>, pub definitions: Option<BTreeMap<String, Schema>>, pub parameters: Option<BTreeMap<String, Parameter>>, pub responses: Option<BTreeMap<String, Response>>, pub security_definitions: Option<BTreeMap<String, SecurityScheme>>, pub security: Option<Vec<SecurityRequirementObject>>, pub tags: Option<Vec<Tag>>, pub external_docs: Option<ExternalDoc>, pub extensions: Extensions,
}
Expand description

§Swagger

The Top Level Struct of swagger

Swagger document specification here

see https://swagger.io/specification/v2/#swagger-object

Fields§

§swagger: String

2.0

§info: Info

Provides metadata about the API. The metadata can be used by the clients if needed.

§host: Option<String>

The host (name or ip) serving the API.

§base_path: Option<String>

The base path on which the API is served, which is relative to the host.

§schemas: Option<Vec<TransferProtocol>>

The transfer protocol of the API.

§consumes: Option<String>

A list of MIME types the APIs can consume.

§produces: Option<String>

A list of MIME types the APIs can produce.

§paths: BTreeMap<String, PathItem>

The available paths and operations for the API.

§definitions: Option<BTreeMap<String, Schema>>

An object to hold data types produced and consumed by operations.

§parameters: Option<BTreeMap<String, Parameter>>

An object to hold parameters that can be used across operations. This property does not define global parameters for all operations.

§responses: Option<BTreeMap<String, Response>>

An object to hold responses that can be used across operations. This property does not define global responses for all operations.

§security_definitions: Option<BTreeMap<String, SecurityScheme>>

Security scheme definitions that can be used across the specification.

§security: Option<Vec<SecurityRequirementObject>>

A declaration of which security schemes are applied for the API as a whole.

§tags: Option<Vec<Tag>>

A list of tags used by the specification with additional metadata.

§external_docs: Option<ExternalDoc>

Additional external documentation.

§extensions: Extensions

Allows extensions to the Swagger Schema. The field name MUST begin with x-, for example, x-internal-id. The value can be null, a primitive, an array or an object.

Trait Implementations§

Source§

impl Clone for Swagger

Source§

fn clone(&self) -> Swagger

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Swagger

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Swagger

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Swagger

Source§

fn eq(&self, other: &Swagger) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Swagger

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Swagger

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,