1
0
Fork 0
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:
Dominic 2019-10-20 16:19:01 +02:00
parent 0863d41084
commit eb091be81b
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
2 changed files with 32 additions and 1 deletions

View file

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