From 6aa53942a0a131875c8a235474cde8e521c68aed Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 17 Jan 2020 21:37:41 +0100 Subject: [PATCH] openapiv3 upstream changed StringFormat: just use ..Default::default() --- gotham_restful/src/result.rs | 3 +-- gotham_restful_derive/src/openapi_type.rs | 4 ++-- gotham_restful_derive/src/request_body.rs | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gotham_restful/src/result.rs b/gotham_restful/src/result.rs index c5e67b0..9cfe9c6 100644 --- a/gotham_restful/src/result.rs +++ b/gotham_restful/src/result.rs @@ -299,8 +299,7 @@ impl> ResourceResult for Raw { OpenapiSchema::new(SchemaKind::Type(Type::String(StringType { format: VariantOrUnknownOrEmpty::Item(StringFormat::Binary), - pattern: None, - enumeration: Vec::new() + ..Default::default() }))) } } diff --git a/gotham_restful_derive/src/openapi_type.rs b/gotham_restful_derive/src/openapi_type.rs index f15889e..06c64f0 100644 --- a/gotham_restful_derive/src/openapi_type.rs +++ b/gotham_restful_derive/src/openapi_type.rs @@ -84,8 +84,8 @@ fn expand_enum(input : ItemEnum) -> TokenStream2 OpenapiSchema::new(SchemaKind::Type(Type::String(StringType { format: VariantOrUnknownOrEmpty::Empty, - pattern: None, - enumeration + enumeration, + ..Default::default() }))) } } diff --git a/gotham_restful_derive/src/request_body.rs b/gotham_restful_derive/src/request_body.rs index fdcd017..74d1a72 100644 --- a/gotham_restful_derive/src/request_body.rs +++ b/gotham_restful_derive/src/request_body.rs @@ -46,8 +46,7 @@ fn impl_openapi_type(ident : &Ident, generics : &Generics) -> TokenStream2 OpenapiSchema::new(SchemaKind::Type(Type::String(StringType { format: VariantOrUnknownOrEmpty::Item(StringFormat::Binary), - pattern: None, - enumeration: Vec::new() + ..Default::default() }))) } }