mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-22 20:52:27 +00:00
add OpenapiType for BTreeSet and HashSet
This commit is contained in:
parent
9d21ea9cce
commit
ff02e3c06b
1 changed files with 17 additions and 0 deletions
|
@ -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<T : OpenapiType> OpenapiType for Vec<T>
|
|||
}
|
||||
}
|
||||
|
||||
impl<T : OpenapiType> OpenapiType for BTreeSet<T>
|
||||
{
|
||||
fn schema() -> OpenapiSchema
|
||||
{
|
||||
<Vec<T> as OpenapiType>::schema()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T : OpenapiType> OpenapiType for HashSet<T>
|
||||
{
|
||||
fn schema() -> OpenapiSchema
|
||||
{
|
||||
<Vec<T> as OpenapiType>::schema()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "chrono")]
|
||||
str_types!(format = Date, Date<FixedOffset>, Date<Local>, Date<Utc>, NaiveDate);
|
||||
#[cfg(feature = "chrono")]
|
||||
|
|
Loading…
Add table
Reference in a new issue