[Rust] [Axum] Remove redundant code in rust-axum generator (#17570)

This commit is contained in:
Linh Tran Tuan
2024-01-10 02:41:14 +09:00
committed by GitHub
parent 69a4a65bc7
commit 425011a50c
16 changed files with 628 additions and 670 deletions

View File

@@ -1,7 +1,6 @@
package org.openapitools.codegen.languages;
import com.samskivert.mustache.Mustache;
import io.swagger.v3.core.util.Json;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.info.Info;
@@ -111,28 +110,13 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
// set the output folder here
outputFolder = "generated-code" + File.separator + "rust-axum";
/*
* Models. You can write model files using the modelTemplateFiles map.
* if you want to create one template for file, you can do so here.
* for multiple files for model, just put another entry in the `modelTemplateFiles` with
* a different extension
*/
modelTemplateFiles.clear();
/*
* Api classes. You can write classes for each Api file with the apiTemplateFiles map.
* as with models, add multiple entries with different extensions for multiple files per
* class
*/
apiTemplateFiles.clear();
/*
* Template Location. This is the location which templates will be read from. The generator
* will use the resource stream to attempt to read the templates.
*/
embeddedTemplateDir = templateDir = "rust-axum";
importMapping = new HashMap<>();
modelTemplateFiles.clear();
apiTemplateFiles.clear();
// types
defaultIncludes = new HashSet<>(
Arrays.asList(
"map",
@@ -186,8 +170,7 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
typeMapping.put("object", "crate::types::Object");
typeMapping.put("AnyType", "crate::types::Object");
importMapping = new HashMap<>();
// cli options
cliOptions.clear();
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME,
"Rust crate name (convention: snake_case).")
@@ -201,32 +184,30 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
optDisableValidator.defaultValue(disableValidator.toString());
cliOptions.add(optDisableValidator);
CliOption optAllowBlockingValidator = new CliOption("allowBlockingValidator", "By default, validation process, which might perform a lot of compute in a " +
"future without yielding, is executed on a blocking thread via tokio::task::spawn_blocking. Set this option to true will override this behaviour and allow blocking " +
"call to happen. It helps to improve the performance when validating request-data (header, path, query, body) is low cost.");
CliOption optAllowBlockingValidator = new CliOption("allowBlockingValidator",
String.join("",
"By default, validation process, which might perform a lot of compute in a ",
"future without yielding, is executed on a blocking thread via tokio::task::spawn_blocking. ",
"Set this option to true will override this behaviour and allow blocking call to happen. ",
"It helps to improve the performance when validating request-data (header, path, query, body) ",
"is low cost."));
optAllowBlockingValidator.setType("bool");
optAllowBlockingValidator.defaultValue(allowBlockingValidator.toString());
cliOptions.add(optAllowBlockingValidator);
CliOption optAllowBlockingResponseSerialize = new CliOption("allowBlockingResponseSerialize", "By default, json/form-urlencoded response serialization, which might " +
"perform a lot of compute in a future without yielding, is executed on a blocking thread via tokio::task::spawn_blocking. Set this option to true will override this behaviour and allow blocking " +
"call to happen. It helps to improve the performance when response serialization (e.g. returns tiny data) is low cost.");
CliOption optAllowBlockingResponseSerialize = new CliOption("allowBlockingResponseSerialize",
String.join("", "By default, json/form-urlencoded response serialization, which might ",
"perform a lot of compute in a future without yielding, is executed on a blocking thread ",
"via tokio::task::spawn_blocking. Set this option to true will override this behaviour and ",
"allow blocking call to happen. It helps to improve the performance when response ",
"serialization (e.g. returns tiny data) is low cost."));
optAllowBlockingResponseSerialize.setType("bool");
optAllowBlockingResponseSerialize.defaultValue(allowBlockingResponseSerialize.toString());
cliOptions.add(optAllowBlockingResponseSerialize);
/*
* Additional Properties. These values can be passed to the templates and
* are available in models, apis, and supporting files
*/
additionalProperties.put("apiVersion", apiVersion);
additionalProperties.put("apiPath", apiPath);
/*
* Supporting Files. You can write single files for the generator with the
* entire object tree available. If the input file has a suffix of `.mustache
* it will be processed by the template engine. Otherwise, it will be copied
*/
supportingFiles.add(new SupportingFile("Cargo.mustache", "", "Cargo.toml"));
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
supportingFiles.add(new SupportingFile("lib.mustache", "src", "lib.rs"));
@@ -252,7 +233,9 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
@Override
public Mustache.Compiler processCompiler(Mustache.Compiler compiler) {
return super.processCompiler(compiler).emptyStringIsFalse(true).zeroIsFalse(true);
return compiler
.emptyStringIsFalse(true)
.zeroIsFalse(true);
}
@Override
@@ -299,14 +282,14 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
}
}
public void setPackageName(String packageName) {
private void setPackageName(String packageName) {
this.packageName = packageName;
// Also set the extern crate name, which has any '-' replace with a '_'.
this.externCrateName = packageName.replace('-', '_');
}
public void setPackageVersion(String packageVersion) {
private void setPackageVersion(String packageVersion) {
this.packageVersion = packageVersion;
}
@@ -332,7 +315,7 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
versionComponents.add("0");
}
setPackageVersion(StringUtils.join(versionComponents, "."));
setPackageVersion(String.join(".", versionComponents));
}
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
@@ -357,13 +340,11 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
@Override
public String toOperationId(String operationId) {
// rust-axum uses camel case instead
return sanitizeIdentifier(operationId, CasingType.CAMEL_CASE, "call", "method", true);
}
@Override
public String toEnumValue(String value, String datatype) {
// rust-axum templates expect value to be in quotes
return "\"" + super.toEnumValue(value, datatype) + "\"";
}
@@ -407,36 +388,9 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List<Server> servers) {
CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers);
String pathFormatString = op.path;
for (CodegenParameter param : op.pathParams) {
// Replace {baseName} with {paramName} for format string
String paramSearch = "{" + param.baseName + "}";
String paramReplace = "{" + param.paramName + "}";
pathFormatString = pathFormatString.replace(paramSearch, paramReplace);
}
op.vendorExtensions.put("x-path-format-string", pathFormatString);
boolean hasPathParams = !op.pathParams.isEmpty();
// String for formatting the path for a client to make a request
String formatPath = op.path;
for (CodegenParameter param : op.pathParams) {
// Replace {baseName} with {paramName} for format string
String paramSearch = "{" + param.baseName + "}";
String paramReplace = "{" + param.paramName + "}";
formatPath = formatPath.replace(paramSearch, paramReplace);
}
String underscoredOperationId = underscore(op.operationId);
op.vendorExtensions.put("x-operation-id", underscoredOperationId);
op.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId.toUpperCase(Locale.ROOT));
String vendorExtensionPath = op.path.replace("{", ":").replace("}", "");
op.vendorExtensions.put("x-path", vendorExtensionPath);
op.vendorExtensions.put("x-has-path-params", hasPathParams);
op.vendorExtensions.put("x-path-format-string", formatPath);
if (!op.isCallbackRequest) {
// group route by path
@@ -453,18 +407,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
.add(new MethodOperation(op.httpMethod.toLowerCase(Locale.ROOT), underscoredOperationId));
}
String vendorExtensionHttpMethod = op.httpMethod.toUpperCase(Locale.ROOT);
op.vendorExtensions.put("x-http-method", vendorExtensionHttpMethod);
if (!op.vendorExtensions.containsKey("x-must-use-response")) {
// If there's more than one response, than by default the user must explicitly handle them
op.vendorExtensions.put("x-must-use-response", op.responses.size() > 1);
}
for (CodegenParameter param : op.allParams) {
processParam(param);
}
// Determine the types that this operation produces. `getProducesInfo`
// simply lists all the types, and then we add the correct imports to
// the generated library.
@@ -472,36 +414,26 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
boolean producesPlainText = false;
boolean producesFormUrlEncoded = false;
if (producesInfo != null && !producesInfo.isEmpty()) {
List<String> produces = new ArrayList<>(producesInfo);
List<Map<String, String>> c = new ArrayList<>();
for (String mimeType : produces) {
Map<String, String> mediaType = new HashMap<>();
List<Map<String, String>> produces = new ArrayList<>(producesInfo.size());
for (String mimeType : producesInfo) {
if (isMimetypeWwwFormUrlEncoded(mimeType)) {
producesFormUrlEncoded = true;
} else if (isMimetypePlain(mimeType)) {
producesPlainText = true;
}
Map<String, String> mediaType = new HashMap<>();
mediaType.put("mediaType", mimeType);
c.add(mediaType);
produces.add(mediaType);
}
op.produces = c;
op.produces = produces;
op.hasProduces = true;
}
for (CodegenParameter param : op.headerParams) {
processParam(param);
// Give header params a name in camel case. CodegenParameters don't have a nameInCamelCase property.
param.vendorExtensions.put("x-type-name", toModelName(param.baseName));
}
// Set for deduplication of response IDs
final Set<String> responseIds = new HashSet<>();
for (CodegenResponse rsp : op.responses) {
// Get the original API response, so we get process the schema
// directly.
@@ -511,46 +443,18 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
} else {
original = operation.getResponses().get(rsp.code);
}
String[] words = rsp.message.split("[^A-Za-z ]");
// Create a unique responseID for this response.
String responseId;
String[] words = rsp.message.split("[^A-Za-z ]");
if (rsp.vendorExtensions.containsKey("x-response-id")) {
// If it's been specified directly, use that.
responseId = (String) rsp.vendorExtensions.get("x-response-id");
} else if ((words.length != 0) && (!words[0].trim().isEmpty())) {
// If there's a description, build it from the description.
responseId = camelize(words[0].replace(" ", "_"));
} else {
// Otherwise fall back to the http response code.
responseId = "Status" + rsp.code;
}
// build responseId from both status code and description
String responseId = "Status" + rsp.code + (
((words.length != 0) && (!words[0].trim().isEmpty())) ?
"_" + camelize(words[0].replace(" ", "_")) : ""
);
// Deduplicate response IDs that would otherwise contain the same
// text. We rely on the ID being unique, but since we form it from
// the raw description field we can't require that the spec writer
// provides unique descriptions.
int idTieBreaker = 2;
while (responseIds.contains(responseId)) {
String trial = String.format(Locale.ROOT, "%s_%d", responseId, idTieBreaker);
if (!responseIds.contains(trial)) {
responseId = trial;
} else {
idTieBreaker++;
}
}
responseIds.add(responseId);
String underscoredResponseId = underscore(responseId).toUpperCase(Locale.ROOT);
rsp.vendorExtensions.put("x-response-id", responseId);
rsp.vendorExtensions.put("x-uppercase-response-id", underscoredResponseId.toUpperCase(Locale.ROOT));
rsp.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId.toUpperCase(Locale.ROOT));
if (rsp.dataType != null) {
String uppercaseDataType = (rsp.dataType.replace("models::", "")).toUpperCase(Locale.ROOT);
rsp.vendorExtensions.put("x-uppercase-data-type", uppercaseDataType);
// Get the mimetype which is produced by this response. Note
// that although in general responses produces a set of
// different mimetypes currently we only support 1 per
@@ -596,11 +500,11 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
}
outputMime = firstProduces;
}
// As we don't support XML, fallback to plain text
if (isMimetypeXml(outputMime)) {
outputMime = plainTextMimeType;
// As we don't support XML, fallback to plain text
if (isMimetypeXml(outputMime)) {
outputMime = plainTextMimeType;
}
}
rsp.vendorExtensions.put("x-mime-type", outputMime);
@@ -633,10 +537,8 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
}
}
}
for (CodegenProperty header : rsp.headers) {
if (uuidType.equals(header.dataType)) {
additionalProperties.put("apiUsesUuid", true);
}
header.nameInCamelCase = toModelName(header.baseName);
header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT);
}
@@ -647,9 +549,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
}
for (CodegenProperty header : op.responseHeaders) {
if (uuidType.equals(header.dataType)) {
additionalProperties.put("apiUsesUuid", true);
}
header.nameInCamelCase = toModelName(header.baseName);
header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT);
}
@@ -657,39 +556,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
return op;
}
private void processParam(CodegenParameter param) {
// If a parameter uses UUIDs, we need to import the UUID package.
if (uuidType.equals(param.dataType)) {
additionalProperties.put("apiUsesUuid", true);
}
if (Boolean.TRUE.equals(param.isFreeFormObject)) {
param.vendorExtensions.put("x-format-string", "{:?}");
} else if (param.isString) {
param.vendorExtensions.put("x-format-string", "\\\"{}\\\"");
} else if (param.isPrimitiveType) {
if ((param.isByteArray) || (param.isBinary)) {
// Binary primitive types don't implement `Display`.
param.vendorExtensions.put("x-format-string", "{:?}");
} else {
param.vendorExtensions.put("x-format-string", "{}");
}
} else if (param.isArray) {
param.vendorExtensions.put("x-format-string", "{:?}");
} else {
param.vendorExtensions.put("x-format-string", "{:?}");
}
if (!param.required) {
if ((("date-time".equals(param.dataFormat)) || ("date".equals(param.dataFormat)))) {
param.vendorExtensions.put("x-format-string", "{:?}");
} else {
// Not required, so override the format string and example
param.vendorExtensions.put("x-format-string", "{:?}");
}
}
}
@Override
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels) {
OperationMap operations = objs.getOperations();
@@ -719,21 +585,14 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
consumesPlainText = true;
} else if (isMimetypeMultipartFormData(mediaType)) {
op.vendorExtensions.put("x-consumes-multipart", true);
additionalProperties.put("apiUsesMultipartFormData", true);
additionalProperties.put("apiUsesMultipart", true);
} else if (isMimetypeMultipartRelated(mediaType)) {
op.vendorExtensions.put("x-consumes-multipart-related", true);
additionalProperties.put("apiUsesMultipartRelated", true);
additionalProperties.put("apiUsesMultipart", true);
}
}
}
}
String underscoredOperationId = underscore(op.operationId).toUpperCase(Locale.ROOT);
if (op.bodyParam != null) {
// Default to consuming json
op.bodyParam.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId);
if (consumesJson) {
op.bodyParam.vendorExtensions.put("x-consumes-json", true);
} else if (consumesFormUrlEncoded) {
@@ -746,10 +605,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
}
for (CodegenParameter param : op.bodyParams) {
processParam(param);
param.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId);
// Default to producing json if nothing else is specified
if (consumesJson) {
param.vendorExtensions.put("x-consumes-json", true);
@@ -769,40 +624,14 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
}
}
for (CodegenParameter param : op.formParams) {
processParam(param);
}
for (CodegenParameter header : op.headerParams) {
header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT);
}
for (CodegenProperty header : op.responseHeaders) {
if (uuidType.equals(header.dataType)) {
additionalProperties.put("apiUsesUuid", true);
}
header.nameInCamelCase = toModelName(header.baseName);
header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT);
}
if (op.authMethods != null) {
boolean headerAuthMethods = false;
for (CodegenSecurity s : op.authMethods) {
if (s.isApiKey && s.isKeyInHeader) {
s.vendorExtensions.put("x-api-key-name", toModelName(s.keyParamName));
headerAuthMethods = true;
}
if (s.isBasicBasic || s.isBasicBearer || s.isOAuth) {
headerAuthMethods = true;
}
}
if (headerAuthMethods) {
op.vendorExtensions.put("x-has-header-auth-methods", "true");
}
}
}
@Override
@@ -816,22 +645,22 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
* @param tag name of the tag
* @param resourcePath path of the resource
* @param operation OAS Operation object
* @param co Codegen Operation object
* @param op Codegen Operation object
* @param operations map of Codegen operations
*/
@SuppressWarnings("static-method")
@Override
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation
co, Map<String, List<CodegenOperation>> operations) {
op, Map<String, List<CodegenOperation>> operations) {
// only generate operation for the first tag of the tags
if (tag != null && co.tags.size() > 1) {
String expectedTag = sanitizeTag(co.tags.get(0).getName());
if (tag != null && op.tags.size() > 1) {
String expectedTag = sanitizeTag(op.tags.get(0).getName());
if (!tag.equals(expectedTag)) {
LOGGER.info("generated skip additional tag `{}` with operationId={}", tag, co.operationId);
LOGGER.info("generated skip additional tag `{}` with operationId={}", tag, op.operationId);
return;
}
}
super.addOperationToGroup(tag, resourcePath, operation, co, operations);
super.addOperationToGroup(tag, resourcePath, operation, op, operations);
}
// This is a really terrible hack. We're working around the fact that the
@@ -855,16 +684,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
codegenParameter.isArray = false;
codegenParameter.isString = false;
codegenParameter.isByteArray = ModelUtils.isByteArraySchema(original_schema);
// This is a model, so should only have an example if explicitly
// defined.
if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) {
codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example"));
} else if (!codegenParameter.required) {
//mandatory parameter use the example in the yaml. if no example, it is also null.
codegenParameter.example = null;
}
}
return codegenParameter;
@@ -952,41 +771,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
return mdl;
}
@Override
public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs) {
Map<String, ModelsMap> newObjs = super.postProcessAllModels(objs);
//Index all CodegenModels by model name.
HashMap<String, CodegenModel> allModels = new HashMap<>();
for (Map.Entry<String, ModelsMap> entry : objs.entrySet()) {
String modelName = toModelName(entry.getKey());
List<ModelMap> models = entry.getValue().getModels();
for (ModelMap mo : models) {
allModels.put(modelName, mo.getModel());
}
}
for (Map.Entry<String, CodegenModel> entry : allModels.entrySet()) {
CodegenModel model = entry.getValue();
if (uuidType.equals(model.dataType)) {
additionalProperties.put("apiUsesUuid", true);
}
for (CodegenProperty prop : model.vars) {
if (uuidType.equals(prop.dataType)) {
additionalProperties.put("apiUsesUuid", true);
}
if (uuidType.equals(prop.dataType)) {
additionalProperties.put("apiUsesUuid", true);
}
}
}
return newObjs;
}
@Override
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> bundle) {
generateYAMLSpecFile(bundle);
@@ -1034,28 +818,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
return defaultValue;
}
@Override
public String toOneOfName(List<String> names, Schema composedSchema) {
List<Schema> schemas = ModelUtils.getInterfaces(composedSchema);
List<String> types = new ArrayList<>();
for (Schema s : schemas) {
types.add(getTypeDeclaration(s));
}
return "swagger::OneOf" + types.size() + "<" + String.join(",", types) + ">";
}
@Override
public String toAnyOfName(List<String> names, Schema composedSchema) {
List<Schema> schemas = ModelUtils.getInterfaces(composedSchema);
List<String> types = new ArrayList<>();
for (Schema s : schemas) {
types.add(getTypeDeclaration(s));
}
return "swagger::AnyOf" + types.size() + "<" + String.join(",", types) + ">";
}
@Override
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
super.postProcessModelProperty(model, property);

View File

@@ -1,8 +1,6 @@
#[derive(Debug, PartialEq, Serialize, Deserialize)]
{{#vendorExtensions.x-must-use-response}}
#[must_use]
#[allow(clippy::large_enum_variant)]
{{/vendorExtensions.x-must-use-response}}
pub enum {{{operationId}}}Response {
{{#responses}}
{{#message}}

View File

@@ -23,21 +23,27 @@ pub const BASE_PATH: &str = "";
pub const API_VERSION: &str = "1.0.7";
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum MultipartRelatedRequestPostResponse {
/// OK
OK,
Status201_OK,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum MultipartRequestPostResponse {
/// OK
OK,
Status201_OK,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum MultipleIdenticalMimeTypesPostResponse {
/// OK
OK,
Status200_OK,
}
/// API

View File

@@ -77,7 +77,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
MultipartRelatedRequestPostResponse::OK => {
MultipartRelatedRequestPostResponse::Status201_OK => {
let mut response = response.status(201);
response.body(Body::empty())
}
@@ -134,7 +134,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
MultipartRequestPostResponse::OK => {
MultipartRequestPostResponse::Status201_OK => {
let mut response = response.status(201);
response.body(Body::empty())
}
@@ -192,7 +192,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
MultipleIdenticalMimeTypesPostResponse::OK => {
MultipleIdenticalMimeTypesPostResponse::Status200_OK => {
let mut response = response.status(200);
response.body(Body::empty())
}

View File

@@ -27,47 +27,59 @@ pub const API_VERSION: &str = "1.0.7";
#[allow(clippy::large_enum_variant)]
pub enum AnyOfGetResponse {
/// Success
Success(models::AnyOfObject),
Status200_Success(models::AnyOfObject),
/// AlternateSuccess
AlternateSuccess(models::Model12345AnyOfObject),
Status201_AlternateSuccess(models::Model12345AnyOfObject),
/// AnyOfSuccess
AnyOfSuccess(models::AnyOfGet202Response),
Status202_AnyOfSuccess(models::AnyOfGet202Response),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CallbackWithHeaderPostResponse {
/// OK
OK,
Status204_OK,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum ComplexQueryParamGetResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum EnumInPathPathParamGetResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum JsonComplexQueryParamGetResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum MandatoryRequestHeaderGetResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum MergePatchJsonGetResponse {
/// merge-patch+json-encoded response
Merge(models::AnotherXmlObject),
Status200_Merge(models::AnotherXmlObject),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -75,61 +87,75 @@ pub enum MergePatchJsonGetResponse {
#[allow(clippy::large_enum_variant)]
pub enum MultigetGetResponse {
/// JSON rsp
JSONRsp(models::AnotherXmlObject),
Status200_JSONRsp(models::AnotherXmlObject),
/// XML rsp
XMLRsp(String),
Status201_XMLRsp(String),
/// octet rsp
OctetRsp(ByteArray),
Status202_OctetRsp(ByteArray),
/// string rsp
StringRsp(String),
Status203_StringRsp(String),
/// Duplicate Response long text. One.
DuplicateResponseLongText(models::AnotherXmlObject),
Status204_DuplicateResponseLongText(models::AnotherXmlObject),
/// Duplicate Response long text. Two.
DuplicateResponseLongText_2(models::AnotherXmlObject),
Status205_DuplicateResponseLongText(models::AnotherXmlObject),
/// Duplicate Response long text. Three.
DuplicateResponseLongText_3(models::AnotherXmlObject),
Status206_DuplicateResponseLongText(models::AnotherXmlObject),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum MultipleAuthSchemeGetResponse {
/// Check that limiting to multiple required auth schemes works
CheckThatLimitingToMultipleRequiredAuthSchemesWorks,
Status200_CheckThatLimitingToMultipleRequiredAuthSchemesWorks,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum OneOfGetResponse {
/// Success
Success(models::OneOfGet200Response),
Status200_Success(models::OneOfGet200Response),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum OverrideServerGetResponse {
/// Success.
Success,
Status204_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum ParamgetGetResponse {
/// JSON rsp
JSONRsp(models::AnotherXmlObject),
Status200_JSONRsp(models::AnotherXmlObject),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum ReadonlyAuthSchemeGetResponse {
/// Check that limiting to a single required auth scheme works
CheckThatLimitingToASingleRequiredAuthSchemeWorks,
Status200_CheckThatLimitingToASingleRequiredAuthSchemeWorks,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum RegisterCallbackPostResponse {
/// OK
OK,
Status204_OK,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum RequiredOctetStreamPutResponse {
/// OK
OK,
Status200_OK,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -137,14 +163,14 @@ pub enum RequiredOctetStreamPutResponse {
#[allow(clippy::large_enum_variant)]
pub enum ResponsesWithHeadersGetResponse {
/// Success
Success {
Status200_Success {
body: String,
success_info: String,
bool_header: Option<bool>,
object_header: Option<models::ObjectHeader>,
},
/// Precondition Failed
PreconditionFailed {
Status412_PreconditionFailed {
further_info: Option<String>,
failure_info: Option<String>,
},
@@ -155,23 +181,27 @@ pub enum ResponsesWithHeadersGetResponse {
#[allow(clippy::large_enum_variant)]
pub enum Rfc7807GetResponse {
/// OK
OK(models::ObjectWithArrayOfObjects),
Status204_OK(models::ObjectWithArrayOfObjects),
/// NotFound
NotFound(models::ObjectWithArrayOfObjects),
Status404_NotFound(models::ObjectWithArrayOfObjects),
/// NotAcceptable
NotAcceptable(String),
Status406_NotAcceptable(String),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum UntypedPropertyGetResponse {
/// Check that untyped properties works
CheckThatUntypedPropertiesWorks,
Status200_CheckThatUntypedPropertiesWorks,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum UuidGetResponse {
/// Duplicate Response long text. One.
DuplicateResponseLongText(uuid::Uuid),
Status200_DuplicateResponseLongText(uuid::Uuid),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -179,9 +209,9 @@ pub enum UuidGetResponse {
#[allow(clippy::large_enum_variant)]
pub enum XmlExtraPostResponse {
/// OK
OK,
Status201_OK,
/// Bad Request
BadRequest,
Status400_BadRequest,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -189,9 +219,9 @@ pub enum XmlExtraPostResponse {
#[allow(clippy::large_enum_variant)]
pub enum XmlOtherPostResponse {
/// OK
OK(String),
Status201_OK(String),
/// Bad Request
BadRequest,
Status400_BadRequest,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -199,9 +229,9 @@ pub enum XmlOtherPostResponse {
#[allow(clippy::large_enum_variant)]
pub enum XmlOtherPutResponse {
/// OK
OK,
Status201_OK,
/// Bad Request
BadRequest,
Status400_BadRequest,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -209,9 +239,9 @@ pub enum XmlOtherPutResponse {
#[allow(clippy::large_enum_variant)]
pub enum XmlPostResponse {
/// OK
OK,
Status201_OK,
/// Bad Request
BadRequest,
Status400_BadRequest,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -219,21 +249,25 @@ pub enum XmlPostResponse {
#[allow(clippy::large_enum_variant)]
pub enum XmlPutResponse {
/// OK
OK,
Status201_OK,
/// Bad Request
BadRequest,
Status400_BadRequest,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CreateRepoResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum GetRepoInfoResponse {
/// OK
OK(String),
Status200_OK(String),
}
/// API

View File

@@ -128,7 +128,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
AnyOfGetResponse::Success(body) => {
AnyOfGetResponse::Status200_Success(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -151,7 +151,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
AnyOfGetResponse::AlternateSuccess(body) => {
AnyOfGetResponse::Status201_AlternateSuccess(body) => {
let mut response = response.status(201);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -174,7 +174,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
AnyOfGetResponse::AnyOfSuccess(body) => {
AnyOfGetResponse::Status202_AnyOfSuccess(body) => {
let mut response = response.status(202);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -251,7 +251,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CallbackWithHeaderPostResponse::OK => {
CallbackWithHeaderPostResponse::Status204_OK => {
let mut response = response.status(204);
response.body(Body::empty())
}
@@ -309,7 +309,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
ComplexQueryParamGetResponse::Success => {
ComplexQueryParamGetResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -367,7 +367,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
EnumInPathPathParamGetResponse::Success => {
EnumInPathPathParamGetResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -425,7 +425,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
JsonComplexQueryParamGetResponse::Success => {
JsonComplexQueryParamGetResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -516,7 +516,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
MandatoryRequestHeaderGetResponse::Success => {
MandatoryRequestHeaderGetResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -569,7 +569,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
MergePatchJsonGetResponse::Merge(body) => {
MergePatchJsonGetResponse::Status200_Merge(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -638,7 +638,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
MultigetGetResponse::JSONRsp(body) => {
MultigetGetResponse::Status200_JSONRsp(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -661,7 +661,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
MultigetGetResponse::XMLRsp(body) => {
MultigetGetResponse::Status201_XMLRsp(body) => {
let mut response = response.status(201);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -677,7 +677,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
MultigetGetResponse::OctetRsp(body) => {
MultigetGetResponse::Status202_OctetRsp(body) => {
let mut response = response.status(202);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -693,7 +693,7 @@ where
let body_content = body.0;
response.body(Body::from(body_content))
}
MultigetGetResponse::StringRsp(body) => {
MultigetGetResponse::Status203_StringRsp(body) => {
let mut response = response.status(203);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -709,7 +709,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
MultigetGetResponse::DuplicateResponseLongText(body) => {
MultigetGetResponse::Status204_DuplicateResponseLongText(body) => {
let mut response = response.status(204);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -732,7 +732,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
MultigetGetResponse::DuplicateResponseLongText_2(body) => {
MultigetGetResponse::Status205_DuplicateResponseLongText(body) => {
let mut response = response.status(205);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -755,7 +755,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
MultigetGetResponse::DuplicateResponseLongText_3(body) => {
MultigetGetResponse::Status206_DuplicateResponseLongText(body) => {
let mut response = response.status(206);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -826,18 +826,20 @@ where
let mut response = Response::builder();
let resp = match result {
Ok(rsp) => match rsp {
MultipleAuthSchemeGetResponse::CheckThatLimitingToMultipleRequiredAuthSchemesWorks => {
let mut response = response.status(200);
response.body(Body::empty())
}
},
Err(_) => {
// Application code returned an error. This should not happen, as the implementation should
// return a valid response.
response.status(500).body(Body::empty())
}
};
Ok(rsp) => match rsp {
MultipleAuthSchemeGetResponse::Status200_CheckThatLimitingToMultipleRequiredAuthSchemesWorks
=> {
let mut response = response.status(200);
response.body(Body::empty())
},
},
Err(_) => {
// Application code returned an error. This should not happen, as the implementation should
// return a valid response.
response.status(500).body(Body::empty())
},
};
resp.map_err(|e| {
error!(error = ?e);
@@ -877,7 +879,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
OneOfGetResponse::Success(body) => {
OneOfGetResponse::Status200_Success(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -949,7 +951,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
OverrideServerGetResponse::Success => {
OverrideServerGetResponse::Status204_Success => {
let mut response = response.status(204);
response.body(Body::empty())
}
@@ -1007,7 +1009,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
ParamgetGetResponse::JSONRsp(body) => {
ParamgetGetResponse::Status200_JSONRsp(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1078,18 +1080,20 @@ where
let mut response = Response::builder();
let resp = match result {
Ok(rsp) => match rsp {
ReadonlyAuthSchemeGetResponse::CheckThatLimitingToASingleRequiredAuthSchemeWorks => {
let mut response = response.status(200);
response.body(Body::empty())
}
},
Err(_) => {
// Application code returned an error. This should not happen, as the implementation should
// return a valid response.
response.status(500).body(Body::empty())
}
};
Ok(rsp) => match rsp {
ReadonlyAuthSchemeGetResponse::Status200_CheckThatLimitingToASingleRequiredAuthSchemeWorks
=> {
let mut response = response.status(200);
response.body(Body::empty())
},
},
Err(_) => {
// Application code returned an error. This should not happen, as the implementation should
// return a valid response.
response.status(500).body(Body::empty())
},
};
resp.map_err(|e| {
error!(error = ?e);
@@ -1137,7 +1141,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
RegisterCallbackPostResponse::OK => {
RegisterCallbackPostResponse::Status204_OK => {
let mut response = response.status(204);
response.body(Body::empty())
}
@@ -1199,7 +1203,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
RequiredOctetStreamPutResponse::OK => {
RequiredOctetStreamPutResponse::Status200_OK => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -1252,7 +1256,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
ResponsesWithHeadersGetResponse::Success {
ResponsesWithHeadersGetResponse::Status200_Success {
body,
success_info,
bool_header,
@@ -1326,7 +1330,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
ResponsesWithHeadersGetResponse::PreconditionFailed {
ResponsesWithHeadersGetResponse::Status412_PreconditionFailed {
further_info,
failure_info,
} => {
@@ -1412,7 +1416,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Rfc7807GetResponse::OK(body) => {
Rfc7807GetResponse::Status204_OK(body) => {
let mut response = response.status(204);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1435,7 +1439,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
Rfc7807GetResponse::NotFound(body) => {
Rfc7807GetResponse::Status404_NotFound(body) => {
let mut response = response.status(404);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1458,7 +1462,7 @@ where
.unwrap()?;
response.body(Body::from(body_content))
}
Rfc7807GetResponse::NotAcceptable(body) => {
Rfc7807GetResponse::Status406_NotAcceptable(body) => {
let mut response = response.status(406);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1538,7 +1542,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UntypedPropertyGetResponse::CheckThatUntypedPropertiesWorks => {
UntypedPropertyGetResponse::Status200_CheckThatUntypedPropertiesWorks => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -1588,7 +1592,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UuidGetResponse::DuplicateResponseLongText(body) => {
UuidGetResponse::Status200_DuplicateResponseLongText(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1667,11 +1671,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
XmlExtraPostResponse::OK => {
XmlExtraPostResponse::Status201_OK => {
let mut response = response.status(201);
response.body(Body::empty())
}
XmlExtraPostResponse::BadRequest => {
XmlExtraPostResponse::Status400_BadRequest => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1731,7 +1735,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
XmlOtherPostResponse::OK(body) => {
XmlOtherPostResponse::Status201_OK(body) => {
let mut response = response.status(201);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1747,7 +1751,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
XmlOtherPostResponse::BadRequest => {
XmlOtherPostResponse::Status400_BadRequest => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1807,11 +1811,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
XmlOtherPutResponse::OK => {
XmlOtherPutResponse::Status201_OK => {
let mut response = response.status(201);
response.body(Body::empty())
}
XmlOtherPutResponse::BadRequest => {
XmlOtherPutResponse::Status400_BadRequest => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1871,11 +1875,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
XmlPostResponse::OK => {
XmlPostResponse::Status201_OK => {
let mut response = response.status(201);
response.body(Body::empty())
}
XmlPostResponse::BadRequest => {
XmlPostResponse::Status400_BadRequest => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1932,11 +1936,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
XmlPutResponse::OK => {
XmlPutResponse::Status201_OK => {
let mut response = response.status(201);
response.body(Body::empty())
}
XmlPutResponse::BadRequest => {
XmlPutResponse::Status400_BadRequest => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -2002,7 +2006,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CreateRepoResponse::Success => {
CreateRepoResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -2060,7 +2064,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetRepoInfoResponse::OK(body) => {
GetRepoInfoResponse::Status200_OK(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();

View File

@@ -15,225 +15,299 @@ pub const BASE_PATH: &str = "";
pub const API_VERSION: &str = "0.0.1";
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op10GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op11GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op12GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op13GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op14GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op15GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op16GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op17GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op18GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op19GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op1GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op20GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op21GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op22GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op23GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op24GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op25GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op26GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op27GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op28GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op29GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op2GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op30GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op31GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op32GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op33GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op34GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op35GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op36GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op37GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op3GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op4GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op5GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op6GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op7GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op8GetResponse {
/// OK
OK
Status200_OK
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Op9GetResponse {
/// OK
OK
Status200_OK
}

View File

@@ -222,7 +222,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op10GetResponse::OK
Op10GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -287,7 +287,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op11GetResponse::OK
Op11GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -352,7 +352,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op12GetResponse::OK
Op12GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -417,7 +417,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op13GetResponse::OK
Op13GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -482,7 +482,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op14GetResponse::OK
Op14GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -547,7 +547,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op15GetResponse::OK
Op15GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -612,7 +612,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op16GetResponse::OK
Op16GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -677,7 +677,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op17GetResponse::OK
Op17GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -742,7 +742,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op18GetResponse::OK
Op18GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -807,7 +807,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op19GetResponse::OK
Op19GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -872,7 +872,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op1GetResponse::OK
Op1GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -937,7 +937,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op20GetResponse::OK
Op20GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1002,7 +1002,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op21GetResponse::OK
Op21GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1067,7 +1067,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op22GetResponse::OK
Op22GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1132,7 +1132,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op23GetResponse::OK
Op23GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1197,7 +1197,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op24GetResponse::OK
Op24GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1262,7 +1262,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op25GetResponse::OK
Op25GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1327,7 +1327,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op26GetResponse::OK
Op26GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1392,7 +1392,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op27GetResponse::OK
Op27GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1457,7 +1457,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op28GetResponse::OK
Op28GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1522,7 +1522,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op29GetResponse::OK
Op29GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1587,7 +1587,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op2GetResponse::OK
Op2GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1652,7 +1652,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op30GetResponse::OK
Op30GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1717,7 +1717,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op31GetResponse::OK
Op31GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1782,7 +1782,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op32GetResponse::OK
Op32GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1847,7 +1847,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op33GetResponse::OK
Op33GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1912,7 +1912,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op34GetResponse::OK
Op34GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -1977,7 +1977,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op35GetResponse::OK
Op35GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2042,7 +2042,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op36GetResponse::OK
Op36GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2107,7 +2107,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op37GetResponse::OK
Op37GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2172,7 +2172,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op3GetResponse::OK
Op3GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2237,7 +2237,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op4GetResponse::OK
Op4GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2302,7 +2302,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op5GetResponse::OK
Op5GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2367,7 +2367,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op6GetResponse::OK
Op6GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2432,7 +2432,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op7GetResponse::OK
Op7GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2497,7 +2497,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op8GetResponse::OK
Op8GetResponse::Status200_OK
=> {
let mut response = response.status(200);
@@ -2562,7 +2562,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Op9GetResponse::OK
Op9GetResponse::Status200_OK
=> {
let mut response = response.status(200);

View File

@@ -23,63 +23,83 @@ pub const BASE_PATH: &str = "/v2";
pub const API_VERSION: &str = "1.0.0";
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum TestSpecialTagsResponse {
/// successful operation
SuccessfulOperation(models::Client),
Status200_SuccessfulOperation(models::Client),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum Call123exampleResponse {
/// success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum FakeOuterBooleanSerializeResponse {
/// Output boolean
OutputBoolean(bool),
Status200_OutputBoolean(bool),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum FakeOuterCompositeSerializeResponse {
/// Output composite
OutputComposite(models::OuterComposite),
Status200_OutputComposite(models::OuterComposite),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum FakeOuterNumberSerializeResponse {
/// Output number
OutputNumber(f64),
Status200_OutputNumber(f64),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum FakeOuterStringSerializeResponse {
/// Output string
OutputString(String),
Status200_OutputString(String),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum FakeResponseWithNumericalDescriptionResponse {
/// 1234
Status200,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum HyphenParamResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum TestBodyWithQueryParamsResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum TestClientModelResponse {
/// successful operation
SuccessfulOperation(models::Client),
Status200_SuccessfulOperation(models::Client),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -87,9 +107,9 @@ pub enum TestClientModelResponse {
#[allow(clippy::large_enum_variant)]
pub enum TestEndpointParametersResponse {
/// Invalid username supplied
InvalidUsernameSupplied,
Status400_InvalidUsernameSupplied,
/// User not found
UserNotFound,
Status404_UserNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -97,39 +117,49 @@ pub enum TestEndpointParametersResponse {
#[allow(clippy::large_enum_variant)]
pub enum TestEnumParametersResponse {
/// Invalid request
InvalidRequest,
Status400_InvalidRequest,
/// Not found
NotFound,
Status404_NotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum TestInlineAdditionalPropertiesResponse {
/// successful operation
SuccessfulOperation,
Status200_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum TestJsonFormDataResponse {
/// successful operation
SuccessfulOperation,
Status200_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum TestClassnameResponse {
/// successful operation
SuccessfulOperation(models::Client),
Status200_SuccessfulOperation(models::Client),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum AddPetResponse {
/// Invalid input
InvalidInput,
Status405_InvalidInput,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum DeletePetResponse {
/// Invalid pet value
InvalidPetValue,
Status400_InvalidPetValue,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -137,9 +167,9 @@ pub enum DeletePetResponse {
#[allow(clippy::large_enum_variant)]
pub enum FindPetsByStatusResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid status value
InvalidStatusValue,
Status400_InvalidStatusValue,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -147,9 +177,9 @@ pub enum FindPetsByStatusResponse {
#[allow(clippy::large_enum_variant)]
pub enum FindPetsByTagsResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid tag value
InvalidTagValue,
Status400_InvalidTagValue,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -157,11 +187,11 @@ pub enum FindPetsByTagsResponse {
#[allow(clippy::large_enum_variant)]
pub enum GetPetByIdResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Pet not found
PetNotFound,
Status404_PetNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -169,23 +199,27 @@ pub enum GetPetByIdResponse {
#[allow(clippy::large_enum_variant)]
pub enum UpdatePetResponse {
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Pet not found
PetNotFound,
Status404_PetNotFound,
/// Validation exception
ValidationException,
Status405_ValidationException,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum UpdatePetWithFormResponse {
/// Invalid input
InvalidInput,
Status405_InvalidInput,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum UploadFileResponse {
/// successful operation
SuccessfulOperation(models::ApiResponse),
Status200_SuccessfulOperation(models::ApiResponse),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -193,15 +227,17 @@ pub enum UploadFileResponse {
#[allow(clippy::large_enum_variant)]
pub enum DeleteOrderResponse {
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Order not found
OrderNotFound,
Status404_OrderNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum GetInventoryResponse {
/// successful operation
SuccessfulOperation(std::collections::HashMap<String, i32>),
Status200_SuccessfulOperation(std::collections::HashMap<String, i32>),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -209,11 +245,11 @@ pub enum GetInventoryResponse {
#[allow(clippy::large_enum_variant)]
pub enum GetOrderByIdResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Order not found
OrderNotFound,
Status404_OrderNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -221,27 +257,33 @@ pub enum GetOrderByIdResponse {
#[allow(clippy::large_enum_variant)]
pub enum PlaceOrderResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid Order
InvalidOrder,
Status400_InvalidOrder,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CreateUserResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CreateUsersWithArrayInputResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CreateUsersWithListInputResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -249,9 +291,9 @@ pub enum CreateUsersWithListInputResponse {
#[allow(clippy::large_enum_variant)]
pub enum DeleteUserResponse {
/// Invalid username supplied
InvalidUsernameSupplied,
Status400_InvalidUsernameSupplied,
/// User not found
UserNotFound,
Status404_UserNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -259,11 +301,11 @@ pub enum DeleteUserResponse {
#[allow(clippy::large_enum_variant)]
pub enum GetUserByNameResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid username supplied
InvalidUsernameSupplied,
Status400_InvalidUsernameSupplied,
/// User not found
UserNotFound,
Status404_UserNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -271,19 +313,21 @@ pub enum GetUserByNameResponse {
#[allow(clippy::large_enum_variant)]
pub enum LoginUserResponse {
/// successful operation
SuccessfulOperation {
Status200_SuccessfulOperation {
body: String,
x_rate_limit: Option<i32>,
x_expires_after: Option<chrono::DateTime<chrono::Utc>>,
},
/// Invalid username/password supplied
InvalidUsername,
Status400_InvalidUsername,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum LogoutUserResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -291,9 +335,9 @@ pub enum LogoutUserResponse {
#[allow(clippy::large_enum_variant)]
pub enum UpdateUserResponse {
/// Invalid user supplied
InvalidUserSupplied,
Status400_InvalidUserSupplied,
/// User not found
UserNotFound,
Status404_UserNotFound,
}
/// API

View File

@@ -166,7 +166,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestSpecialTagsResponse::SuccessfulOperation(body) => {
TestSpecialTagsResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -241,7 +241,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
Call123exampleResponse::Success => {
Call123exampleResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -313,7 +313,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FakeOuterBooleanSerializeResponse::OutputBoolean(body) => {
FakeOuterBooleanSerializeResponse::Status200_OutputBoolean(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -404,7 +404,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FakeOuterCompositeSerializeResponse::OutputComposite(body) => {
FakeOuterCompositeSerializeResponse::Status200_OutputComposite(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -495,7 +495,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FakeOuterNumberSerializeResponse::OutputNumber(body) => {
FakeOuterNumberSerializeResponse::Status200_OutputNumber(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -586,7 +586,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FakeOuterStringSerializeResponse::OutputString(body) => {
FakeOuterStringSerializeResponse::Status200_OutputString(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -724,7 +724,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
HyphenParamResponse::Success => {
HyphenParamResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -799,7 +799,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestBodyWithQueryParamsResponse::Success => {
TestBodyWithQueryParamsResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -868,7 +868,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestClientModelResponse::SuccessfulOperation(body) => {
TestClientModelResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -943,11 +943,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestEndpointParametersResponse::InvalidUsernameSupplied => {
TestEndpointParametersResponse::Status400_InvalidUsernameSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
TestEndpointParametersResponse::UserNotFound => {
TestEndpointParametersResponse::Status404_UserNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -1069,11 +1069,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestEnumParametersResponse::InvalidRequest => {
TestEnumParametersResponse::Status400_InvalidRequest => {
let mut response = response.status(400);
response.body(Body::empty())
}
TestEnumParametersResponse::NotFound => {
TestEnumParametersResponse::Status404_NotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -1142,7 +1142,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestInlineAdditionalPropertiesResponse::SuccessfulOperation => {
TestInlineAdditionalPropertiesResponse::Status200_SuccessfulOperation => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -1198,7 +1198,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestJsonFormDataResponse::SuccessfulOperation => {
TestJsonFormDataResponse::Status200_SuccessfulOperation => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -1267,7 +1267,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
TestClassnameResponse::SuccessfulOperation(body) => {
TestClassnameResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1350,7 +1350,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
AddPetResponse::InvalidInput => {
AddPetResponse::Status405_InvalidInput => {
let mut response = response.status(405);
response.body(Body::empty())
}
@@ -1443,7 +1443,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DeletePetResponse::InvalidPetValue => {
DeletePetResponse::Status400_InvalidPetValue => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1505,7 +1505,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FindPetsByStatusResponse::SuccessfulOperation(body) => {
FindPetsByStatusResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1521,7 +1521,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
FindPetsByStatusResponse::InvalidStatusValue => {
FindPetsByStatusResponse::Status400_InvalidStatusValue => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1583,7 +1583,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FindPetsByTagsResponse::SuccessfulOperation(body) => {
FindPetsByTagsResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1599,7 +1599,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
FindPetsByTagsResponse::InvalidTagValue => {
FindPetsByTagsResponse::Status400_InvalidTagValue => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1660,7 +1660,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetPetByIdResponse::SuccessfulOperation(body) => {
GetPetByIdResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1676,11 +1676,11 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
GetPetByIdResponse::InvalidIDSupplied => {
GetPetByIdResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
GetPetByIdResponse::PetNotFound => {
GetPetByIdResponse::Status404_PetNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -1749,15 +1749,15 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UpdatePetResponse::InvalidIDSupplied => {
UpdatePetResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
UpdatePetResponse::PetNotFound => {
UpdatePetResponse::Status404_PetNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
UpdatePetResponse::ValidationException => {
UpdatePetResponse::Status405_ValidationException => {
let mut response = response.status(405);
response.body(Body::empty())
}
@@ -1819,7 +1819,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UpdatePetWithFormResponse::InvalidInput => {
UpdatePetWithFormResponse::Status405_InvalidInput => {
let mut response = response.status(405);
response.body(Body::empty())
}
@@ -1881,7 +1881,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UploadFileResponse::SuccessfulOperation(body) => {
UploadFileResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1961,11 +1961,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DeleteOrderResponse::InvalidIDSupplied => {
DeleteOrderResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
DeleteOrderResponse::OrderNotFound => {
DeleteOrderResponse::Status404_OrderNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -2018,7 +2018,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetInventoryResponse::SuccessfulOperation(body) => {
GetInventoryResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -2098,7 +2098,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetOrderByIdResponse::SuccessfulOperation(body) => {
GetOrderByIdResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -2114,11 +2114,11 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
GetOrderByIdResponse::InvalidIDSupplied => {
GetOrderByIdResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
GetOrderByIdResponse::OrderNotFound => {
GetOrderByIdResponse::Status404_OrderNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -2187,7 +2187,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
PlaceOrderResponse::SuccessfulOperation(body) => {
PlaceOrderResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -2203,7 +2203,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
PlaceOrderResponse::InvalidOrder => {
PlaceOrderResponse::Status400_InvalidOrder => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -2272,7 +2272,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CreateUserResponse::SuccessfulOperation => {
CreateUserResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -2342,7 +2342,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CreateUsersWithArrayInputResponse::SuccessfulOperation => {
CreateUsersWithArrayInputResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -2412,7 +2412,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CreateUsersWithListInputResponse::SuccessfulOperation => {
CreateUsersWithListInputResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -2473,11 +2473,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DeleteUserResponse::InvalidUsernameSupplied => {
DeleteUserResponse::Status400_InvalidUsernameSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
DeleteUserResponse::UserNotFound => {
DeleteUserResponse::Status404_UserNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -2538,7 +2538,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetUserByNameResponse::SuccessfulOperation(body) => {
GetUserByNameResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -2554,11 +2554,11 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
GetUserByNameResponse::InvalidUsernameSupplied => {
GetUserByNameResponse::Status400_InvalidUsernameSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
GetUserByNameResponse::UserNotFound => {
GetUserByNameResponse::Status404_UserNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -2619,7 +2619,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
LoginUserResponse::SuccessfulOperation {
LoginUserResponse::Status200_SuccessfulOperation {
body,
x_rate_limit,
x_expires_after,
@@ -2673,7 +2673,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
LoginUserResponse::InvalidUsername => {
LoginUserResponse::Status400_InvalidUsername => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -2726,7 +2726,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
LogoutUserResponse::SuccessfulOperation => {
LogoutUserResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -2798,11 +2798,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UpdateUserResponse::InvalidUserSupplied => {
UpdateUserResponse::Status400_InvalidUserSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
UpdateUserResponse::UserNotFound => {
UpdateUserResponse::Status404_UserNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}

View File

@@ -27,15 +27,17 @@ pub const API_VERSION: &str = "1.0.0";
#[allow(clippy::large_enum_variant)]
pub enum AddPetResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid input
InvalidInput,
Status405_InvalidInput,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum DeletePetResponse {
/// Invalid pet value
InvalidPetValue,
Status400_InvalidPetValue,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -43,9 +45,9 @@ pub enum DeletePetResponse {
#[allow(clippy::large_enum_variant)]
pub enum FindPetsByStatusResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid status value
InvalidStatusValue,
Status400_InvalidStatusValue,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -53,9 +55,9 @@ pub enum FindPetsByStatusResponse {
#[allow(clippy::large_enum_variant)]
pub enum FindPetsByTagsResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid tag value
InvalidTagValue,
Status400_InvalidTagValue,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -63,11 +65,11 @@ pub enum FindPetsByTagsResponse {
#[allow(clippy::large_enum_variant)]
pub enum GetPetByIdResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Pet not found
PetNotFound,
Status404_PetNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -75,25 +77,29 @@ pub enum GetPetByIdResponse {
#[allow(clippy::large_enum_variant)]
pub enum UpdatePetResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Pet not found
PetNotFound,
Status404_PetNotFound,
/// Validation exception
ValidationException,
Status405_ValidationException,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum UpdatePetWithFormResponse {
/// Invalid input
InvalidInput,
Status405_InvalidInput,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum UploadFileResponse {
/// successful operation
SuccessfulOperation(models::ApiResponse),
Status200_SuccessfulOperation(models::ApiResponse),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -101,15 +107,17 @@ pub enum UploadFileResponse {
#[allow(clippy::large_enum_variant)]
pub enum DeleteOrderResponse {
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Order not found
OrderNotFound,
Status404_OrderNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum GetInventoryResponse {
/// successful operation
SuccessfulOperation(std::collections::HashMap<String, i32>),
Status200_SuccessfulOperation(std::collections::HashMap<String, i32>),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -117,11 +125,11 @@ pub enum GetInventoryResponse {
#[allow(clippy::large_enum_variant)]
pub enum GetOrderByIdResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid ID supplied
InvalidIDSupplied,
Status400_InvalidIDSupplied,
/// Order not found
OrderNotFound,
Status404_OrderNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -129,27 +137,33 @@ pub enum GetOrderByIdResponse {
#[allow(clippy::large_enum_variant)]
pub enum PlaceOrderResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid Order
InvalidOrder,
Status400_InvalidOrder,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CreateUserResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CreateUsersWithArrayInputResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum CreateUsersWithListInputResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -157,9 +171,9 @@ pub enum CreateUsersWithListInputResponse {
#[allow(clippy::large_enum_variant)]
pub enum DeleteUserResponse {
/// Invalid username supplied
InvalidUsernameSupplied,
Status400_InvalidUsernameSupplied,
/// User not found
UserNotFound,
Status404_UserNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -167,11 +181,11 @@ pub enum DeleteUserResponse {
#[allow(clippy::large_enum_variant)]
pub enum GetUserByNameResponse {
/// successful operation
SuccessfulOperation(String),
Status200_SuccessfulOperation(String),
/// Invalid username supplied
InvalidUsernameSupplied,
Status400_InvalidUsernameSupplied,
/// User not found
UserNotFound,
Status404_UserNotFound,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -179,20 +193,22 @@ pub enum GetUserByNameResponse {
#[allow(clippy::large_enum_variant)]
pub enum LoginUserResponse {
/// successful operation
SuccessfulOperation {
Status200_SuccessfulOperation {
body: String,
set_cookie: Option<String>,
x_rate_limit: Option<i32>,
x_expires_after: Option<chrono::DateTime<chrono::Utc>>,
},
/// Invalid username/password supplied
InvalidUsername,
Status400_InvalidUsername,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum LogoutUserResponse {
/// successful operation
SuccessfulOperation,
Status0_SuccessfulOperation,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -200,9 +216,9 @@ pub enum LogoutUserResponse {
#[allow(clippy::large_enum_variant)]
pub enum UpdateUserResponse {
/// Invalid user supplied
InvalidUserSupplied,
Status400_InvalidUserSupplied,
/// User not found
UserNotFound,
Status404_UserNotFound,
}
/// API

View File

@@ -111,7 +111,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
AddPetResponse::SuccessfulOperation(body) => {
AddPetResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -127,7 +127,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
AddPetResponse::InvalidInput => {
AddPetResponse::Status405_InvalidInput => {
let mut response = response.status(405);
response.body(Body::empty())
}
@@ -220,7 +220,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DeletePetResponse::InvalidPetValue => {
DeletePetResponse::Status400_InvalidPetValue => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -282,7 +282,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FindPetsByStatusResponse::SuccessfulOperation(body) => {
FindPetsByStatusResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -298,7 +298,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
FindPetsByStatusResponse::InvalidStatusValue => {
FindPetsByStatusResponse::Status400_InvalidStatusValue => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -360,7 +360,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FindPetsByTagsResponse::SuccessfulOperation(body) => {
FindPetsByTagsResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -376,7 +376,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
FindPetsByTagsResponse::InvalidTagValue => {
FindPetsByTagsResponse::Status400_InvalidTagValue => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -437,7 +437,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetPetByIdResponse::SuccessfulOperation(body) => {
GetPetByIdResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -453,11 +453,11 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
GetPetByIdResponse::InvalidIDSupplied => {
GetPetByIdResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
GetPetByIdResponse::PetNotFound => {
GetPetByIdResponse::Status404_PetNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -526,7 +526,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UpdatePetResponse::SuccessfulOperation(body) => {
UpdatePetResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -542,15 +542,15 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
UpdatePetResponse::InvalidIDSupplied => {
UpdatePetResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
UpdatePetResponse::PetNotFound => {
UpdatePetResponse::Status404_PetNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
UpdatePetResponse::ValidationException => {
UpdatePetResponse::Status405_ValidationException => {
let mut response = response.status(405);
response.body(Body::empty())
}
@@ -612,7 +612,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UpdatePetWithFormResponse::InvalidInput => {
UpdatePetWithFormResponse::Status405_InvalidInput => {
let mut response = response.status(405);
response.body(Body::empty())
}
@@ -674,7 +674,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UploadFileResponse::SuccessfulOperation(body) => {
UploadFileResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -754,11 +754,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DeleteOrderResponse::InvalidIDSupplied => {
DeleteOrderResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
DeleteOrderResponse::OrderNotFound => {
DeleteOrderResponse::Status404_OrderNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -811,7 +811,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetInventoryResponse::SuccessfulOperation(body) => {
GetInventoryResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -891,7 +891,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetOrderByIdResponse::SuccessfulOperation(body) => {
GetOrderByIdResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -907,11 +907,11 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
GetOrderByIdResponse::InvalidIDSupplied => {
GetOrderByIdResponse::Status400_InvalidIDSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
GetOrderByIdResponse::OrderNotFound => {
GetOrderByIdResponse::Status404_OrderNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -980,7 +980,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
PlaceOrderResponse::SuccessfulOperation(body) => {
PlaceOrderResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -996,7 +996,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
PlaceOrderResponse::InvalidOrder => {
PlaceOrderResponse::Status400_InvalidOrder => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1065,7 +1065,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CreateUserResponse::SuccessfulOperation => {
CreateUserResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -1135,7 +1135,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CreateUsersWithArrayInputResponse::SuccessfulOperation => {
CreateUsersWithArrayInputResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -1205,7 +1205,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
CreateUsersWithListInputResponse::SuccessfulOperation => {
CreateUsersWithListInputResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -1266,11 +1266,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DeleteUserResponse::InvalidUsernameSupplied => {
DeleteUserResponse::Status400_InvalidUsernameSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
DeleteUserResponse::UserNotFound => {
DeleteUserResponse::Status404_UserNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -1331,7 +1331,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetUserByNameResponse::SuccessfulOperation(body) => {
GetUserByNameResponse::Status200_SuccessfulOperation(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -1347,11 +1347,11 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
GetUserByNameResponse::InvalidUsernameSupplied => {
GetUserByNameResponse::Status400_InvalidUsernameSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
GetUserByNameResponse::UserNotFound => {
GetUserByNameResponse::Status404_UserNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}
@@ -1412,7 +1412,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
LoginUserResponse::SuccessfulOperation {
LoginUserResponse::Status200_SuccessfulOperation {
body,
set_cookie,
x_rate_limit,
@@ -1482,7 +1482,7 @@ where
let body_content = body;
response.body(Body::from(body_content))
}
LoginUserResponse::InvalidUsername => {
LoginUserResponse::Status400_InvalidUsername => {
let mut response = response.status(400);
response.body(Body::empty())
}
@@ -1535,7 +1535,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
LogoutUserResponse::SuccessfulOperation => {
LogoutUserResponse::Status0_SuccessfulOperation => {
let mut response = response.status(0);
response.body(Body::empty())
}
@@ -1607,11 +1607,11 @@ where
let resp = match result {
Ok(rsp) => match rsp {
UpdateUserResponse::InvalidUserSupplied => {
UpdateUserResponse::Status400_InvalidUserSupplied => {
let mut response = response.status(400);
response.body(Body::empty())
}
UpdateUserResponse::UserNotFound => {
UpdateUserResponse::Status404_UserNotFound => {
let mut response = response.status(404);
response.body(Body::empty())
}

View File

@@ -23,9 +23,11 @@ pub const BASE_PATH: &str = "";
pub const API_VERSION: &str = "1.0";
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum PingGetResponse {
/// OK
OK,
Status201_OK,
}
/// API

View File

@@ -61,7 +61,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
PingGetResponse::OK => {
PingGetResponse::Status201_OK => {
let mut response = response.status(201);
response.body(Body::empty())
}

View File

@@ -23,57 +23,75 @@ pub const BASE_PATH: &str = "";
pub const API_VERSION: &str = "2.3.4";
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum AllOfGetResponse {
/// OK
OK(models::AllOfObject),
Status200_OK(models::AllOfObject),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum DummyGetResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum DummyPutResponse {
/// Success
Success,
Status200_Success,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum FileResponseGetResponse {
/// Success
Success(ByteArray),
Status200_Success(ByteArray),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum GetStructuredYamlResponse {
/// OK
OK(String),
Status200_OK(String),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum HtmlPostResponse {
/// Success
Success(String),
Status200_Success(String),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum PostYamlResponse {
/// OK
OK,
Status204_OK,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum RawJsonGetResponse {
/// Success
Success(crate::types::Object),
Status200_Success(crate::types::Object),
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
#[allow(clippy::large_enum_variant)]
pub enum SoloObjectPostResponse {
/// OK
OK,
Status204_OK,
}
/// API

View File

@@ -72,7 +72,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
AllOfGetResponse::OK(body) => {
AllOfGetResponse::Status200_OK(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -144,7 +144,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DummyGetResponse::Success => {
DummyGetResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -213,7 +213,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
DummyPutResponse::Success => {
DummyPutResponse::Status200_Success => {
let mut response = response.status(200);
response.body(Body::empty())
}
@@ -269,7 +269,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
FileResponseGetResponse::Success(body) => {
FileResponseGetResponse::Status200_Success(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -344,7 +344,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
GetStructuredYamlResponse::OK(body) => {
GetStructuredYamlResponse::Status200_OK(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -419,7 +419,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
HtmlPostResponse::Success(body) => {
HtmlPostResponse::Status200_Success(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -494,7 +494,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
PostYamlResponse::OK => {
PostYamlResponse::Status204_OK => {
let mut response = response.status(204);
response.body(Body::empty())
}
@@ -547,7 +547,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
RawJsonGetResponse::Success(body) => {
RawJsonGetResponse::Status200_Success(body) => {
let mut response = response.status(200);
{
let mut response_headers = response.headers_mut().unwrap();
@@ -634,7 +634,7 @@ where
let resp = match result {
Ok(rsp) => match rsp {
SoloObjectPostResponse::OK => {
SoloObjectPostResponse::Status204_OK => {
let mut response = response.status(204);
response.body(Body::empty())
}