1
0
Fork 0
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:
Dominic 2021-03-09 19:46:11 +01:00
parent eecd192458
commit ebea39fe0d
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
27 changed files with 148 additions and 866 deletions

View file

@ -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 {

View file

@ -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 {