mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-05-09 16:10:42 +00:00
use openapi_type::OpenapiType for gotham_restful
This commit is contained in:
parent
eecd192458
commit
ebea39fe0d
27 changed files with 148 additions and 866 deletions
|
@ -97,7 +97,7 @@ fn str_schema(format: VariantOrUnknownOrEmpty<StringFormat>) -> OpenapiSchema {
|
|||
})))
|
||||
}
|
||||
|
||||
impl_openapi_type!(String => str_schema(VariantOrUnknownOrEmpty::Empty));
|
||||
impl_openapi_type!(String, str => str_schema(VariantOrUnknownOrEmpty::Empty));
|
||||
|
||||
#[cfg(feature = "chrono")]
|
||||
impl_openapi_type!(Date<T: TimeZone>, NaiveDate => {
|
||||
|
|
|
@ -78,3 +78,9 @@ struct MyResponse {
|
|||
pub trait OpenapiType {
|
||||
fn schema() -> OpenapiSchema;
|
||||
}
|
||||
|
||||
impl<'a, T: ?Sized + OpenapiType> OpenapiType for &'a T {
|
||||
fn schema() -> OpenapiSchema {
|
||||
T::schema()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue