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:
parent
eecd192458
commit
ebea39fe0d
27 changed files with 148 additions and 866 deletions
|
@ -9,6 +9,8 @@ use gotham::{
|
|||
};
|
||||
use gotham_restful::*;
|
||||
use mime::{APPLICATION_JSON, TEXT_PLAIN};
|
||||
#[cfg(feature = "openapi")]
|
||||
use openapi_type::OpenapiType;
|
||||
use serde::Deserialize;
|
||||
use tokio::time::{sleep, Duration};
|
||||
|
||||
|
@ -28,7 +30,7 @@ struct FooBody {
|
|||
data: String
|
||||
}
|
||||
|
||||
#[derive(Deserialize, StateData, StaticResponseExtender)]
|
||||
#[derive(Clone, Deserialize, StateData, StaticResponseExtender)]
|
||||
#[cfg_attr(feature = "openapi", derive(OpenapiType))]
|
||||
#[allow(dead_code)]
|
||||
struct FooSearch {
|
||||
|
|
|
@ -4,6 +4,8 @@ extern crate gotham_derive;
|
|||
use gotham::{router::builder::*, test::TestServer};
|
||||
use gotham_restful::*;
|
||||
use mime::{APPLICATION_JSON, TEXT_PLAIN};
|
||||
#[cfg(feature = "openapi")]
|
||||
use openapi_type::OpenapiType;
|
||||
use serde::Deserialize;
|
||||
|
||||
mod util {
|
||||
|
@ -22,7 +24,7 @@ struct FooBody {
|
|||
data: String
|
||||
}
|
||||
|
||||
#[derive(Deserialize, StateData, StaticResponseExtender)]
|
||||
#[derive(Clone, Deserialize, StateData, StaticResponseExtender)]
|
||||
#[cfg_attr(feature = "openapi", derive(OpenapiType))]
|
||||
#[allow(dead_code)]
|
||||
struct FooSearch {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue