Struct dropshot::OpenApiDefinition[][src]

pub struct OpenApiDefinition<'a> { /* fields omitted */ }

This object is used to specify configuration for building an OpenAPI definition document. It is constructed using ApiDescription::openapi(). Additional optional properties may be added and then the OpenAPI definition document may be generated via write() or json().

Implementations

impl<'a> OpenApiDefinition<'a>[src]

pub fn description<S: AsRef<str>>(&mut self, description: S) -> &mut Self[src]

Provide a short description of the API. CommonMark syntax may be used for rich text representation.

This routine will set the description field of the Info object in the OpenAPI definition.

pub fn terms_of_service<S: AsRef<str>>(&mut self, url: S) -> &mut Self[src]

Include a Terms of Service URL for the API. Must be in the format of a URL.

This routine will set the termsOfService field of the Info object in the OpenAPI definition.

pub fn contact_name<S: AsRef<str>>(&mut self, name: S) -> &mut Self[src]

Set the identifying name of the contact person or organisation responsible for the API.

This routine will set the name property of the Contact object within the Info object in the OpenAPI definition.

pub fn contact_url<S: AsRef<str>>(&mut self, url: S) -> &mut Self[src]

Set a contact URL for the API. Must be in the format of a URL.

This routine will set the url property of the Contact object within the Info object in the OpenAPI definition.

pub fn contact_email<S: AsRef<str>>(&mut self, email: S) -> &mut Self[src]

Set the email address of the contact person or organisation responsible for the API. Must be in the format of an email address.

This routine will set the email property of the Contact object within the Info object in the OpenAPI definition.

pub fn license<S1, S2>(&mut self, name: S1, url: S2) -> &mut Self where
    S1: AsRef<str>,
    S2: AsRef<str>, 
[src]

Provide the name of the licence used for the API, and a URL (must be in URL format) displaying the licence text.

This routine will set the name and optional url properties of the License object within the Info object in the OpenAPI definition.

pub fn license_name<S: AsRef<str>>(&mut self, name: S) -> &mut Self[src]

Provide the name of the licence used for the API.

This routine will set the name property of the License object within the Info object in the OpenAPI definition.

pub fn json(&self) -> Result<Value>[src]

Build a JSON object containing the OpenAPI definition for this API.

pub fn write(&self, out: &mut dyn Write) -> Result<()>[src]

Build a JSON object containing the OpenAPI definition for this API and write it to the provided stream.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.