mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-23 04:52:28 +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")]
|
#[cfg(feature = "uuid")]
|
||||||
use uuid::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
|
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")]
|
#[cfg(feature = "chrono")]
|
||||||
str_types!(format = Date, Date<FixedOffset>, Date<Local>, Date<Utc>, NaiveDate);
|
str_types!(format = Date, Date<FixedOffset>, Date<Local>, Date<Utc>, NaiveDate);
|
||||||
#[cfg(feature = "chrono")]
|
#[cfg(feature = "chrono")]
|
||||||
|
|
Loading…
Add table
Reference in a new issue