[][src]Trait paperclip::v2::schema::Apiv2Schema

pub trait Apiv2Schema {
    const NAME: Option<&'static str>;
    const DESCRIPTION: &'static str;
    fn raw_schema() -> DefaultSchemaRaw { ... }
fn schema_with_ref() -> DefaultSchemaRaw { ... } }

Represents a OpenAPI v2 schema convertible. This is auto-implemented by framework-specific macros:

This is implemented for primitive types by default.

Associated Constants

const NAME: Option<&'static str>

Name of this schema. This is the object's name.

const DESCRIPTION: &'static str

Description of this schema. In case the trait is derived, uses the documentation on the type.

Loading content...

Provided methods

fn raw_schema() -> DefaultSchemaRaw

Returns the raw schema for this object.

fn schema_with_ref() -> DefaultSchemaRaw

Returns the schema with a reference (if this is an object).

Here, we set the global reference to this object using its name, and we either remove the reference (remove_refs) or remove all properties other than the reference (retain_ref) based on where we're storing this object in the spec i.e., in an operation/response or in the map of definitions.

And we do that because at the time of this writing, statically collecting all models for all operations involved a lot of work, and so I went for runtime collection. Even though this happens at runtime, we're only doing this once at the start of the application, so it won't affect the incoming requests at all.

Loading content...

Implementations on Foreign Types

impl Apiv2Schema for ()[src]

impl<T> Apiv2Schema for BTreeSet<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for Vec<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for Option<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 2] where
    T: Apiv2Schema
[src]

impl<T, E> Apiv2Schema for Result<T, E> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for BinaryHeap<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for LinkedList<T> where
    T: Apiv2Schema
[src]

impl<'a, T> Apiv2Schema for &'a [T] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 14] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 7] where
    T: Apiv2Schema
[src]

impl<K, V> Apiv2Schema for BTreeMap<K, V> where
    K: AsRef<str>,
    V: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 6] where
    T: Apiv2Schema
[src]

impl Apiv2Schema for Value[src]

impl<T> Apiv2Schema for [T; 16] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 12] where
    T: Apiv2Schema
[src]

impl Apiv2Schema for Value[src]

impl<T> Apiv2Schema for [T; 9] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 15] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 1] where
    T: Apiv2Schema
[src]

impl<K, V> Apiv2Schema for HashMap<K, V, RandomState> where
    K: AsRef<str>,
    V: Apiv2Schema
[src]

impl<'_, T> Apiv2Schema for Cow<'_, T> where
    T: Apiv2Schema + Clone
[src]

impl<T> Apiv2Schema for [T; 8] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for VecDeque<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for HashSet<T, RandomState> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 3] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 5] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 0] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 11] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 4] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 13] where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for [T; 10] where
    T: Apiv2Schema
[src]

Loading content...

Implementors

impl Apiv2Schema for Bytes[src]

impl Apiv2Schema for Response<Body>[src]

impl Apiv2Schema for HttpRequest[src]

impl Apiv2Schema for Payload[src]

impl<A> Apiv2Schema for Path<(A,)> where
    A: Apiv2Schema
[src]

impl<A, B> Apiv2Schema for Path<(A, B)> where
    A: Apiv2Schema,
    B: Apiv2Schema
[src]

impl<A, B, C> Apiv2Schema for Path<(A, B, C)> where
    A: Apiv2Schema,
    B: Apiv2Schema,
    C: Apiv2Schema
[src]

impl<A, B, C, D> Apiv2Schema for Path<(A, B, C, D)> where
    A: Apiv2Schema,
    B: Apiv2Schema,
    C: Apiv2Schema,
    D: Apiv2Schema
[src]

impl<A, B, C, D, E> Apiv2Schema for Path<(A, B, C, D, E)> where
    A: Apiv2Schema,
    B: Apiv2Schema,
    C: Apiv2Schema,
    D: Apiv2Schema,
    E: Apiv2Schema
[src]

impl<T> Apiv2Schema for Data<T>[src]

impl<T> Apiv2Schema for ResponderWrapper<T> where
    T: Responder, 
[src]

impl<T> Apiv2Schema for Form<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for Json<T> where
    T: Apiv2Schema
[src]

JSON needs specialization because it updates the global definitions.

impl<T> Apiv2Schema for Path<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for Query<T> where
    T: Apiv2Schema
[src]

impl<T> Apiv2Schema for T where
    T: TypedData
[src]

Loading content...