mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 23:07:01 +00:00
add some openapi tests
This commit is contained in:
parent
0863d41084
commit
eb091be81b
2 changed files with 32 additions and 1 deletions
|
@ -2,7 +2,7 @@ use crate::{ResponseBody, StatusCode};
|
|||
#[cfg(feature = "openapi")]
|
||||
use crate::{OpenapiSchema, OpenapiType};
|
||||
use hyper::Body;
|
||||
use mime::{Mime, APPLICATION_JSON};
|
||||
use mime::{Mime, APPLICATION_JSON, STAR_STAR};
|
||||
#[cfg(feature = "openapi")]
|
||||
use openapiv3::{SchemaKind, StringFormat, StringType, Type, VariantOrUnknownOrEmpty};
|
||||
use serde::Serialize;
|
||||
|
@ -289,6 +289,11 @@ impl<T : Into<Body>> ResourceResult for Raw<T>
|
|||
Ok(Response::new(StatusCode::OK, self.raw, Some(self.mime.clone())))
|
||||
}
|
||||
|
||||
fn accepted_types() -> Option<Vec<Mime>>
|
||||
{
|
||||
Some(vec![STAR_STAR])
|
||||
}
|
||||
|
||||
#[cfg(feature = "openapi")]
|
||||
fn schema() -> OpenapiSchema
|
||||
{
|
||||
|
@ -315,6 +320,11 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn accepted_types() -> Option<Vec<Mime>>
|
||||
{
|
||||
<Raw<T> as ResourceResult>::accepted_types()
|
||||
}
|
||||
|
||||
#[cfg(feature = "openapi")]
|
||||
fn schema() -> OpenapiSchema
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue