forked from loafle/openapi-generator-original
[Rust Server] Support parameters correctly in response headers (#3669)
[Rust Server] Compile responses with headers * Add test for response with headers * Update samples
This commit is contained in:
parent
9647416032
commit
4538db92a2
@ -514,7 +514,16 @@ impl<F, C> Api<C> for Client<F> where
|
|||||||
})
|
})
|
||||||
{{/dataType}}{{^dataType}}
|
{{/dataType}}{{^dataType}}
|
||||||
future::ok(
|
future::ok(
|
||||||
{{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}}{{#headers}}{{#-first}}{ {{/-first}}{{^-first}}, {{/-first}}{{{name}}}: response_{{{name}}}{{#-last}} }{{/-last}}{{/headers}}
|
{{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}}
|
||||||
|
{{#headers}}
|
||||||
|
{{#-first}}
|
||||||
|
{
|
||||||
|
{{/-first}}
|
||||||
|
{{{name}}}: response_{{{name}}},
|
||||||
|
{{#-last}}
|
||||||
|
}
|
||||||
|
{{/-last}}
|
||||||
|
{{/headers}}
|
||||||
)
|
)
|
||||||
{{/dataType}}
|
{{/dataType}}
|
||||||
) as Box<Future<Item=_, Error=_>>
|
) as Box<Future<Item=_, Error=_>>
|
||||||
|
@ -56,9 +56,35 @@ pub const API_VERSION: &'static str = "{{{appVersion}}}";
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum {{{operationId}}}Response {
|
pub enum {{{operationId}}}Response {
|
||||||
{{#responses}}
|
{{#responses}}
|
||||||
{{#message}} /// {{{message}}}{{/message}}
|
{{#message}}
|
||||||
{{#vendorExtensions}}{{{x-responseId}}}{{/vendorExtensions}} {{#dataType}}{{^hasHeaders}}( {{{dataType}}} ) {{/hasHeaders}}{{#hasHeaders}}{{#-first}}{ body: {{{dataType}}}{{/-first}}{{/hasHeaders}}{{/dataType}}{{#dataType}}{{#hasHeaders}}, {{/hasHeaders}}{{/dataType}}{{^dataType}}{{#hasHeaders}} { {{/hasHeaders}}{{/dataType}}{{#headers}}{{^-first}}, {{/-first}}{{{name}}}: {{{datatype}}}{{#-last}} } {{/-last}}{{/headers}},
|
/// {{{message}}}{{/message}}
|
||||||
{{/responses}}
|
{{#vendorExtensions}}
|
||||||
|
{{{x-responseId}}}
|
||||||
|
{{/vendorExtensions}}
|
||||||
|
{{^dataType}}
|
||||||
|
{{#hasHeaders}}
|
||||||
|
{
|
||||||
|
{{/hasHeaders}}
|
||||||
|
{{/dataType}}
|
||||||
|
{{#dataType}}
|
||||||
|
{{^hasHeaders}}
|
||||||
|
({{{dataType}}})
|
||||||
|
{{/hasHeaders}}
|
||||||
|
{{#hasHeaders}}
|
||||||
|
{
|
||||||
|
body: {{{dataType}}},
|
||||||
|
{{/hasHeaders}}
|
||||||
|
{{/dataType}}
|
||||||
|
{{#headers}}
|
||||||
|
{{{name}}}: {{{datatype}}},
|
||||||
|
{{#-last}}
|
||||||
|
}
|
||||||
|
{{/-last}}
|
||||||
|
{{/headers}}
|
||||||
|
{{^-last}}
|
||||||
|
,
|
||||||
|
{{/-last}}
|
||||||
|
{{/responses}}
|
||||||
}
|
}
|
||||||
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
|
@ -101,6 +101,28 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: 'OK'
|
description: 'OK'
|
||||||
|
/responses_with_headers:
|
||||||
|
get:
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: 'Success'
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
|
headers:
|
||||||
|
Success-Info:
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
|
'412':
|
||||||
|
description: Precondition Failed
|
||||||
|
headers:
|
||||||
|
Further-Info:
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
|
Failure-Info:
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
UuidObject:
|
UuidObject:
|
||||||
|
@ -53,7 +53,7 @@ pub const API_VERSION: &'static str = "1.0.7";
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum MultipartRequestPostResponse {
|
pub enum MultipartRequestPostResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ To run a client, follow one of the following simple steps:
|
|||||||
|
|
||||||
```
|
```
|
||||||
cargo run --example client RequiredOctetStreamPut
|
cargo run --example client RequiredOctetStreamPut
|
||||||
|
cargo run --example client ResponsesWithHeadersGet
|
||||||
cargo run --example client UuidGet
|
cargo run --example client UuidGet
|
||||||
cargo run --example client XmlExtraPost
|
cargo run --example client XmlExtraPost
|
||||||
cargo run --example client XmlOtherPost
|
cargo run --example client XmlOtherPost
|
||||||
@ -102,6 +103,7 @@ All URIs are relative to *http://localhost*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[****](docs/default_api.md#) | **PUT** /required_octet_stream |
|
[****](docs/default_api.md#) | **PUT** /required_octet_stream |
|
||||||
|
[****](docs/default_api.md#) | **GET** /responses_with_headers |
|
||||||
[****](docs/default_api.md#) | **GET** /uuid |
|
[****](docs/default_api.md#) | **GET** /uuid |
|
||||||
[****](docs/default_api.md#) | **POST** /xml_extra |
|
[****](docs/default_api.md#) | **POST** /xml_extra |
|
||||||
[****](docs/default_api.md#) | **POST** /xml_other |
|
[****](docs/default_api.md#) | **POST** /xml_other |
|
||||||
|
@ -86,6 +86,34 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: OK
|
description: OK
|
||||||
|
/responses_with_headers:
|
||||||
|
get:
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
|
description: Success
|
||||||
|
headers:
|
||||||
|
Success-Info:
|
||||||
|
explode: false
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
|
style: simple
|
||||||
|
412:
|
||||||
|
description: Precondition Failed
|
||||||
|
headers:
|
||||||
|
Further-Info:
|
||||||
|
explode: false
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
|
style: simple
|
||||||
|
Failure-Info:
|
||||||
|
explode: false
|
||||||
|
schema:
|
||||||
|
type: String
|
||||||
|
style: simple
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
UuidObject:
|
UuidObject:
|
||||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://localhost*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
****](default_api.md#) | **PUT** /required_octet_stream |
|
****](default_api.md#) | **PUT** /required_octet_stream |
|
||||||
|
****](default_api.md#) | **GET** /responses_with_headers |
|
||||||
****](default_api.md#) | **GET** /uuid |
|
****](default_api.md#) | **GET** /uuid |
|
||||||
****](default_api.md#) | **POST** /xml_extra |
|
****](default_api.md#) | **POST** /xml_extra |
|
||||||
****](default_api.md#) | **POST** /xml_other |
|
****](default_api.md#) | **POST** /xml_other |
|
||||||
@ -38,6 +39,28 @@ No authorization required
|
|||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# ****
|
||||||
|
> String ()
|
||||||
|
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**String**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json,
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# ****
|
# ****
|
||||||
> uuid::Uuid ()
|
> uuid::Uuid ()
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ use tokio_core::reactor;
|
|||||||
use openapi_v3::{ApiNoContext, ContextWrapperExt,
|
use openapi_v3::{ApiNoContext, ContextWrapperExt,
|
||||||
ApiError,
|
ApiError,
|
||||||
RequiredOctetStreamPutResponse,
|
RequiredOctetStreamPutResponse,
|
||||||
|
ResponsesWithHeadersGetResponse,
|
||||||
UuidGetResponse,
|
UuidGetResponse,
|
||||||
XmlExtraPostResponse,
|
XmlExtraPostResponse,
|
||||||
XmlOtherPostResponse,
|
XmlOtherPostResponse,
|
||||||
@ -35,6 +36,7 @@ fn main() {
|
|||||||
.help("Sets the operation to run")
|
.help("Sets the operation to run")
|
||||||
.possible_values(&[
|
.possible_values(&[
|
||||||
"RequiredOctetStreamPut",
|
"RequiredOctetStreamPut",
|
||||||
|
"ResponsesWithHeadersGet",
|
||||||
"UuidGet",
|
"UuidGet",
|
||||||
"XmlExtraPost",
|
"XmlExtraPost",
|
||||||
"XmlOtherPost",
|
"XmlOtherPost",
|
||||||
@ -86,6 +88,11 @@ fn main() {
|
|||||||
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
|
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Some("ResponsesWithHeadersGet") => {
|
||||||
|
let result = core.run(client.responses_with_headers_get());
|
||||||
|
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
|
||||||
|
},
|
||||||
|
|
||||||
Some("UuidGet") => {
|
Some("UuidGet") => {
|
||||||
let result = core.run(client.uuid_get());
|
let result = core.run(client.uuid_get());
|
||||||
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
|
println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
|
||||||
|
@ -12,6 +12,7 @@ use uuid;
|
|||||||
|
|
||||||
use openapi_v3::{Api, ApiError,
|
use openapi_v3::{Api, ApiError,
|
||||||
RequiredOctetStreamPutResponse,
|
RequiredOctetStreamPutResponse,
|
||||||
|
ResponsesWithHeadersGetResponse,
|
||||||
UuidGetResponse,
|
UuidGetResponse,
|
||||||
XmlExtraPostResponse,
|
XmlExtraPostResponse,
|
||||||
XmlOtherPostResponse,
|
XmlOtherPostResponse,
|
||||||
@ -42,6 +43,13 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fn responses_with_headers_get(&self, context: &C) -> Box<Future<Item=ResponsesWithHeadersGetResponse, Error=ApiError>> {
|
||||||
|
let context = context.clone();
|
||||||
|
println!("responses_with_headers_get() - X-Span-ID: {:?}", context.get().0.clone());
|
||||||
|
Box::new(futures::failed("Generic failure".into()))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fn uuid_get(&self, context: &C) -> Box<Future<Item=UuidGetResponse, Error=ApiError>> {
|
fn uuid_get(&self, context: &C) -> Box<Future<Item=UuidGetResponse, Error=ApiError>> {
|
||||||
let context = context.clone();
|
let context = context.clone();
|
||||||
println!("uuid_get() - X-Span-ID: {:?}", context.get().0.clone());
|
println!("uuid_get() - X-Span-ID: {:?}", context.get().0.clone());
|
||||||
|
@ -38,6 +38,7 @@ use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData};
|
|||||||
|
|
||||||
use {Api,
|
use {Api,
|
||||||
RequiredOctetStreamPutResponse,
|
RequiredOctetStreamPutResponse,
|
||||||
|
ResponsesWithHeadersGetResponse,
|
||||||
UuidGetResponse,
|
UuidGetResponse,
|
||||||
XmlExtraPostResponse,
|
XmlExtraPostResponse,
|
||||||
XmlOtherPostResponse,
|
XmlOtherPostResponse,
|
||||||
@ -315,6 +316,108 @@ impl<F, C> Api<C> for Client<F> where
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn responses_with_headers_get(&self, context: &C) -> Box<Future<Item=ResponsesWithHeadersGetResponse, Error=ApiError>> {
|
||||||
|
let mut uri = format!(
|
||||||
|
"{}/responses_with_headers",
|
||||||
|
self.base_path
|
||||||
|
);
|
||||||
|
|
||||||
|
let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned());
|
||||||
|
|
||||||
|
|
||||||
|
let query_string_str = query_string.finish();
|
||||||
|
if !query_string_str.is_empty() {
|
||||||
|
uri += "?";
|
||||||
|
uri += &query_string_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
let uri = match Uri::from_str(&uri) {
|
||||||
|
Ok(uri) => uri,
|
||||||
|
Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))),
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut request = hyper::Request::new(hyper::Method::Get, uri);
|
||||||
|
|
||||||
|
|
||||||
|
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
|
||||||
|
Box::new(self.client_service.call(request)
|
||||||
|
.map_err(|e| ApiError(format!("No response received: {}", e)))
|
||||||
|
.and_then(|mut response| {
|
||||||
|
match response.status().as_u16() {
|
||||||
|
200 => {
|
||||||
|
header! { (ResponseSuccessInfo, "Success-Info") => [String] }
|
||||||
|
let response_success_info = match response.headers().get::<ResponseSuccessInfo>() {
|
||||||
|
Some(response_success_info) => response_success_info.0.clone(),
|
||||||
|
None => return Box::new(future::err(ApiError(String::from("Required response header Success-Info for response 200 was not found.")))) as Box<Future<Item=_, Error=_>>,
|
||||||
|
};
|
||||||
|
let body = response.body();
|
||||||
|
Box::new(
|
||||||
|
body
|
||||||
|
.concat2()
|
||||||
|
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
|
||||||
|
.and_then(|body|
|
||||||
|
|
||||||
|
str::from_utf8(&body)
|
||||||
|
.map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))
|
||||||
|
.and_then(|body|
|
||||||
|
|
||||||
|
serde_json::from_str::<String>(body)
|
||||||
|
.map_err(|e| e.into())
|
||||||
|
)
|
||||||
|
|
||||||
|
)
|
||||||
|
.map(move |body| {
|
||||||
|
ResponsesWithHeadersGetResponse::Success{ body: body, success_info: response_success_info }
|
||||||
|
})
|
||||||
|
) as Box<Future<Item=_, Error=_>>
|
||||||
|
},
|
||||||
|
412 => {
|
||||||
|
header! { (ResponseFurtherInfo, "Further-Info") => [String] }
|
||||||
|
let response_further_info = match response.headers().get::<ResponseFurtherInfo>() {
|
||||||
|
Some(response_further_info) => response_further_info.0.clone(),
|
||||||
|
None => return Box::new(future::err(ApiError(String::from("Required response header Further-Info for response 412 was not found.")))) as Box<Future<Item=_, Error=_>>,
|
||||||
|
};
|
||||||
|
header! { (ResponseFailureInfo, "Failure-Info") => [String] }
|
||||||
|
let response_failure_info = match response.headers().get::<ResponseFailureInfo>() {
|
||||||
|
Some(response_failure_info) => response_failure_info.0.clone(),
|
||||||
|
None => return Box::new(future::err(ApiError(String::from("Required response header Failure-Info for response 412 was not found.")))) as Box<Future<Item=_, Error=_>>,
|
||||||
|
};
|
||||||
|
let body = response.body();
|
||||||
|
Box::new(
|
||||||
|
|
||||||
|
future::ok(
|
||||||
|
ResponsesWithHeadersGetResponse::PreconditionFailed
|
||||||
|
{
|
||||||
|
further_info: response_further_info,
|
||||||
|
failure_info: response_failure_info,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
) as Box<Future<Item=_, Error=_>>
|
||||||
|
},
|
||||||
|
code => {
|
||||||
|
let headers = response.headers().clone();
|
||||||
|
Box::new(response.body()
|
||||||
|
.take(100)
|
||||||
|
.concat2()
|
||||||
|
.then(move |body|
|
||||||
|
future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}",
|
||||||
|
code,
|
||||||
|
headers,
|
||||||
|
match body {
|
||||||
|
Ok(ref body) => match str::from_utf8(body) {
|
||||||
|
Ok(body) => Cow::from(body),
|
||||||
|
Err(e) => Cow::from(format!("<Body was not UTF8: {:?}>", e)),
|
||||||
|
},
|
||||||
|
Err(e) => Cow::from(format!("<Failed to read body: {}>", e)),
|
||||||
|
})))
|
||||||
|
)
|
||||||
|
) as Box<Future<Item=_, Error=_>>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
fn uuid_get(&self, context: &C) -> Box<Future<Item=UuidGetResponse, Error=ApiError>> {
|
fn uuid_get(&self, context: &C) -> Box<Future<Item=UuidGetResponse, Error=ApiError>> {
|
||||||
let mut uri = format!(
|
let mut uri = format!(
|
||||||
"{}/uuid",
|
"{}/uuid",
|
||||||
|
@ -54,53 +54,76 @@ pub const API_VERSION: &'static str = "1.0.7";
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum RequiredOctetStreamPutResponse {
|
pub enum RequiredOctetStreamPutResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
|
pub enum ResponsesWithHeadersGetResponse {
|
||||||
|
/// Success
|
||||||
|
Success
|
||||||
|
{
|
||||||
|
body: String,
|
||||||
|
success_info: String,
|
||||||
|
}
|
||||||
|
,
|
||||||
|
/// Precondition Failed
|
||||||
|
PreconditionFailed
|
||||||
|
{
|
||||||
|
further_info: String,
|
||||||
|
failure_info: String,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum UuidGetResponse {
|
pub enum UuidGetResponse {
|
||||||
/// Duplicate Response long text. One.
|
/// Duplicate Response long text. One.
|
||||||
DuplicateResponseLongText ( uuid::Uuid ) ,
|
DuplicateResponseLongText
|
||||||
|
(uuid::Uuid)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum XmlExtraPostResponse {
|
pub enum XmlExtraPostResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
|
,
|
||||||
/// Bad Request
|
/// Bad Request
|
||||||
BadRequest ,
|
BadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum XmlOtherPostResponse {
|
pub enum XmlOtherPostResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
|
,
|
||||||
/// Bad Request
|
/// Bad Request
|
||||||
BadRequest ,
|
BadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum XmlOtherPutResponse {
|
pub enum XmlOtherPutResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
|
,
|
||||||
/// Bad Request
|
/// Bad Request
|
||||||
BadRequest ,
|
BadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum XmlPostResponse {
|
pub enum XmlPostResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
|
,
|
||||||
/// Bad Request
|
/// Bad Request
|
||||||
BadRequest ,
|
BadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum XmlPutResponse {
|
pub enum XmlPutResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
|
,
|
||||||
/// Bad Request
|
/// Bad Request
|
||||||
BadRequest ,
|
BadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -111,6 +134,9 @@ pub trait Api<C> {
|
|||||||
fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box<Future<Item=RequiredOctetStreamPutResponse, Error=ApiError>>;
|
fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box<Future<Item=RequiredOctetStreamPutResponse, Error=ApiError>>;
|
||||||
|
|
||||||
|
|
||||||
|
fn responses_with_headers_get(&self, context: &C) -> Box<Future<Item=ResponsesWithHeadersGetResponse, Error=ApiError>>;
|
||||||
|
|
||||||
|
|
||||||
fn uuid_get(&self, context: &C) -> Box<Future<Item=UuidGetResponse, Error=ApiError>>;
|
fn uuid_get(&self, context: &C) -> Box<Future<Item=UuidGetResponse, Error=ApiError>>;
|
||||||
|
|
||||||
|
|
||||||
@ -137,6 +163,9 @@ pub trait ApiNoContext {
|
|||||||
fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box<Future<Item=RequiredOctetStreamPutResponse, Error=ApiError>>;
|
fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box<Future<Item=RequiredOctetStreamPutResponse, Error=ApiError>>;
|
||||||
|
|
||||||
|
|
||||||
|
fn responses_with_headers_get(&self) -> Box<Future<Item=ResponsesWithHeadersGetResponse, Error=ApiError>>;
|
||||||
|
|
||||||
|
|
||||||
fn uuid_get(&self) -> Box<Future<Item=UuidGetResponse, Error=ApiError>>;
|
fn uuid_get(&self) -> Box<Future<Item=UuidGetResponse, Error=ApiError>>;
|
||||||
|
|
||||||
|
|
||||||
@ -176,6 +205,11 @@ impl<'a, T: Api<C>, C> ApiNoContext for ContextWrapper<'a, T, C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fn responses_with_headers_get(&self) -> Box<Future<Item=ResponsesWithHeadersGetResponse, Error=ApiError>> {
|
||||||
|
self.api().responses_with_headers_get(&self.context())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fn uuid_get(&self) -> Box<Future<Item=UuidGetResponse, Error=ApiError>> {
|
fn uuid_get(&self) -> Box<Future<Item=UuidGetResponse, Error=ApiError>> {
|
||||||
self.api().uuid_get(&self.context())
|
self.api().uuid_get(&self.context())
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,11 @@ pub mod responses {
|
|||||||
|
|
||||||
// The macro is called per-operation to beat the recursion limit
|
// The macro is called per-operation to beat the recursion limit
|
||||||
|
|
||||||
|
lazy_static! {
|
||||||
|
/// Create Mime objects for the response content types for ResponsesWithHeadersGet
|
||||||
|
pub static ref RESPONSES_WITH_HEADERS_GET_SUCCESS: Mime = "application/json".parse().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
/// Create Mime objects for the response content types for UuidGet
|
/// Create Mime objects for the response content types for UuidGet
|
||||||
pub static ref UUID_GET_DUPLICATE_RESPONSE_LONG_TEXT: Mime = "application/json".parse().unwrap();
|
pub static ref UUID_GET_DUPLICATE_RESPONSE_LONG_TEXT: Mime = "application/json".parse().unwrap();
|
||||||
|
@ -36,6 +36,7 @@ use swagger::auth::Scopes;
|
|||||||
|
|
||||||
use {Api,
|
use {Api,
|
||||||
RequiredOctetStreamPutResponse,
|
RequiredOctetStreamPutResponse,
|
||||||
|
ResponsesWithHeadersGetResponse,
|
||||||
UuidGetResponse,
|
UuidGetResponse,
|
||||||
XmlExtraPostResponse,
|
XmlExtraPostResponse,
|
||||||
XmlOtherPostResponse,
|
XmlOtherPostResponse,
|
||||||
@ -56,6 +57,7 @@ mod paths {
|
|||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![
|
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![
|
||||||
r"^/required_octet_stream$",
|
r"^/required_octet_stream$",
|
||||||
|
r"^/responses_with_headers$",
|
||||||
r"^/uuid$",
|
r"^/uuid$",
|
||||||
r"^/xml$",
|
r"^/xml$",
|
||||||
r"^/xml_extra$",
|
r"^/xml_extra$",
|
||||||
@ -63,10 +65,11 @@ mod paths {
|
|||||||
]).unwrap();
|
]).unwrap();
|
||||||
}
|
}
|
||||||
pub static ID_REQUIRED_OCTET_STREAM: usize = 0;
|
pub static ID_REQUIRED_OCTET_STREAM: usize = 0;
|
||||||
pub static ID_UUID: usize = 1;
|
pub static ID_RESPONSES_WITH_HEADERS: usize = 1;
|
||||||
pub static ID_XML: usize = 2;
|
pub static ID_UUID: usize = 2;
|
||||||
pub static ID_XML_EXTRA: usize = 3;
|
pub static ID_XML: usize = 3;
|
||||||
pub static ID_XML_OTHER: usize = 4;
|
pub static ID_XML_EXTRA: usize = 4;
|
||||||
|
pub static ID_XML_OTHER: usize = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct NewService<T, C> {
|
pub struct NewService<T, C> {
|
||||||
@ -183,6 +186,69 @@ where
|
|||||||
) as Box<Future<Item=Response, Error=Error>>
|
) as Box<Future<Item=Response, Error=Error>>
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ResponsesWithHeadersGet - GET /responses_with_headers
|
||||||
|
&hyper::Method::Get if path.matched(paths::ID_RESPONSES_WITH_HEADERS) => {
|
||||||
|
Box::new({
|
||||||
|
{{
|
||||||
|
Box::new(api_impl.responses_with_headers_get(&context)
|
||||||
|
.then(move |result| {
|
||||||
|
let mut response = Response::new();
|
||||||
|
response.headers_mut().set(XSpanId((&context as &Has<XSpanIdString>).get().0.to_string()));
|
||||||
|
|
||||||
|
match result {
|
||||||
|
Ok(rsp) => match rsp {
|
||||||
|
ResponsesWithHeadersGetResponse::Success
|
||||||
|
|
||||||
|
{
|
||||||
|
body,
|
||||||
|
success_info
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
=> {
|
||||||
|
response.set_status(StatusCode::try_from(200).unwrap());
|
||||||
|
header! { (ResponseSuccessInfo, "Success-Info") => [String] }
|
||||||
|
response.headers_mut().set(ResponseSuccessInfo(success_info));
|
||||||
|
|
||||||
|
response.headers_mut().set(ContentType(mimetypes::responses::RESPONSES_WITH_HEADERS_GET_SUCCESS.clone()));
|
||||||
|
|
||||||
|
|
||||||
|
let body = serde_json::to_string(&body).expect("impossible to fail to serialize");
|
||||||
|
|
||||||
|
response.set_body(body);
|
||||||
|
},
|
||||||
|
ResponsesWithHeadersGetResponse::PreconditionFailed
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
further_info,
|
||||||
|
failure_info
|
||||||
|
}
|
||||||
|
|
||||||
|
=> {
|
||||||
|
response.set_status(StatusCode::try_from(412).unwrap());
|
||||||
|
header! { (ResponseFurtherInfo, "Further-Info") => [String] }
|
||||||
|
response.headers_mut().set(ResponseFurtherInfo(further_info));
|
||||||
|
header! { (ResponseFailureInfo, "Failure-Info") => [String] }
|
||||||
|
response.headers_mut().set(ResponseFailureInfo(failure_info));
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Err(_) => {
|
||||||
|
// Application code returned an error. This should not happen, as the implementation should
|
||||||
|
// return a valid response.
|
||||||
|
response.set_status(StatusCode::InternalServerError);
|
||||||
|
response.set_body("An internal error occurred");
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
future::ok(response)
|
||||||
|
}
|
||||||
|
))
|
||||||
|
}}
|
||||||
|
}) as Box<Future<Item=Response, Error=Error>>
|
||||||
|
},
|
||||||
|
|
||||||
// UuidGet - GET /uuid
|
// UuidGet - GET /uuid
|
||||||
&hyper::Method::Get if path.matched(paths::ID_UUID) => {
|
&hyper::Method::Get if path.matched(paths::ID_UUID) => {
|
||||||
Box::new({
|
Box::new({
|
||||||
@ -581,6 +647,9 @@ impl RequestParser for ApiRequestParser {
|
|||||||
// RequiredOctetStreamPut - PUT /required_octet_stream
|
// RequiredOctetStreamPut - PUT /required_octet_stream
|
||||||
&hyper::Method::Put if path.matched(paths::ID_REQUIRED_OCTET_STREAM) => Ok("RequiredOctetStreamPut"),
|
&hyper::Method::Put if path.matched(paths::ID_REQUIRED_OCTET_STREAM) => Ok("RequiredOctetStreamPut"),
|
||||||
|
|
||||||
|
// ResponsesWithHeadersGet - GET /responses_with_headers
|
||||||
|
&hyper::Method::Get if path.matched(paths::ID_RESPONSES_WITH_HEADERS) => Ok("ResponsesWithHeadersGet"),
|
||||||
|
|
||||||
// UuidGet - GET /uuid
|
// UuidGet - GET /uuid
|
||||||
&hyper::Method::Get if path.matched(paths::ID_UUID) => Ok("UuidGet"),
|
&hyper::Method::Get if path.matched(paths::ID_UUID) => Ok("UuidGet"),
|
||||||
|
|
||||||
|
@ -53,223 +53,223 @@ pub const API_VERSION: &'static str = "0.0.1";
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op10GetResponse {
|
pub enum Op10GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op11GetResponse {
|
pub enum Op11GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op12GetResponse {
|
pub enum Op12GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op13GetResponse {
|
pub enum Op13GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op14GetResponse {
|
pub enum Op14GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op15GetResponse {
|
pub enum Op15GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op16GetResponse {
|
pub enum Op16GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op17GetResponse {
|
pub enum Op17GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op18GetResponse {
|
pub enum Op18GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op19GetResponse {
|
pub enum Op19GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op1GetResponse {
|
pub enum Op1GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op20GetResponse {
|
pub enum Op20GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op21GetResponse {
|
pub enum Op21GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op22GetResponse {
|
pub enum Op22GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op23GetResponse {
|
pub enum Op23GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op24GetResponse {
|
pub enum Op24GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op25GetResponse {
|
pub enum Op25GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op26GetResponse {
|
pub enum Op26GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op27GetResponse {
|
pub enum Op27GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op28GetResponse {
|
pub enum Op28GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op29GetResponse {
|
pub enum Op29GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op2GetResponse {
|
pub enum Op2GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op30GetResponse {
|
pub enum Op30GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op31GetResponse {
|
pub enum Op31GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op32GetResponse {
|
pub enum Op32GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op33GetResponse {
|
pub enum Op33GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op34GetResponse {
|
pub enum Op34GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op35GetResponse {
|
pub enum Op35GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op36GetResponse {
|
pub enum Op36GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op37GetResponse {
|
pub enum Op37GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op3GetResponse {
|
pub enum Op3GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op4GetResponse {
|
pub enum Op4GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op5GetResponse {
|
pub enum Op5GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op6GetResponse {
|
pub enum Op6GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op7GetResponse {
|
pub enum Op7GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op8GetResponse {
|
pub enum Op8GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Op9GetResponse {
|
pub enum Op9GetResponse {
|
||||||
/// OK
|
/// OK
|
||||||
OK ,
|
OK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,227 +54,264 @@ pub const API_VERSION: &'static str = "1.0.0";
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestSpecialTagsResponse {
|
pub enum TestSpecialTagsResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::Client ) ,
|
SuccessfulOperation
|
||||||
|
(models::Client)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum FakeOuterBooleanSerializeResponse {
|
pub enum FakeOuterBooleanSerializeResponse {
|
||||||
/// Output boolean
|
/// Output boolean
|
||||||
OutputBoolean ( bool ) ,
|
OutputBoolean
|
||||||
|
(bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum FakeOuterCompositeSerializeResponse {
|
pub enum FakeOuterCompositeSerializeResponse {
|
||||||
/// Output composite
|
/// Output composite
|
||||||
OutputComposite ( models::OuterComposite ) ,
|
OutputComposite
|
||||||
|
(models::OuterComposite)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum FakeOuterNumberSerializeResponse {
|
pub enum FakeOuterNumberSerializeResponse {
|
||||||
/// Output number
|
/// Output number
|
||||||
OutputNumber ( f64 ) ,
|
OutputNumber
|
||||||
|
(f64)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum FakeOuterStringSerializeResponse {
|
pub enum FakeOuterStringSerializeResponse {
|
||||||
/// Output string
|
/// Output string
|
||||||
OutputString ( String ) ,
|
OutputString
|
||||||
|
(String)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestBodyWithQueryParamsResponse {
|
pub enum TestBodyWithQueryParamsResponse {
|
||||||
/// Success
|
/// Success
|
||||||
Success ,
|
Success
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestClientModelResponse {
|
pub enum TestClientModelResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::Client ) ,
|
SuccessfulOperation
|
||||||
|
(models::Client)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestEndpointParametersResponse {
|
pub enum TestEndpointParametersResponse {
|
||||||
/// Invalid username supplied
|
/// Invalid username supplied
|
||||||
InvalidUsernameSupplied ,
|
InvalidUsernameSupplied
|
||||||
|
,
|
||||||
/// User not found
|
/// User not found
|
||||||
UserNotFound ,
|
UserNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestEnumParametersResponse {
|
pub enum TestEnumParametersResponse {
|
||||||
/// Invalid request
|
/// Invalid request
|
||||||
InvalidRequest ,
|
InvalidRequest
|
||||||
|
,
|
||||||
/// Not found
|
/// Not found
|
||||||
NotFound ,
|
NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestInlineAdditionalPropertiesResponse {
|
pub enum TestInlineAdditionalPropertiesResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ,
|
SuccessfulOperation
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestJsonFormDataResponse {
|
pub enum TestJsonFormDataResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ,
|
SuccessfulOperation
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum TestClassnameResponse {
|
pub enum TestClassnameResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::Client ) ,
|
SuccessfulOperation
|
||||||
|
(models::Client)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum AddPetResponse {
|
pub enum AddPetResponse {
|
||||||
/// Invalid input
|
/// Invalid input
|
||||||
InvalidInput ,
|
InvalidInput
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum DeletePetResponse {
|
pub enum DeletePetResponse {
|
||||||
/// Invalid pet value
|
/// Invalid pet value
|
||||||
InvalidPetValue ,
|
InvalidPetValue
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum FindPetsByStatusResponse {
|
pub enum FindPetsByStatusResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( Vec<models::Pet> ) ,
|
SuccessfulOperation
|
||||||
|
(Vec<models::Pet>)
|
||||||
|
,
|
||||||
/// Invalid status value
|
/// Invalid status value
|
||||||
InvalidStatusValue ,
|
InvalidStatusValue
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum FindPetsByTagsResponse {
|
pub enum FindPetsByTagsResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( Vec<models::Pet> ) ,
|
SuccessfulOperation
|
||||||
|
(Vec<models::Pet>)
|
||||||
|
,
|
||||||
/// Invalid tag value
|
/// Invalid tag value
|
||||||
InvalidTagValue ,
|
InvalidTagValue
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum GetPetByIdResponse {
|
pub enum GetPetByIdResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::Pet ) ,
|
SuccessfulOperation
|
||||||
|
(models::Pet)
|
||||||
|
,
|
||||||
/// Invalid ID supplied
|
/// Invalid ID supplied
|
||||||
InvalidIDSupplied ,
|
InvalidIDSupplied
|
||||||
|
,
|
||||||
/// Pet not found
|
/// Pet not found
|
||||||
PetNotFound ,
|
PetNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum UpdatePetResponse {
|
pub enum UpdatePetResponse {
|
||||||
/// Invalid ID supplied
|
/// Invalid ID supplied
|
||||||
InvalidIDSupplied ,
|
InvalidIDSupplied
|
||||||
|
,
|
||||||
/// Pet not found
|
/// Pet not found
|
||||||
PetNotFound ,
|
PetNotFound
|
||||||
|
,
|
||||||
/// Validation exception
|
/// Validation exception
|
||||||
ValidationException ,
|
ValidationException
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum UpdatePetWithFormResponse {
|
pub enum UpdatePetWithFormResponse {
|
||||||
/// Invalid input
|
/// Invalid input
|
||||||
InvalidInput ,
|
InvalidInput
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum UploadFileResponse {
|
pub enum UploadFileResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::ApiResponse ) ,
|
SuccessfulOperation
|
||||||
|
(models::ApiResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum DeleteOrderResponse {
|
pub enum DeleteOrderResponse {
|
||||||
/// Invalid ID supplied
|
/// Invalid ID supplied
|
||||||
InvalidIDSupplied ,
|
InvalidIDSupplied
|
||||||
|
,
|
||||||
/// Order not found
|
/// Order not found
|
||||||
OrderNotFound ,
|
OrderNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum GetInventoryResponse {
|
pub enum GetInventoryResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( HashMap<String, i32> ) ,
|
SuccessfulOperation
|
||||||
|
(HashMap<String, i32>)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum GetOrderByIdResponse {
|
pub enum GetOrderByIdResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::Order ) ,
|
SuccessfulOperation
|
||||||
|
(models::Order)
|
||||||
|
,
|
||||||
/// Invalid ID supplied
|
/// Invalid ID supplied
|
||||||
InvalidIDSupplied ,
|
InvalidIDSupplied
|
||||||
|
,
|
||||||
/// Order not found
|
/// Order not found
|
||||||
OrderNotFound ,
|
OrderNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum PlaceOrderResponse {
|
pub enum PlaceOrderResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::Order ) ,
|
SuccessfulOperation
|
||||||
|
(models::Order)
|
||||||
|
,
|
||||||
/// Invalid Order
|
/// Invalid Order
|
||||||
InvalidOrder ,
|
InvalidOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum CreateUserResponse {
|
pub enum CreateUserResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ,
|
SuccessfulOperation
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum CreateUsersWithArrayInputResponse {
|
pub enum CreateUsersWithArrayInputResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ,
|
SuccessfulOperation
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum CreateUsersWithListInputResponse {
|
pub enum CreateUsersWithListInputResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ,
|
SuccessfulOperation
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum DeleteUserResponse {
|
pub enum DeleteUserResponse {
|
||||||
/// Invalid username supplied
|
/// Invalid username supplied
|
||||||
InvalidUsernameSupplied ,
|
InvalidUsernameSupplied
|
||||||
|
,
|
||||||
/// User not found
|
/// User not found
|
||||||
UserNotFound ,
|
UserNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum GetUserByNameResponse {
|
pub enum GetUserByNameResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ( models::User ) ,
|
SuccessfulOperation
|
||||||
|
(models::User)
|
||||||
|
,
|
||||||
/// Invalid username supplied
|
/// Invalid username supplied
|
||||||
InvalidUsernameSupplied ,
|
InvalidUsernameSupplied
|
||||||
|
,
|
||||||
/// User not found
|
/// User not found
|
||||||
UserNotFound ,
|
UserNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum LoginUserResponse {
|
pub enum LoginUserResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation { body: String, x_rate_limit: i32, x_expires_after: chrono::DateTime<chrono::Utc> } ,
|
SuccessfulOperation
|
||||||
|
{
|
||||||
|
body: String,
|
||||||
|
x_rate_limit: i32,
|
||||||
|
x_expires_after: chrono::DateTime<chrono::Utc>,
|
||||||
|
}
|
||||||
|
,
|
||||||
/// Invalid username/password supplied
|
/// Invalid username/password supplied
|
||||||
InvalidUsername ,
|
InvalidUsername
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum LogoutUserResponse {
|
pub enum LogoutUserResponse {
|
||||||
/// successful operation
|
/// successful operation
|
||||||
SuccessfulOperation ,
|
SuccessfulOperation
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum UpdateUserResponse {
|
pub enum UpdateUserResponse {
|
||||||
/// Invalid user supplied
|
/// Invalid user supplied
|
||||||
InvalidUserSupplied ,
|
InvalidUserSupplied
|
||||||
|
,
|
||||||
/// User not found
|
/// User not found
|
||||||
UserNotFound ,
|
UserNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,31 +53,34 @@ pub const API_VERSION: &'static str = "2.3.4";
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum DummyGetResponse {
|
pub enum DummyGetResponse {
|
||||||
/// Success
|
/// Success
|
||||||
Success ,
|
Success
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum DummyPutResponse {
|
pub enum DummyPutResponse {
|
||||||
/// Success
|
/// Success
|
||||||
Success ,
|
Success
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum FileResponseGetResponse {
|
pub enum FileResponseGetResponse {
|
||||||
/// Success
|
/// Success
|
||||||
Success ( swagger::ByteArray ) ,
|
Success
|
||||||
|
(swagger::ByteArray)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum HtmlPostResponse {
|
pub enum HtmlPostResponse {
|
||||||
/// Success
|
/// Success
|
||||||
Success ( String ) ,
|
Success
|
||||||
|
(String)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum RawJsonGetResponse {
|
pub enum RawJsonGetResponse {
|
||||||
/// Success
|
/// Success
|
||||||
Success ( serde_json::Value ) ,
|
Success
|
||||||
|
(serde_json::Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user