diff --git a/gotham_restful/src/openapi/types.rs b/gotham_restful/src/openapi/types.rs index b04dd56..3b29c59 100644 --- a/gotham_restful/src/openapi/types.rs +++ b/gotham_restful/src/openapi/types.rs @@ -9,6 +9,7 @@ use openapiv3::{ }; #[cfg(feature = "uuid")] use uuid::Uuid; +use std::collections::{BTreeSet, HashSet}; /** This struct needs to be available for every type that can be part of an OpenAPI Spec. It is @@ -273,6 +274,22 @@ impl OpenapiType for Vec } } +impl OpenapiType for BTreeSet +{ + fn schema() -> OpenapiSchema + { + as OpenapiType>::schema() + } +} + +impl OpenapiType for HashSet +{ + fn schema() -> OpenapiSchema + { + as OpenapiType>::schema() + } +} + #[cfg(feature = "chrono")] str_types!(format = Date, Date, Date, Date, NaiveDate); #[cfg(feature = "chrono")]