mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[Rust Server] Sort operations so that the ones with fewest params come first (#19368)
* [Rust Server] Sort operations so that the ones with fewest params come first This resolves things correctly per https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#pathsObject - "When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts." * Update samples * [Rust Server] Fix tabs vs spaces --------- Co-authored-by: Rob Day <Robert.Day@metaswitch.com>
This commit is contained in:
parent
fd62e3897b
commit
df2b4210c9
@ -31,6 +31,7 @@ import io.swagger.v3.oas.models.servers.Server;
|
||||
import joptsimple.internal.Strings;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
@ -803,6 +804,15 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
postProcessOperationWithModels(op, allModels);
|
||||
}
|
||||
|
||||
operationList.sort((one, another) -> {
|
||||
int params_compare = ObjectUtils.compare(one.pathParams.size(), another.pathParams.size());
|
||||
if (params_compare == 0) {
|
||||
return ObjectUtils.compare(one.operationId, another.operationId);
|
||||
} else {
|
||||
return params_compare;
|
||||
}
|
||||
});
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,6 @@ Method | HTTP request | Description
|
||||
[****](docs/default_api.md#) | **GET** /any-of |
|
||||
[****](docs/default_api.md#) | **POST** /callback-with-header |
|
||||
[****](docs/default_api.md#) | **GET** /complex-query-param |
|
||||
[****](docs/default_api.md#) | **GET** /enum_in_path/{path_param} |
|
||||
[****](docs/default_api.md#) | **GET** /json-complex-query-param |
|
||||
[****](docs/default_api.md#) | **GET** /mandatory-request-header |
|
||||
[****](docs/default_api.md#) | **GET** /merge-patch-json |
|
||||
@ -143,6 +142,7 @@ Method | HTTP request | Description
|
||||
[****](docs/default_api.md#) | **PUT** /xml_other |
|
||||
[****](docs/default_api.md#) | **POST** /xml | Post an array
|
||||
[****](docs/default_api.md#) | **PUT** /xml |
|
||||
[****](docs/default_api.md#) | **GET** /enum_in_path/{path_param} |
|
||||
[**CreateRepo**](docs/repo_api.md#CreateRepo) | **POST** /repos |
|
||||
[**GetRepoInfo**](docs/repo_api.md#GetRepoInfo) | **GET** /repos/{repoId} |
|
||||
|
||||
|
@ -7,7 +7,6 @@ Method | HTTP request | Description
|
||||
****](default_api.md#) | **GET** /any-of |
|
||||
****](default_api.md#) | **POST** /callback-with-header |
|
||||
****](default_api.md#) | **GET** /complex-query-param |
|
||||
****](default_api.md#) | **GET** /enum_in_path/{path_param} |
|
||||
****](default_api.md#) | **GET** /json-complex-query-param |
|
||||
****](default_api.md#) | **GET** /mandatory-request-header |
|
||||
****](default_api.md#) | **GET** /merge-patch-json |
|
||||
@ -28,6 +27,7 @@ Method | HTTP request | Description
|
||||
****](default_api.md#) | **PUT** /xml_other |
|
||||
****](default_api.md#) | **POST** /xml | Post an array
|
||||
****](default_api.md#) | **PUT** /xml |
|
||||
****](default_api.md#) | **GET** /enum_in_path/{path_param} |
|
||||
|
||||
|
||||
# ****
|
||||
@ -119,31 +119,6 @@ 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)
|
||||
|
||||
# ****
|
||||
> (path_param)
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**path_param** | [****](.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# ****
|
||||
> (optional)
|
||||
|
||||
@ -677,3 +652,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)
|
||||
|
||||
# ****
|
||||
> (path_param)
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**path_param** | [****](.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
|
@ -9,7 +9,6 @@ use openapi_v3::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models,
|
||||
AnyOfGetResponse,
|
||||
CallbackWithHeaderPostResponse,
|
||||
ComplexQueryParamGetResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
JsonComplexQueryParamGetResponse,
|
||||
MandatoryRequestHeaderGetResponse,
|
||||
MergePatchJsonGetResponse,
|
||||
@ -30,6 +29,7 @@ use openapi_v3::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models,
|
||||
XmlOtherPutResponse,
|
||||
XmlPostResponse,
|
||||
XmlPutResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
CreateRepoResponse,
|
||||
GetRepoInfoResponse,
|
||||
};
|
||||
@ -177,14 +177,6 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("EnumInPathPathParamGet") => {
|
||||
let result = rt.block_on(client.enum_in_path_path_param_get(
|
||||
???
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
*/
|
||||
Some("JsonComplexQueryParamGet") => {
|
||||
let result = rt.block_on(client.json_complex_query_param_get(
|
||||
Some(&Vec::new())
|
||||
@ -298,6 +290,14 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("EnumInPathPathParamGet") => {
|
||||
let result = rt.block_on(client.enum_in_path_path_param_get(
|
||||
???
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
*/
|
||||
Some("CreateRepo") => {
|
||||
let result = rt.block_on(client.create_repo(
|
||||
serde_json::from_str::<models::ObjectParam>(r#"{"requiredParam":true}"#).expect("Failed to parse JSON example")
|
||||
|
@ -105,7 +105,6 @@ use openapi_v3::{
|
||||
AnyOfGetResponse,
|
||||
CallbackWithHeaderPostResponse,
|
||||
ComplexQueryParamGetResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
JsonComplexQueryParamGetResponse,
|
||||
MandatoryRequestHeaderGetResponse,
|
||||
MergePatchJsonGetResponse,
|
||||
@ -126,6 +125,7 @@ use openapi_v3::{
|
||||
XmlOtherPutResponse,
|
||||
XmlPostResponse,
|
||||
XmlPutResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
CreateRepoResponse,
|
||||
GetRepoInfoResponse,
|
||||
};
|
||||
@ -163,15 +163,6 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
context: &C) -> Result<EnumInPathPathParamGetResponse, ApiError>
|
||||
{
|
||||
info!("enum_in_path_path_param_get({:?}) - X-Span-ID: {:?}", path_param, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
async fn json_complex_query_param_get(
|
||||
&self,
|
||||
list_of_strings: Option<&Vec<models::StringObject>>,
|
||||
@ -348,6 +339,15 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
context: &C) -> Result<EnumInPathPathParamGetResponse, ApiError>
|
||||
{
|
||||
info!("enum_in_path_path_param_get({:?}) - X-Span-ID: {:?}", path_param, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
async fn create_repo(
|
||||
&self,
|
||||
object_param: models::ObjectParam,
|
||||
|
@ -39,7 +39,6 @@ use crate::{Api,
|
||||
AnyOfGetResponse,
|
||||
CallbackWithHeaderPostResponse,
|
||||
ComplexQueryParamGetResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
JsonComplexQueryParamGetResponse,
|
||||
MandatoryRequestHeaderGetResponse,
|
||||
MergePatchJsonGetResponse,
|
||||
@ -60,6 +59,7 @@ use crate::{Api,
|
||||
XmlOtherPutResponse,
|
||||
XmlPostResponse,
|
||||
XmlPutResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
CreateRepoResponse,
|
||||
GetRepoInfoResponse
|
||||
};
|
||||
@ -667,76 +667,6 @@ impl<S, C> Api<C> for Client<S, C> where
|
||||
}
|
||||
}
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
param_path_param: models::StringEnum,
|
||||
context: &C) -> Result<EnumInPathPathParamGetResponse, ApiError>
|
||||
{
|
||||
let mut client_service = self.client_service.clone();
|
||||
let mut uri = format!(
|
||||
"{}/enum_in_path/{path_param}",
|
||||
self.base_path
|
||||
,path_param=utf8_percent_encode(¶m_path_param.to_string(), ID_ENCODE_SET)
|
||||
);
|
||||
|
||||
// Query parameters
|
||||
let query_string = {
|
||||
let mut query_string = form_urlencoded::Serializer::new("".to_owned());
|
||||
query_string.finish()
|
||||
};
|
||||
if !query_string.is_empty() {
|
||||
uri += "?";
|
||||
uri += &query_string;
|
||||
}
|
||||
|
||||
let uri = match Uri::from_str(&uri) {
|
||||
Ok(uri) => uri,
|
||||
Err(err) => return Err(ApiError(format!("Unable to build URI: {}", err))),
|
||||
};
|
||||
|
||||
let mut request = match Request::builder()
|
||||
.method("GET")
|
||||
.uri(uri)
|
||||
.body(Body::empty()) {
|
||||
Ok(req) => req,
|
||||
Err(e) => return Err(ApiError(format!("Unable to create request: {}", e)))
|
||||
};
|
||||
|
||||
let header = HeaderValue::from_str(Has::<XSpanIdString>::get(context).0.as_str());
|
||||
request.headers_mut().insert(HeaderName::from_static("x-span-id"), match header {
|
||||
Ok(h) => h,
|
||||
Err(e) => return Err(ApiError(format!("Unable to create X-Span ID header value: {}", e)))
|
||||
});
|
||||
|
||||
let response = client_service.call((request, context.clone()))
|
||||
.map_err(|e| ApiError(format!("No response received: {}", e))).await?;
|
||||
|
||||
match response.status().as_u16() {
|
||||
200 => {
|
||||
Ok(
|
||||
EnumInPathPathParamGetResponse::Success
|
||||
)
|
||||
}
|
||||
code => {
|
||||
let headers = response.headers().clone();
|
||||
let body = response.into_body()
|
||||
.take(100)
|
||||
.into_raw().await;
|
||||
Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}",
|
||||
code,
|
||||
headers,
|
||||
match body {
|
||||
Ok(body) => match String::from_utf8(body) {
|
||||
Ok(body) => body,
|
||||
Err(e) => format!("<Body was not UTF8: {:?}>", e),
|
||||
},
|
||||
Err(e) => format!("<Failed to read body: {}>", e),
|
||||
}
|
||||
)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn json_complex_query_param_get(
|
||||
&self,
|
||||
param_list_of_strings: Option<&Vec<models::StringObject>>,
|
||||
@ -2597,6 +2527,76 @@ impl<S, C> Api<C> for Client<S, C> where
|
||||
}
|
||||
}
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
param_path_param: models::StringEnum,
|
||||
context: &C) -> Result<EnumInPathPathParamGetResponse, ApiError>
|
||||
{
|
||||
let mut client_service = self.client_service.clone();
|
||||
let mut uri = format!(
|
||||
"{}/enum_in_path/{path_param}",
|
||||
self.base_path
|
||||
,path_param=utf8_percent_encode(¶m_path_param.to_string(), ID_ENCODE_SET)
|
||||
);
|
||||
|
||||
// Query parameters
|
||||
let query_string = {
|
||||
let mut query_string = form_urlencoded::Serializer::new("".to_owned());
|
||||
query_string.finish()
|
||||
};
|
||||
if !query_string.is_empty() {
|
||||
uri += "?";
|
||||
uri += &query_string;
|
||||
}
|
||||
|
||||
let uri = match Uri::from_str(&uri) {
|
||||
Ok(uri) => uri,
|
||||
Err(err) => return Err(ApiError(format!("Unable to build URI: {}", err))),
|
||||
};
|
||||
|
||||
let mut request = match Request::builder()
|
||||
.method("GET")
|
||||
.uri(uri)
|
||||
.body(Body::empty()) {
|
||||
Ok(req) => req,
|
||||
Err(e) => return Err(ApiError(format!("Unable to create request: {}", e)))
|
||||
};
|
||||
|
||||
let header = HeaderValue::from_str(Has::<XSpanIdString>::get(context).0.as_str());
|
||||
request.headers_mut().insert(HeaderName::from_static("x-span-id"), match header {
|
||||
Ok(h) => h,
|
||||
Err(e) => return Err(ApiError(format!("Unable to create X-Span ID header value: {}", e)))
|
||||
});
|
||||
|
||||
let response = client_service.call((request, context.clone()))
|
||||
.map_err(|e| ApiError(format!("No response received: {}", e))).await?;
|
||||
|
||||
match response.status().as_u16() {
|
||||
200 => {
|
||||
Ok(
|
||||
EnumInPathPathParamGetResponse::Success
|
||||
)
|
||||
}
|
||||
code => {
|
||||
let headers = response.headers().clone();
|
||||
let body = response.into_body()
|
||||
.take(100)
|
||||
.into_raw().await;
|
||||
Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}",
|
||||
code,
|
||||
headers,
|
||||
match body {
|
||||
Ok(body) => match String::from_utf8(body) {
|
||||
Ok(body) => body,
|
||||
Err(e) => format!("<Body was not UTF8: {:?}>", e),
|
||||
},
|
||||
Err(e) => format!("<Failed to read body: {}>", e),
|
||||
}
|
||||
)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn create_repo(
|
||||
&self,
|
||||
param_object_param: models::ObjectParam,
|
||||
|
@ -48,12 +48,6 @@ pub enum ComplexQueryParamGetResponse {
|
||||
Success
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum EnumInPathPathParamGetResponse {
|
||||
/// Success
|
||||
Success
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum JsonComplexQueryParamGetResponse {
|
||||
/// Success
|
||||
@ -265,6 +259,12 @@ pub enum XmlPutResponse {
|
||||
BadRequest
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum EnumInPathPathParamGetResponse {
|
||||
/// Success
|
||||
Success
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum CreateRepoResponse {
|
||||
/// Success
|
||||
@ -301,11 +301,6 @@ pub trait Api<C: Send + Sync> {
|
||||
list_of_strings: Option<&Vec<models::StringObject>>,
|
||||
context: &C) -> Result<ComplexQueryParamGetResponse, ApiError>;
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
context: &C) -> Result<EnumInPathPathParamGetResponse, ApiError>;
|
||||
|
||||
async fn json_complex_query_param_get(
|
||||
&self,
|
||||
list_of_strings: Option<&Vec<models::StringObject>>,
|
||||
@ -402,6 +397,11 @@ pub trait Api<C: Send + Sync> {
|
||||
xml_object: Option<models::XmlObject>,
|
||||
context: &C) -> Result<XmlPutResponse, ApiError>;
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
context: &C) -> Result<EnumInPathPathParamGetResponse, ApiError>;
|
||||
|
||||
async fn create_repo(
|
||||
&self,
|
||||
object_param: models::ObjectParam,
|
||||
@ -438,11 +438,6 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
list_of_strings: Option<&Vec<models::StringObject>>,
|
||||
) -> Result<ComplexQueryParamGetResponse, ApiError>;
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
) -> Result<EnumInPathPathParamGetResponse, ApiError>;
|
||||
|
||||
async fn json_complex_query_param_get(
|
||||
&self,
|
||||
list_of_strings: Option<&Vec<models::StringObject>>,
|
||||
@ -539,6 +534,11 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
xml_object: Option<models::XmlObject>,
|
||||
) -> Result<XmlPutResponse, ApiError>;
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
) -> Result<EnumInPathPathParamGetResponse, ApiError>;
|
||||
|
||||
async fn create_repo(
|
||||
&self,
|
||||
object_param: models::ObjectParam,
|
||||
@ -601,15 +601,6 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().complex_query_param_get(list_of_strings, &context).await
|
||||
}
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
) -> Result<EnumInPathPathParamGetResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().enum_in_path_path_param_get(path_param, &context).await
|
||||
}
|
||||
|
||||
async fn json_complex_query_param_get(
|
||||
&self,
|
||||
list_of_strings: Option<&Vec<models::StringObject>>,
|
||||
@ -786,6 +777,15 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().xml_put(xml_object, &context).await
|
||||
}
|
||||
|
||||
async fn enum_in_path_path_param_get(
|
||||
&self,
|
||||
path_param: models::StringEnum,
|
||||
) -> Result<EnumInPathPathParamGetResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().enum_in_path_path_param_get(path_param, &context).await
|
||||
}
|
||||
|
||||
async fn create_repo(
|
||||
&self,
|
||||
object_param: models::ObjectParam,
|
||||
|
@ -24,7 +24,6 @@ use crate::{Api,
|
||||
AnyOfGetResponse,
|
||||
CallbackWithHeaderPostResponse,
|
||||
ComplexQueryParamGetResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
JsonComplexQueryParamGetResponse,
|
||||
MandatoryRequestHeaderGetResponse,
|
||||
MergePatchJsonGetResponse,
|
||||
@ -45,6 +44,7 @@ use crate::{Api,
|
||||
XmlOtherPutResponse,
|
||||
XmlPostResponse,
|
||||
XmlPutResponse,
|
||||
EnumInPathPathParamGetResponse,
|
||||
CreateRepoResponse,
|
||||
GetRepoInfoResponse
|
||||
};
|
||||
@ -406,60 +406,6 @@ impl<T, C> hyper::service::Service<(Request<Body>, C)> for Service<T, C> where
|
||||
Ok(response)
|
||||
},
|
||||
|
||||
// EnumInPathPathParamGet - GET /enum_in_path/{path_param}
|
||||
hyper::Method::GET if path.matched(paths::ID_ENUM_IN_PATH_PATH_PARAM) => {
|
||||
// Path parameters
|
||||
let path: &str = uri.path();
|
||||
let path_params =
|
||||
paths::REGEX_ENUM_IN_PATH_PATH_PARAM
|
||||
.captures(path)
|
||||
.unwrap_or_else(||
|
||||
panic!("Path {} matched RE ENUM_IN_PATH_PATH_PARAM in set but failed match against \"{}\"", path, paths::REGEX_ENUM_IN_PATH_PATH_PARAM.as_str())
|
||||
);
|
||||
|
||||
let param_path_param = match percent_encoding::percent_decode(path_params["path_param"].as_bytes()).decode_utf8() {
|
||||
Ok(param_path_param) => match param_path_param.parse::<models::StringEnum>() {
|
||||
Ok(param_path_param) => param_path_param,
|
||||
Err(e) => return Ok(Response::builder()
|
||||
.status(StatusCode::BAD_REQUEST)
|
||||
.body(Body::from(format!("Couldn't parse path parameter path_param: {}", e)))
|
||||
.expect("Unable to create Bad Request response for invalid path parameter")),
|
||||
},
|
||||
Err(_) => return Ok(Response::builder()
|
||||
.status(StatusCode::BAD_REQUEST)
|
||||
.body(Body::from(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["path_param"])))
|
||||
.expect("Unable to create Bad Request response for invalid percent decode"))
|
||||
};
|
||||
|
||||
let result = api_impl.enum_in_path_path_param_get(
|
||||
param_path_param,
|
||||
&context
|
||||
).await;
|
||||
let mut response = Response::new(Body::empty());
|
||||
response.headers_mut().insert(
|
||||
HeaderName::from_static("x-span-id"),
|
||||
HeaderValue::from_str((&context as &dyn Has<XSpanIdString>).get().0.clone().as_str())
|
||||
.expect("Unable to create X-Span-ID header value"));
|
||||
|
||||
match result {
|
||||
Ok(rsp) => match rsp {
|
||||
EnumInPathPathParamGetResponse::Success
|
||||
=> {
|
||||
*response.status_mut() = StatusCode::from_u16(200).expect("Unable to turn 200 into a StatusCode");
|
||||
|
||||
},
|
||||
},
|
||||
Err(_) => {
|
||||
// Application code returned an error. This should not happen, as the implementation should
|
||||
// return a valid response.
|
||||
*response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
|
||||
*response.body_mut() = Body::from("An internal error occurred");
|
||||
},
|
||||
}
|
||||
|
||||
Ok(response)
|
||||
},
|
||||
|
||||
// JsonComplexQueryParamGet - GET /json-complex-query-param
|
||||
hyper::Method::GET if path.matched(paths::ID_JSON_COMPLEX_QUERY_PARAM) => {
|
||||
// Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response)
|
||||
@ -1774,6 +1720,60 @@ impl<T, C> hyper::service::Service<(Request<Body>, C)> for Service<T, C> where
|
||||
}
|
||||
},
|
||||
|
||||
// EnumInPathPathParamGet - GET /enum_in_path/{path_param}
|
||||
hyper::Method::GET if path.matched(paths::ID_ENUM_IN_PATH_PATH_PARAM) => {
|
||||
// Path parameters
|
||||
let path: &str = uri.path();
|
||||
let path_params =
|
||||
paths::REGEX_ENUM_IN_PATH_PATH_PARAM
|
||||
.captures(path)
|
||||
.unwrap_or_else(||
|
||||
panic!("Path {} matched RE ENUM_IN_PATH_PATH_PARAM in set but failed match against \"{}\"", path, paths::REGEX_ENUM_IN_PATH_PATH_PARAM.as_str())
|
||||
);
|
||||
|
||||
let param_path_param = match percent_encoding::percent_decode(path_params["path_param"].as_bytes()).decode_utf8() {
|
||||
Ok(param_path_param) => match param_path_param.parse::<models::StringEnum>() {
|
||||
Ok(param_path_param) => param_path_param,
|
||||
Err(e) => return Ok(Response::builder()
|
||||
.status(StatusCode::BAD_REQUEST)
|
||||
.body(Body::from(format!("Couldn't parse path parameter path_param: {}", e)))
|
||||
.expect("Unable to create Bad Request response for invalid path parameter")),
|
||||
},
|
||||
Err(_) => return Ok(Response::builder()
|
||||
.status(StatusCode::BAD_REQUEST)
|
||||
.body(Body::from(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["path_param"])))
|
||||
.expect("Unable to create Bad Request response for invalid percent decode"))
|
||||
};
|
||||
|
||||
let result = api_impl.enum_in_path_path_param_get(
|
||||
param_path_param,
|
||||
&context
|
||||
).await;
|
||||
let mut response = Response::new(Body::empty());
|
||||
response.headers_mut().insert(
|
||||
HeaderName::from_static("x-span-id"),
|
||||
HeaderValue::from_str((&context as &dyn Has<XSpanIdString>).get().0.clone().as_str())
|
||||
.expect("Unable to create X-Span-ID header value"));
|
||||
|
||||
match result {
|
||||
Ok(rsp) => match rsp {
|
||||
EnumInPathPathParamGetResponse::Success
|
||||
=> {
|
||||
*response.status_mut() = StatusCode::from_u16(200).expect("Unable to turn 200 into a StatusCode");
|
||||
|
||||
},
|
||||
},
|
||||
Err(_) => {
|
||||
// Application code returned an error. This should not happen, as the implementation should
|
||||
// return a valid response.
|
||||
*response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
|
||||
*response.body_mut() = Body::from("An internal error occurred");
|
||||
},
|
||||
}
|
||||
|
||||
Ok(response)
|
||||
},
|
||||
|
||||
// CreateRepo - POST /repos
|
||||
hyper::Method::POST if path.matched(paths::ID_REPOS) => {
|
||||
// Handle body parameters (note that non-required body parameters will ignore garbage
|
||||
@ -1958,8 +1958,6 @@ impl<T> RequestParser<T> for ApiRequestParser {
|
||||
hyper::Method::POST if path.matched(paths::ID_CALLBACK_WITH_HEADER) => Some("CallbackWithHeaderPost"),
|
||||
// ComplexQueryParamGet - GET /complex-query-param
|
||||
hyper::Method::GET if path.matched(paths::ID_COMPLEX_QUERY_PARAM) => Some("ComplexQueryParamGet"),
|
||||
// EnumInPathPathParamGet - GET /enum_in_path/{path_param}
|
||||
hyper::Method::GET if path.matched(paths::ID_ENUM_IN_PATH_PATH_PARAM) => Some("EnumInPathPathParamGet"),
|
||||
// JsonComplexQueryParamGet - GET /json-complex-query-param
|
||||
hyper::Method::GET if path.matched(paths::ID_JSON_COMPLEX_QUERY_PARAM) => Some("JsonComplexQueryParamGet"),
|
||||
// MandatoryRequestHeaderGet - GET /mandatory-request-header
|
||||
@ -2000,6 +1998,8 @@ impl<T> RequestParser<T> for ApiRequestParser {
|
||||
hyper::Method::POST if path.matched(paths::ID_XML) => Some("XmlPost"),
|
||||
// XmlPut - PUT /xml
|
||||
hyper::Method::PUT if path.matched(paths::ID_XML) => Some("XmlPut"),
|
||||
// EnumInPathPathParamGet - GET /enum_in_path/{path_param}
|
||||
hyper::Method::GET if path.matched(paths::ID_ENUM_IN_PATH_PATH_PARAM) => Some("EnumInPathPathParamGet"),
|
||||
// CreateRepo - POST /repos
|
||||
hyper::Method::POST if path.matched(paths::ID_REPOS) => Some("CreateRepo"),
|
||||
// GetRepoInfo - GET /repos/{repoId}
|
||||
|
@ -67,25 +67,25 @@ cargo run --example client FakeOuterCompositeSerialize
|
||||
cargo run --example client FakeOuterNumberSerialize
|
||||
cargo run --example client FakeOuterStringSerialize
|
||||
cargo run --example client FakeResponseWithNumericalDescription
|
||||
cargo run --example client HyphenParam
|
||||
cargo run --example client TestEndpointParameters
|
||||
cargo run --example client TestEnumParameters
|
||||
cargo run --example client TestJsonFormData
|
||||
cargo run --example client DeletePet
|
||||
cargo run --example client HyphenParam
|
||||
cargo run --example client FindPetsByStatus
|
||||
cargo run --example client FindPetsByTags
|
||||
cargo run --example client DeletePet
|
||||
cargo run --example client GetPetById
|
||||
cargo run --example client UpdatePetWithForm
|
||||
cargo run --example client UploadFile
|
||||
cargo run --example client DeleteOrder
|
||||
cargo run --example client GetInventory
|
||||
cargo run --example client DeleteOrder
|
||||
cargo run --example client GetOrderById
|
||||
cargo run --example client CreateUsersWithArrayInput
|
||||
cargo run --example client CreateUsersWithListInput
|
||||
cargo run --example client DeleteUser
|
||||
cargo run --example client GetUserByName
|
||||
cargo run --example client LoginUser
|
||||
cargo run --example client LogoutUser
|
||||
cargo run --example client DeleteUser
|
||||
cargo run --example client GetUserByName
|
||||
```
|
||||
|
||||
### HTTPS
|
||||
@ -126,33 +126,33 @@ Method | HTTP request | Description
|
||||
[**fakeOuterNumberSerialize**](docs/fake_api.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](docs/fake_api.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**fake_response_with_numerical_description**](docs/fake_api.md#fake_response_with_numerical_description) | **GET** /fake/response-with-numerical-description |
|
||||
[**hyphenParam**](docs/fake_api.md#hyphenParam) | **GET** /fake/hyphenParam/{hyphen-param} |
|
||||
[**testBodyWithQueryParams**](docs/fake_api.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](docs/fake_api.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](docs/fake_api.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumParameters**](docs/fake_api.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
[**testInlineAdditionalProperties**](docs/fake_api.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
[**testJsonFormData**](docs/fake_api.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
[**hyphenParam**](docs/fake_api.md#hyphenParam) | **GET** /fake/hyphenParam/{hyphen-param} |
|
||||
[**testClassname**](docs/fake_classname_tags123_api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
[**addPet**](docs/pet_api.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**deletePet**](docs/pet_api.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](docs/pet_api.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](docs/pet_api.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](docs/pet_api.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**updatePet**](docs/pet_api.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**deletePet**](docs/pet_api.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**getPetById**](docs/pet_api.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**updatePetWithForm**](docs/pet_api.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](docs/pet_api.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
[**deleteOrder**](docs/store_api.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
[**getInventory**](docs/store_api.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getOrderById**](docs/store_api.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
[**placeOrder**](docs/store_api.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
[**deleteOrder**](docs/store_api.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
[**getOrderById**](docs/store_api.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
[**createUser**](docs/user_api.md#createUser) | **POST** /user | Create user
|
||||
[**createUsersWithArrayInput**](docs/user_api.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
[**createUsersWithListInput**](docs/user_api.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
[**deleteUser**](docs/user_api.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
[**getUserByName**](docs/user_api.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**loginUser**](docs/user_api.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**logoutUser**](docs/user_api.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**deleteUser**](docs/user_api.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
[**getUserByName**](docs/user_api.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**updateUser**](docs/user_api.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
|
@ -10,13 +10,13 @@ Method | HTTP request | Description
|
||||
**fakeOuterNumberSerialize**](fake_api.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
**fakeOuterStringSerialize**](fake_api.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
**fake_response_with_numerical_description**](fake_api.md#fake_response_with_numerical_description) | **GET** /fake/response-with-numerical-description |
|
||||
**hyphenParam**](fake_api.md#hyphenParam) | **GET** /fake/hyphenParam/{hyphen-param} |
|
||||
**testBodyWithQueryParams**](fake_api.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
**testClientModel**](fake_api.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
**testEndpointParameters**](fake_api.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
**testEnumParameters**](fake_api.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
**testInlineAdditionalProperties**](fake_api.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
**testJsonFormData**](fake_api.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
**hyphenParam**](fake_api.md#hyphenParam) | **GET** /fake/hyphenParam/{hyphen-param} |
|
||||
|
||||
|
||||
# **123example**
|
||||
@ -199,33 +199,6 @@ 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)
|
||||
|
||||
# **hyphenParam**
|
||||
> hyphenParam(hyphen_param)
|
||||
|
||||
|
||||
To test hyphen in path parameter name
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**hyphen_param** | **String**| Parameter with hyphen in name |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, body)
|
||||
|
||||
@ -422,3 +395,30 @@ 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)
|
||||
|
||||
# **hyphenParam**
|
||||
> hyphenParam(hyphen_param)
|
||||
|
||||
|
||||
To test hyphen in path parameter name
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**hyphen_param** | **String**| Parameter with hyphen in name |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
|
@ -5,11 +5,11 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
**addPet**](pet_api.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
**deletePet**](pet_api.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
**findPetsByStatus**](pet_api.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
**findPetsByTags**](pet_api.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
**getPetById**](pet_api.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
**updatePet**](pet_api.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
**deletePet**](pet_api.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
**getPetById**](pet_api.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
**updatePetWithForm**](pet_api.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
**uploadFile**](pet_api.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
|
||||
@ -40,41 +40,6 @@ Name | Type | Description | Notes
|
||||
|
||||
[[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)
|
||||
|
||||
# **deletePet**
|
||||
> deletePet(ctx, pet_id, optional)
|
||||
Deletes a pet
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
|
||||
**pet_id** | **i64**| Pet id to delete |
|
||||
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
|
||||
|
||||
### Optional Parameters
|
||||
Optional parameters are passed through a map[string]interface{}.
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **i64**| Pet id to delete |
|
||||
**api_key** | **String**| |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **findPetsByStatus**
|
||||
> Vec<models::Pet> findPetsByStatus(ctx, status)
|
||||
Finds Pets by status
|
||||
@ -131,6 +96,67 @@ Name | Type | Description | Notes
|
||||
|
||||
[[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)
|
||||
|
||||
# **updatePet**
|
||||
> updatePet(ctx, body)
|
||||
Update an existing pet
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **deletePet**
|
||||
> deletePet(ctx, pet_id, optional)
|
||||
Deletes a pet
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
|
||||
**pet_id** | **i64**| Pet id to delete |
|
||||
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
|
||||
|
||||
### Optional Parameters
|
||||
Optional parameters are passed through a map[string]interface{}.
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **i64**| Pet id to delete |
|
||||
**api_key** | **String**| |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **getPetById**
|
||||
> models::Pet getPetById(ctx, pet_id)
|
||||
Find pet by ID
|
||||
@ -159,32 +185,6 @@ Name | Type | Description | Notes
|
||||
|
||||
[[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)
|
||||
|
||||
# **updatePet**
|
||||
> updatePet(ctx, body)
|
||||
Update an existing pet
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context containing the authentication | nil if no authentication
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **updatePetWithForm**
|
||||
> updatePetWithForm(ctx, pet_id, optional)
|
||||
Updates a pet in the store with form data
|
||||
|
@ -4,12 +4,61 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
**deleteOrder**](store_api.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
**getInventory**](store_api.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
**getOrderById**](store_api.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
**placeOrder**](store_api.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
**deleteOrder**](store_api.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
**getOrderById**](store_api.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
|
||||
|
||||
# **getInventory**
|
||||
> std::collections::HashMap<String, i32> getInventory(ctx, )
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Required Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**std::collections::HashMap<String, i32>**](integer.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### 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)
|
||||
|
||||
# **placeOrder**
|
||||
> models::Order placeOrder(body)
|
||||
Place an order for a pet
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
[**models::Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[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)
|
||||
|
||||
# **deleteOrder**
|
||||
> deleteOrder(order_id)
|
||||
Delete purchase order by ID
|
||||
@ -37,30 +86,6 @@ 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)
|
||||
|
||||
# **getInventory**
|
||||
> std::collections::HashMap<String, i32> getInventory(ctx, )
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Required Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**std::collections::HashMap<String, i32>**](integer.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### 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)
|
||||
|
||||
# **getOrderById**
|
||||
> models::Order getOrderById(order_id)
|
||||
Find purchase order by ID
|
||||
@ -88,28 +113,3 @@ 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)
|
||||
|
||||
# **placeOrder**
|
||||
> models::Order placeOrder(body)
|
||||
Place an order for a pet
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
[**models::Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[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)
|
||||
|
||||
|
@ -7,10 +7,10 @@ Method | HTTP request | Description
|
||||
**createUser**](user_api.md#createUser) | **POST** /user | Create user
|
||||
**createUsersWithArrayInput**](user_api.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
**createUsersWithListInput**](user_api.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
**deleteUser**](user_api.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
**getUserByName**](user_api.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
**loginUser**](user_api.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
**logoutUser**](user_api.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
**deleteUser**](user_api.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
**getUserByName**](user_api.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
**updateUser**](user_api.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
@ -91,6 +91,54 @@ 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)
|
||||
|
||||
# **loginUser**
|
||||
> String loginUser(username, password)
|
||||
Logs user into the system
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The user name for login |
|
||||
**password** | **String**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
[**String**](string.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[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)
|
||||
|
||||
# **logoutUser**
|
||||
> logoutUser()
|
||||
Logs out current logged in user session
|
||||
|
||||
### Required Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **deleteUser**
|
||||
> deleteUser(username)
|
||||
Delete user
|
||||
@ -143,54 +191,6 @@ 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)
|
||||
|
||||
# **loginUser**
|
||||
> String loginUser(username, password)
|
||||
Logs user into the system
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The user name for login |
|
||||
**password** | **String**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
[**String**](string.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
||||
[[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)
|
||||
|
||||
# **logoutUser**
|
||||
> logoutUser()
|
||||
Logs out current logged in user session
|
||||
|
||||
### Required Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **updateUser**
|
||||
> updateUser(username, body)
|
||||
Updated user
|
||||
|
@ -12,33 +12,33 @@ use petstore_with_fake_endpoints_models_for_testing::{Api, ApiNoContext, Claims,
|
||||
FakeOuterNumberSerializeResponse,
|
||||
FakeOuterStringSerializeResponse,
|
||||
FakeResponseWithNumericalDescriptionResponse,
|
||||
HyphenParamResponse,
|
||||
TestBodyWithQueryParamsResponse,
|
||||
TestClientModelResponse,
|
||||
TestEndpointParametersResponse,
|
||||
TestEnumParametersResponse,
|
||||
TestInlineAdditionalPropertiesResponse,
|
||||
TestJsonFormDataResponse,
|
||||
HyphenParamResponse,
|
||||
TestClassnameResponse,
|
||||
AddPetResponse,
|
||||
DeletePetResponse,
|
||||
FindPetsByStatusResponse,
|
||||
FindPetsByTagsResponse,
|
||||
GetPetByIdResponse,
|
||||
UpdatePetResponse,
|
||||
DeletePetResponse,
|
||||
GetPetByIdResponse,
|
||||
UpdatePetWithFormResponse,
|
||||
UploadFileResponse,
|
||||
DeleteOrderResponse,
|
||||
GetInventoryResponse,
|
||||
GetOrderByIdResponse,
|
||||
PlaceOrderResponse,
|
||||
DeleteOrderResponse,
|
||||
GetOrderByIdResponse,
|
||||
CreateUserResponse,
|
||||
CreateUsersWithArrayInputResponse,
|
||||
CreateUsersWithListInputResponse,
|
||||
DeleteUserResponse,
|
||||
GetUserByNameResponse,
|
||||
LoginUserResponse,
|
||||
LogoutUserResponse,
|
||||
DeleteUserResponse,
|
||||
GetUserByNameResponse,
|
||||
UpdateUserResponse,
|
||||
};
|
||||
use clap::{App, Arg};
|
||||
@ -74,25 +74,25 @@ fn main() {
|
||||
"FakeOuterNumberSerialize",
|
||||
"FakeOuterStringSerialize",
|
||||
"FakeResponseWithNumericalDescription",
|
||||
"HyphenParam",
|
||||
"TestEndpointParameters",
|
||||
"TestEnumParameters",
|
||||
"TestJsonFormData",
|
||||
"DeletePet",
|
||||
"HyphenParam",
|
||||
"FindPetsByStatus",
|
||||
"FindPetsByTags",
|
||||
"DeletePet",
|
||||
"GetPetById",
|
||||
"UpdatePetWithForm",
|
||||
"UploadFile",
|
||||
"DeleteOrder",
|
||||
"GetInventory",
|
||||
"DeleteOrder",
|
||||
"GetOrderById",
|
||||
"CreateUsersWithArrayInput",
|
||||
"CreateUsersWithListInput",
|
||||
"DeleteUser",
|
||||
"GetUserByName",
|
||||
"LoginUser",
|
||||
"LogoutUser",
|
||||
"DeleteUser",
|
||||
"GetUserByName",
|
||||
])
|
||||
.required(true)
|
||||
.index(1))
|
||||
@ -206,12 +206,6 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("HyphenParam") => {
|
||||
let result = rt.block_on(client.hyphen_param(
|
||||
"hyphen_param_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("TestBodyWithQueryParams") => {
|
||||
let result = rt.block_on(client.test_body_with_query_params(
|
||||
@ -275,6 +269,12 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("HyphenParam") => {
|
||||
let result = rt.block_on(client.hyphen_param(
|
||||
"hyphen_param_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("TestClassname") => {
|
||||
let result = rt.block_on(client.test_classname(
|
||||
@ -291,13 +291,6 @@ fn main() {
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
*/
|
||||
Some("DeletePet") => {
|
||||
let result = rt.block_on(client.delete_pet(
|
||||
789,
|
||||
Some("api_key_example".to_string())
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("FindPetsByStatus") => {
|
||||
let result = rt.block_on(client.find_pets_by_status(
|
||||
&Vec::new()
|
||||
@ -310,12 +303,6 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("GetPetById") => {
|
||||
let result = rt.block_on(client.get_pet_by_id(
|
||||
789
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("UpdatePet") => {
|
||||
let result = rt.block_on(client.update_pet(
|
||||
@ -324,6 +311,19 @@ fn main() {
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
*/
|
||||
Some("DeletePet") => {
|
||||
let result = rt.block_on(client.delete_pet(
|
||||
789,
|
||||
Some("api_key_example".to_string())
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("GetPetById") => {
|
||||
let result = rt.block_on(client.get_pet_by_id(
|
||||
789
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("UpdatePetWithForm") => {
|
||||
let result = rt.block_on(client.update_pet_with_form(
|
||||
789,
|
||||
@ -340,23 +340,11 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("DeleteOrder") => {
|
||||
let result = rt.block_on(client.delete_order(
|
||||
"order_id_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("GetInventory") => {
|
||||
let result = rt.block_on(client.get_inventory(
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("GetOrderById") => {
|
||||
let result = rt.block_on(client.get_order_by_id(
|
||||
789
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("PlaceOrder") => {
|
||||
let result = rt.block_on(client.place_order(
|
||||
@ -365,6 +353,18 @@ fn main() {
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
*/
|
||||
Some("DeleteOrder") => {
|
||||
let result = rt.block_on(client.delete_order(
|
||||
"order_id_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("GetOrderById") => {
|
||||
let result = rt.block_on(client.get_order_by_id(
|
||||
789
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("CreateUser") => {
|
||||
let result = rt.block_on(client.create_user(
|
||||
@ -385,18 +385,6 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("DeleteUser") => {
|
||||
let result = rt.block_on(client.delete_user(
|
||||
"username_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("GetUserByName") => {
|
||||
let result = rt.block_on(client.get_user_by_name(
|
||||
"username_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("LoginUser") => {
|
||||
let result = rt.block_on(client.login_user(
|
||||
"username_example".to_string(),
|
||||
@ -409,6 +397,18 @@ fn main() {
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("DeleteUser") => {
|
||||
let result = rt.block_on(client.delete_user(
|
||||
"username_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
Some("GetUserByName") => {
|
||||
let result = rt.block_on(client.get_user_by_name(
|
||||
"username_example".to_string()
|
||||
));
|
||||
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
|
||||
},
|
||||
/* Disabled because there's no example.
|
||||
Some("UpdateUser") => {
|
||||
let result = rt.block_on(client.update_user(
|
||||
|
@ -109,33 +109,33 @@ use petstore_with_fake_endpoints_models_for_testing::{
|
||||
FakeOuterNumberSerializeResponse,
|
||||
FakeOuterStringSerializeResponse,
|
||||
FakeResponseWithNumericalDescriptionResponse,
|
||||
HyphenParamResponse,
|
||||
TestBodyWithQueryParamsResponse,
|
||||
TestClientModelResponse,
|
||||
TestEndpointParametersResponse,
|
||||
TestEnumParametersResponse,
|
||||
TestInlineAdditionalPropertiesResponse,
|
||||
TestJsonFormDataResponse,
|
||||
HyphenParamResponse,
|
||||
TestClassnameResponse,
|
||||
AddPetResponse,
|
||||
DeletePetResponse,
|
||||
FindPetsByStatusResponse,
|
||||
FindPetsByTagsResponse,
|
||||
GetPetByIdResponse,
|
||||
UpdatePetResponse,
|
||||
DeletePetResponse,
|
||||
GetPetByIdResponse,
|
||||
UpdatePetWithFormResponse,
|
||||
UploadFileResponse,
|
||||
DeleteOrderResponse,
|
||||
GetInventoryResponse,
|
||||
GetOrderByIdResponse,
|
||||
PlaceOrderResponse,
|
||||
DeleteOrderResponse,
|
||||
GetOrderByIdResponse,
|
||||
CreateUserResponse,
|
||||
CreateUsersWithArrayInputResponse,
|
||||
CreateUsersWithListInputResponse,
|
||||
DeleteUserResponse,
|
||||
GetUserByNameResponse,
|
||||
LoginUserResponse,
|
||||
LogoutUserResponse,
|
||||
DeleteUserResponse,
|
||||
GetUserByNameResponse,
|
||||
UpdateUserResponse,
|
||||
};
|
||||
use petstore_with_fake_endpoints_models_for_testing::server::MakeService;
|
||||
@ -207,15 +207,6 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
context: &C) -> Result<HyphenParamResponse, ApiError>
|
||||
{
|
||||
info!("hyphen_param(\"{}\") - X-Span-ID: {:?}", hyphen_param, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
async fn test_body_with_query_params(
|
||||
&self,
|
||||
query: String,
|
||||
@ -296,6 +287,15 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
context: &C) -> Result<HyphenParamResponse, ApiError>
|
||||
{
|
||||
info!("hyphen_param(\"{}\") - X-Span-ID: {:?}", hyphen_param, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// To test class name in snake case
|
||||
async fn test_classname(
|
||||
&self,
|
||||
@ -316,17 +316,6 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
context: &C) -> Result<DeletePetResponse, ApiError>
|
||||
{
|
||||
info!("delete_pet({}, {:?}) - X-Span-ID: {:?}", pet_id, api_key, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Finds Pets by status
|
||||
async fn find_pets_by_status(
|
||||
&self,
|
||||
@ -347,16 +336,6 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
context: &C) -> Result<GetPetByIdResponse, ApiError>
|
||||
{
|
||||
info!("get_pet_by_id({}) - X-Span-ID: {:?}", pet_id, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Update an existing pet
|
||||
async fn update_pet(
|
||||
&self,
|
||||
@ -367,6 +346,27 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
context: &C) -> Result<DeletePetResponse, ApiError>
|
||||
{
|
||||
info!("delete_pet({}, {:?}) - X-Span-ID: {:?}", pet_id, api_key, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
context: &C) -> Result<GetPetByIdResponse, ApiError>
|
||||
{
|
||||
info!("get_pet_by_id({}) - X-Span-ID: {:?}", pet_id, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Updates a pet in the store with form data
|
||||
async fn update_pet_with_form(
|
||||
&self,
|
||||
@ -391,16 +391,6 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
context: &C) -> Result<DeleteOrderResponse, ApiError>
|
||||
{
|
||||
info!("delete_order(\"{}\") - X-Span-ID: {:?}", order_id, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Returns pet inventories by status
|
||||
async fn get_inventory(
|
||||
&self,
|
||||
@ -410,16 +400,6 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
context: &C) -> Result<GetOrderByIdResponse, ApiError>
|
||||
{
|
||||
info!("get_order_by_id({}) - X-Span-ID: {:?}", order_id, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Place an order for a pet
|
||||
async fn place_order(
|
||||
&self,
|
||||
@ -430,6 +410,26 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
context: &C) -> Result<DeleteOrderResponse, ApiError>
|
||||
{
|
||||
info!("delete_order(\"{}\") - X-Span-ID: {:?}", order_id, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
context: &C) -> Result<GetOrderByIdResponse, ApiError>
|
||||
{
|
||||
info!("get_order_by_id({}) - X-Span-ID: {:?}", order_id, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Create user
|
||||
async fn create_user(
|
||||
&self,
|
||||
@ -460,26 +460,6 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<DeleteUserResponse, ApiError>
|
||||
{
|
||||
info!("delete_user(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<GetUserByNameResponse, ApiError>
|
||||
{
|
||||
info!("get_user_by_name(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Logs user into the system
|
||||
async fn login_user(
|
||||
&self,
|
||||
@ -500,6 +480,26 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString> + Send + Sync
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<DeleteUserResponse, ApiError>
|
||||
{
|
||||
info!("delete_user(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<GetUserByNameResponse, ApiError>
|
||||
{
|
||||
info!("get_user_by_name(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone());
|
||||
Err(ApiError("Api-Error: Operation is NOT implemented".into()))
|
||||
}
|
||||
|
||||
/// Updated user
|
||||
async fn update_user(
|
||||
&self,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -67,12 +67,6 @@ pub enum FakeResponseWithNumericalDescriptionResponse {
|
||||
Status200
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum HyphenParamResponse {
|
||||
/// Success
|
||||
Success
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum TestBodyWithQueryParamsResponse {
|
||||
/// Success
|
||||
@ -118,6 +112,12 @@ pub enum TestJsonFormDataResponse {
|
||||
SuccessfulOperation
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum HyphenParamResponse {
|
||||
/// Success
|
||||
Success
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum TestClassnameResponse {
|
||||
/// successful operation
|
||||
@ -131,12 +131,6 @@ pub enum AddPetResponse {
|
||||
InvalidInput
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum DeletePetResponse {
|
||||
/// Invalid pet value
|
||||
InvalidPetValue
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum FindPetsByStatusResponse {
|
||||
@ -159,6 +153,25 @@ pub enum FindPetsByTagsResponse {
|
||||
InvalidTagValue
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum UpdatePetResponse {
|
||||
/// Invalid ID supplied
|
||||
InvalidIDSupplied
|
||||
,
|
||||
/// Pet not found
|
||||
PetNotFound
|
||||
,
|
||||
/// Validation exception
|
||||
ValidationException
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum DeletePetResponse {
|
||||
/// Invalid pet value
|
||||
InvalidPetValue
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum GetPetByIdResponse {
|
||||
@ -173,19 +186,6 @@ pub enum GetPetByIdResponse {
|
||||
PetNotFound
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum UpdatePetResponse {
|
||||
/// Invalid ID supplied
|
||||
InvalidIDSupplied
|
||||
,
|
||||
/// Pet not found
|
||||
PetNotFound
|
||||
,
|
||||
/// Validation exception
|
||||
ValidationException
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum UpdatePetWithFormResponse {
|
||||
/// Invalid input
|
||||
@ -199,6 +199,24 @@ pub enum UploadFileResponse {
|
||||
(models::ApiResponse)
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum GetInventoryResponse {
|
||||
/// successful operation
|
||||
SuccessfulOperation
|
||||
(std::collections::HashMap<String, i32>)
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum PlaceOrderResponse {
|
||||
/// successful operation
|
||||
SuccessfulOperation
|
||||
(models::Order)
|
||||
,
|
||||
/// Invalid Order
|
||||
InvalidOrder
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum DeleteOrderResponse {
|
||||
@ -209,13 +227,6 @@ pub enum DeleteOrderResponse {
|
||||
OrderNotFound
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum GetInventoryResponse {
|
||||
/// successful operation
|
||||
SuccessfulOperation
|
||||
(std::collections::HashMap<String, i32>)
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum GetOrderByIdResponse {
|
||||
@ -230,17 +241,6 @@ pub enum GetOrderByIdResponse {
|
||||
OrderNotFound
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum PlaceOrderResponse {
|
||||
/// successful operation
|
||||
SuccessfulOperation
|
||||
(models::Order)
|
||||
,
|
||||
/// Invalid Order
|
||||
InvalidOrder
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum CreateUserResponse {
|
||||
/// successful operation
|
||||
@ -259,30 +259,6 @@ pub enum CreateUsersWithListInputResponse {
|
||||
SuccessfulOperation
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum DeleteUserResponse {
|
||||
/// Invalid username supplied
|
||||
InvalidUsernameSupplied
|
||||
,
|
||||
/// User not found
|
||||
UserNotFound
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum GetUserByNameResponse {
|
||||
/// successful operation
|
||||
SuccessfulOperation
|
||||
(models::User)
|
||||
,
|
||||
/// Invalid username supplied
|
||||
InvalidUsernameSupplied
|
||||
,
|
||||
/// User not found
|
||||
UserNotFound
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum LoginUserResponse {
|
||||
@ -311,6 +287,30 @@ pub enum LogoutUserResponse {
|
||||
SuccessfulOperation
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum DeleteUserResponse {
|
||||
/// Invalid username supplied
|
||||
InvalidUsernameSupplied
|
||||
,
|
||||
/// User not found
|
||||
UserNotFound
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum GetUserByNameResponse {
|
||||
/// successful operation
|
||||
SuccessfulOperation
|
||||
(models::User)
|
||||
,
|
||||
/// Invalid username supplied
|
||||
InvalidUsernameSupplied
|
||||
,
|
||||
/// User not found
|
||||
UserNotFound
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[must_use]
|
||||
pub enum UpdateUserResponse {
|
||||
@ -363,11 +363,6 @@ pub trait Api<C: Send + Sync> {
|
||||
&self,
|
||||
context: &C) -> Result<FakeResponseWithNumericalDescriptionResponse, ApiError>;
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
context: &C) -> Result<HyphenParamResponse, ApiError>;
|
||||
|
||||
async fn test_body_with_query_params(
|
||||
&self,
|
||||
query: String,
|
||||
@ -424,6 +419,11 @@ pub trait Api<C: Send + Sync> {
|
||||
param2: String,
|
||||
context: &C) -> Result<TestJsonFormDataResponse, ApiError>;
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
context: &C) -> Result<HyphenParamResponse, ApiError>;
|
||||
|
||||
/// To test class name in snake case
|
||||
async fn test_classname(
|
||||
&self,
|
||||
@ -436,13 +436,6 @@ pub trait Api<C: Send + Sync> {
|
||||
body: models::Pet,
|
||||
context: &C) -> Result<AddPetResponse, ApiError>;
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
context: &C) -> Result<DeletePetResponse, ApiError>;
|
||||
|
||||
/// Finds Pets by status
|
||||
async fn find_pets_by_status(
|
||||
&self,
|
||||
@ -455,18 +448,25 @@ pub trait Api<C: Send + Sync> {
|
||||
tags: &Vec<String>,
|
||||
context: &C) -> Result<FindPetsByTagsResponse, ApiError>;
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
context: &C) -> Result<GetPetByIdResponse, ApiError>;
|
||||
|
||||
/// Update an existing pet
|
||||
async fn update_pet(
|
||||
&self,
|
||||
body: models::Pet,
|
||||
context: &C) -> Result<UpdatePetResponse, ApiError>;
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
context: &C) -> Result<DeletePetResponse, ApiError>;
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
context: &C) -> Result<GetPetByIdResponse, ApiError>;
|
||||
|
||||
/// Updates a pet in the store with form data
|
||||
async fn update_pet_with_form(
|
||||
&self,
|
||||
@ -483,29 +483,29 @@ pub trait Api<C: Send + Sync> {
|
||||
file: Option<swagger::ByteArray>,
|
||||
context: &C) -> Result<UploadFileResponse, ApiError>;
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
context: &C) -> Result<DeleteOrderResponse, ApiError>;
|
||||
|
||||
/// Returns pet inventories by status
|
||||
async fn get_inventory(
|
||||
&self,
|
||||
context: &C) -> Result<GetInventoryResponse, ApiError>;
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
context: &C) -> Result<GetOrderByIdResponse, ApiError>;
|
||||
|
||||
/// Place an order for a pet
|
||||
async fn place_order(
|
||||
&self,
|
||||
body: models::Order,
|
||||
context: &C) -> Result<PlaceOrderResponse, ApiError>;
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
context: &C) -> Result<DeleteOrderResponse, ApiError>;
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
context: &C) -> Result<GetOrderByIdResponse, ApiError>;
|
||||
|
||||
/// Create user
|
||||
async fn create_user(
|
||||
&self,
|
||||
@ -524,18 +524,6 @@ pub trait Api<C: Send + Sync> {
|
||||
body: &Vec<models::User>,
|
||||
context: &C) -> Result<CreateUsersWithListInputResponse, ApiError>;
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<DeleteUserResponse, ApiError>;
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<GetUserByNameResponse, ApiError>;
|
||||
|
||||
/// Logs user into the system
|
||||
async fn login_user(
|
||||
&self,
|
||||
@ -548,6 +536,18 @@ pub trait Api<C: Send + Sync> {
|
||||
&self,
|
||||
context: &C) -> Result<LogoutUserResponse, ApiError>;
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<DeleteUserResponse, ApiError>;
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
context: &C) -> Result<GetUserByNameResponse, ApiError>;
|
||||
|
||||
/// Updated user
|
||||
async fn update_user(
|
||||
&self,
|
||||
@ -600,11 +600,6 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
&self,
|
||||
) -> Result<FakeResponseWithNumericalDescriptionResponse, ApiError>;
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
) -> Result<HyphenParamResponse, ApiError>;
|
||||
|
||||
async fn test_body_with_query_params(
|
||||
&self,
|
||||
query: String,
|
||||
@ -661,6 +656,11 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
param2: String,
|
||||
) -> Result<TestJsonFormDataResponse, ApiError>;
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
) -> Result<HyphenParamResponse, ApiError>;
|
||||
|
||||
/// To test class name in snake case
|
||||
async fn test_classname(
|
||||
&self,
|
||||
@ -673,13 +673,6 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
body: models::Pet,
|
||||
) -> Result<AddPetResponse, ApiError>;
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
) -> Result<DeletePetResponse, ApiError>;
|
||||
|
||||
/// Finds Pets by status
|
||||
async fn find_pets_by_status(
|
||||
&self,
|
||||
@ -692,18 +685,25 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
tags: &Vec<String>,
|
||||
) -> Result<FindPetsByTagsResponse, ApiError>;
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
) -> Result<GetPetByIdResponse, ApiError>;
|
||||
|
||||
/// Update an existing pet
|
||||
async fn update_pet(
|
||||
&self,
|
||||
body: models::Pet,
|
||||
) -> Result<UpdatePetResponse, ApiError>;
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
) -> Result<DeletePetResponse, ApiError>;
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
) -> Result<GetPetByIdResponse, ApiError>;
|
||||
|
||||
/// Updates a pet in the store with form data
|
||||
async fn update_pet_with_form(
|
||||
&self,
|
||||
@ -720,29 +720,29 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
file: Option<swagger::ByteArray>,
|
||||
) -> Result<UploadFileResponse, ApiError>;
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
) -> Result<DeleteOrderResponse, ApiError>;
|
||||
|
||||
/// Returns pet inventories by status
|
||||
async fn get_inventory(
|
||||
&self,
|
||||
) -> Result<GetInventoryResponse, ApiError>;
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
) -> Result<GetOrderByIdResponse, ApiError>;
|
||||
|
||||
/// Place an order for a pet
|
||||
async fn place_order(
|
||||
&self,
|
||||
body: models::Order,
|
||||
) -> Result<PlaceOrderResponse, ApiError>;
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
) -> Result<DeleteOrderResponse, ApiError>;
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
) -> Result<GetOrderByIdResponse, ApiError>;
|
||||
|
||||
/// Create user
|
||||
async fn create_user(
|
||||
&self,
|
||||
@ -761,18 +761,6 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
body: &Vec<models::User>,
|
||||
) -> Result<CreateUsersWithListInputResponse, ApiError>;
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<DeleteUserResponse, ApiError>;
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<GetUserByNameResponse, ApiError>;
|
||||
|
||||
/// Logs user into the system
|
||||
async fn login_user(
|
||||
&self,
|
||||
@ -785,6 +773,18 @@ pub trait ApiNoContext<C: Send + Sync> {
|
||||
&self,
|
||||
) -> Result<LogoutUserResponse, ApiError>;
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<DeleteUserResponse, ApiError>;
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<GetUserByNameResponse, ApiError>;
|
||||
|
||||
/// Updated user
|
||||
async fn update_user(
|
||||
&self,
|
||||
@ -879,15 +879,6 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().fake_response_with_numerical_description(&context).await
|
||||
}
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
) -> Result<HyphenParamResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().hyphen_param(hyphen_param, &context).await
|
||||
}
|
||||
|
||||
async fn test_body_with_query_params(
|
||||
&self,
|
||||
query: String,
|
||||
@ -968,6 +959,15 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().test_json_form_data(param, param2, &context).await
|
||||
}
|
||||
|
||||
async fn hyphen_param(
|
||||
&self,
|
||||
hyphen_param: String,
|
||||
) -> Result<HyphenParamResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().hyphen_param(hyphen_param, &context).await
|
||||
}
|
||||
|
||||
/// To test class name in snake case
|
||||
async fn test_classname(
|
||||
&self,
|
||||
@ -988,17 +988,6 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().add_pet(body, &context).await
|
||||
}
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
) -> Result<DeletePetResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().delete_pet(pet_id, api_key, &context).await
|
||||
}
|
||||
|
||||
/// Finds Pets by status
|
||||
async fn find_pets_by_status(
|
||||
&self,
|
||||
@ -1019,16 +1008,6 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().find_pets_by_tags(tags, &context).await
|
||||
}
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
) -> Result<GetPetByIdResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().get_pet_by_id(pet_id, &context).await
|
||||
}
|
||||
|
||||
/// Update an existing pet
|
||||
async fn update_pet(
|
||||
&self,
|
||||
@ -1039,6 +1018,27 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().update_pet(body, &context).await
|
||||
}
|
||||
|
||||
/// Deletes a pet
|
||||
async fn delete_pet(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
api_key: Option<String>,
|
||||
) -> Result<DeletePetResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().delete_pet(pet_id, api_key, &context).await
|
||||
}
|
||||
|
||||
/// Find pet by ID
|
||||
async fn get_pet_by_id(
|
||||
&self,
|
||||
pet_id: i64,
|
||||
) -> Result<GetPetByIdResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().get_pet_by_id(pet_id, &context).await
|
||||
}
|
||||
|
||||
/// Updates a pet in the store with form data
|
||||
async fn update_pet_with_form(
|
||||
&self,
|
||||
@ -1063,16 +1063,6 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().upload_file(pet_id, additional_metadata, file, &context).await
|
||||
}
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
) -> Result<DeleteOrderResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().delete_order(order_id, &context).await
|
||||
}
|
||||
|
||||
/// Returns pet inventories by status
|
||||
async fn get_inventory(
|
||||
&self,
|
||||
@ -1082,16 +1072,6 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().get_inventory(&context).await
|
||||
}
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
) -> Result<GetOrderByIdResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().get_order_by_id(order_id, &context).await
|
||||
}
|
||||
|
||||
/// Place an order for a pet
|
||||
async fn place_order(
|
||||
&self,
|
||||
@ -1102,6 +1082,26 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().place_order(body, &context).await
|
||||
}
|
||||
|
||||
/// Delete purchase order by ID
|
||||
async fn delete_order(
|
||||
&self,
|
||||
order_id: String,
|
||||
) -> Result<DeleteOrderResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().delete_order(order_id, &context).await
|
||||
}
|
||||
|
||||
/// Find purchase order by ID
|
||||
async fn get_order_by_id(
|
||||
&self,
|
||||
order_id: i64,
|
||||
) -> Result<GetOrderByIdResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().get_order_by_id(order_id, &context).await
|
||||
}
|
||||
|
||||
/// Create user
|
||||
async fn create_user(
|
||||
&self,
|
||||
@ -1132,26 +1132,6 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().create_users_with_list_input(body, &context).await
|
||||
}
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<DeleteUserResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().delete_user(username, &context).await
|
||||
}
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<GetUserByNameResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().get_user_by_name(username, &context).await
|
||||
}
|
||||
|
||||
/// Logs user into the system
|
||||
async fn login_user(
|
||||
&self,
|
||||
@ -1172,6 +1152,26 @@ impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for Contex
|
||||
self.api().logout_user(&context).await
|
||||
}
|
||||
|
||||
/// Delete user
|
||||
async fn delete_user(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<DeleteUserResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().delete_user(username, &context).await
|
||||
}
|
||||
|
||||
/// Get user by user name
|
||||
async fn get_user_by_name(
|
||||
&self,
|
||||
username: String,
|
||||
) -> Result<GetUserByNameResponse, ApiError>
|
||||
{
|
||||
let context = self.context().clone();
|
||||
self.api().get_user_by_name(username, &context).await
|
||||
}
|
||||
|
||||
/// Updated user
|
||||
async fn update_user(
|
||||
&self,
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user