1
0
Fork 0
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:
Dominic 2021-03-09 19:46:11 +01:00
parent eecd192458
commit ebea39fe0d
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
27 changed files with 148 additions and 866 deletions

View file

@ -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 => {

View file

@ -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()
}
}