pub trait OpenapiType {
    // Required method
    fn visit_type<V: Visitor>(visitor: &mut V);

    // Provided method
    fn schema() -> OpenapiSchema { ... }
}
Expand description

This trait needs to be implemented by every type that is being used in the OpenAPI Spec. It gives access to the OpenapiSchema of this type. It is provided for primitive types, String and the like. For use on your own types, there is a derive macro:

#[derive(OpenapiType)]
struct MyResponse {
	message: String
}

Required Methods§

Provided Methods§

Implementations on Foreign Types§

source§

impl OpenapiType for u32

source§

impl<T> OpenapiType for BTreeSet<T>where T: OpenapiType,

source§

impl OpenapiType for i64

source§

impl OpenapiType for ()

source§

impl OpenapiType for i128

source§

impl<T, S> OpenapiType for HashSet<T, S>where T: OpenapiType,

source§

impl OpenapiType for isize

source§

impl OpenapiType for bool

source§

impl OpenapiType for f64

source§

impl OpenapiType for u128

source§

impl OpenapiType for NonZeroU8

source§

impl OpenapiType for NonZeroU128

source§

impl OpenapiType for Value

source§

impl OpenapiType for CString

source§

impl OpenapiType for i16

source§

impl<T> OpenapiType for IndexSet<T>where T: OpenapiType,

source§

impl OpenapiType for i8

source§

impl<'a, T: ?Sized + OpenapiType> OpenapiType for &'a T

source§

impl OpenapiType for CStr

source§

impl OpenapiType for NonZeroU64

source§

impl OpenapiType for NonZeroU32

source§

impl OpenapiType for NonZeroU16

source§

impl OpenapiType for String

source§

impl<T> OpenapiType for Vec<T>where T: OpenapiType,

source§

impl<T> OpenapiType for LinkedList<T>where T: OpenapiType,

source§

impl OpenapiType for usize

source§

impl OpenapiType for char

source§

impl<K, V> OpenapiType for BTreeMap<K, V>where V: OpenapiType,

source§

impl OpenapiType for i32

source§

impl OpenapiType for u64

source§

impl<K, V, S> OpenapiType for IndexMap<K, V, S>where V: OpenapiType,

source§

impl<T: OpenapiType, const N: usize> OpenapiType for [T; N]

source§

impl<T: OpenapiType> OpenapiType for Option<T>

source§

impl<K, V, S> OpenapiType for HashMap<K, V, S>where V: OpenapiType,

source§

impl OpenapiType for u8

source§

impl<T> OpenapiType for VecDeque<T>where T: OpenapiType,

source§

impl OpenapiType for NonZeroUsize

source§

impl OpenapiType for f32

source§

impl OpenapiType for u16

source§

impl<T> OpenapiType for [T]where T: OpenapiType,

source§

impl OpenapiType for str

Implementors§