docReturnTypeOptions = new LinkedHashSet<>();
+
+ for (CodegenResponse response : operation.responses) {
+ if (response.dataType != null) {
+ String returnType = response.dataType;
+ if (response.isArray || response.isMap) {
+ // PHP does not understand array type hinting so we strip it
+ // The phpdoc will still contain the array type hinting
+ returnType = "array";
+ }
+
+ phpReturnTypeOptions.add(returnType);
+ docReturnTypeOptions.add(response.dataType);
+ }
+ }
+
+ if (phpReturnTypeOptions.isEmpty()) {
operation.vendorExtensions.putIfAbsent("x-php-return-type", "void");
+ operation.vendorExtensions.putIfAbsent("x-php-doc-return-type", "void");
} else {
- if (operation.returnProperty.isContainer) { // array or map
- operation.vendorExtensions.putIfAbsent("x-php-return-type", "array");
- } else {
- operation.vendorExtensions.putIfAbsent("x-php-return-type", operation.returnType);
- }
+ operation.vendorExtensions.putIfAbsent("x-php-return-type", String.join("|", phpReturnTypeOptions));
+ operation.vendorExtensions.putIfAbsent("x-php-doc-return-type", String.join("|", docReturnTypeOptions));
}
for (CodegenParameter param : operation.allParams) {
if (param.isArray || param.isMap) {
param.vendorExtensions.putIfAbsent("x-php-param-type", "array");
} else {
- param.vendorExtensions.putIfAbsent("x-php-param-type", param.dataType);
+ String paramType = param.dataType;
+ if ((!param.required || param.isNullable) && !paramType.equals("mixed")) { // optional or nullable but not mixed
+ paramType = "?" + paramType;
+ }
+ param.vendorExtensions.putIfAbsent("x-php-param-type", paramType);
}
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
index c0d3accc11a1..76c4c51ca7c1 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
@@ -1226,7 +1226,7 @@ public CodegenModel fromModel(String name, Schema model) {
}
}
- // Do we suppport doing ToString/FromStr conversions for query parameters?
+ // Do we support doing ToString/FromStr conversions for query parameters?
boolean toStringSupport = true;
boolean isString = "String".equals(mdl.dataType);
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java
index b257e2eba22d..9339370f286e 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java
@@ -1179,7 +1179,7 @@ private static String queryArgs(final CodegenOperation op) {
*
* The data variant can have nulls and other non-scala things, but they know how to create validated model objects.
*
- * This 'asScalaDataType' is used to ensure the type hierarchy is correct for both the model and data varients.
+ * This 'asScalaDataType' is used to ensure the type hierarchy is correct for both the model and data variants.
*
* e.g. consider this example:
* ```
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
index 2b359ebc521b..9a613c3bb67b 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
@@ -1079,7 +1079,7 @@ private Set reformatProvideArgsParams(Operation operation) {
if (argObj instanceof List) {
List provideArgs = (List) argObj;
if (!provideArgs.isEmpty()) {
- List formatedArgs = new ArrayList<>();
+ List formattedArgs = new ArrayList<>();
for (String oneArg : provideArgs) {
if (StringUtils.isNotEmpty(oneArg)) {
String regexp = "(?@)?(?(?(\\w+\\.)*)(?\\w+))(?\\(.*?\\))?\\s?";
@@ -1101,10 +1101,10 @@ private Set reformatProvideArgsParams(Operation operation) {
}
String newArg = String.join(" ", newArgs);
LOGGER.trace("new arg {} {}", newArg);
- formatedArgs.add(newArg);
+ formattedArgs.add(newArg);
}
}
- operation.getExtensions().put("x-spring-provide-args", formatedArgs);
+ operation.getExtensions().put("x-spring-provide-args", formattedArgs);
}
}
return provideArgsClassSet;
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
index 16ce68597cbb..b39fdf1e52b7 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
@@ -84,25 +84,43 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
protected static final String RESPONSE_LIBRARY_COMBINE = "Combine";
protected static final String RESPONSE_LIBRARY_ASYNC_AWAIT = "AsyncAwait";
protected static final String[] RESPONSE_LIBRARIES = {RESPONSE_LIBRARY_PROMISE_KIT, RESPONSE_LIBRARY_RX_SWIFT, RESPONSE_LIBRARY_RESULT, RESPONSE_LIBRARY_COMBINE, RESPONSE_LIBRARY_ASYNC_AWAIT};
- @Setter protected String projectName = "OpenAPIClient";
- @Setter protected boolean nonPublicApi = false;
- @Setter protected boolean objcCompatible = false;
- @Setter protected boolean readonlyProperties = false;
- @Setter protected boolean swiftUseApiNamespace = false;
- @Setter protected boolean useSPMFileStructure = false;
- @Setter protected String swiftPackagePath = "Classes" + File.separator + "OpenAPIs";
- @Setter protected boolean oneOfUnknownDefaultCase = false;
- @Setter protected boolean useClasses = false;
- @Setter protected boolean useBacktickEscapes = false;
- @Setter protected boolean generateModelAdditionalProperties = true;
- @Setter protected boolean hashableModels = true;
- @Setter protected boolean identifiableModels = true;
- @Setter protected boolean useJsonEncodable = true;
- @Getter @Setter
+ @Setter
+ protected String projectName = "OpenAPIClient";
+ @Setter
+ protected boolean nonPublicApi = false;
+ @Setter
+ protected boolean objcCompatible = false;
+ @Setter
+ protected boolean readonlyProperties = false;
+ @Setter
+ protected boolean swiftUseApiNamespace = false;
+ @Setter
+ protected boolean useSPMFileStructure = false;
+ @Setter
+ protected String swiftPackagePath = "Classes" + File.separator + "OpenAPIs";
+ @Setter
+ protected boolean oneOfUnknownDefaultCase = false;
+ @Setter
+ protected boolean useClasses = false;
+ @Setter
+ protected boolean useBacktickEscapes = false;
+ @Setter
+ protected boolean generateModelAdditionalProperties = true;
+ @Setter
+ protected boolean hashableModels = true;
+ @Setter
+ protected boolean identifiableModels = true;
+ @Setter
+ protected boolean useJsonEncodable = true;
+ @Getter
+ @Setter
protected boolean mapFileBinaryToData = false;
- @Setter protected boolean useCustomDateWithoutTime = false;
- @Setter protected boolean validatable = true;
- @Setter protected String[] responseAs = new String[0];
+ @Setter
+ protected boolean useCustomDateWithoutTime = false;
+ @Setter
+ protected boolean validatable = true;
+ @Setter
+ protected String[] responseAs = new String[0];
protected String sourceFolder = swiftPackagePath;
protected HashSet objcReservedWords;
protected String apiDocPath = "docs/";
@@ -322,7 +340,7 @@ public Swift5ClientCodegen() {
.defaultValue(Boolean.FALSE.toString()));
cliOptions.add(new CliOption(VALIDATABLE,
- "Make validation rules and validator for model properies (default: true)")
+ "Make validation rules and validator for model properties (default: true)")
.defaultValue(Boolean.TRUE.toString()));
supportedLibraries.put(LIBRARY_URLSESSION, "[DEFAULT] HTTP client: URLSession");
@@ -1189,7 +1207,7 @@ public void postProcessFile(File file, String fileType) {
}
// only process files with swift extension
if ("swift".equals(FilenameUtils.getExtension(file.toString()))) {
- this.executePostProcessor(new String[] {swiftPostProcessFile, file.toString()});
+ this.executePostProcessor(new String[]{swiftPostProcessFile, file.toString()});
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java
index 8c1bb2e0ffc7..5c665e8e3974 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java
@@ -86,27 +86,48 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig
protected static final String RESPONSE_LIBRARY_COMBINE = "Combine";
protected static final String RESPONSE_LIBRARY_ASYNC_AWAIT = "AsyncAwait";
protected static final String RESPONSE_LIBRARY_OBJC_BLOCK = "ObjcBlock";
- protected static final String[] RESPONSE_LIBRARIES = { RESPONSE_LIBRARY_ASYNC_AWAIT, RESPONSE_LIBRARY_COMBINE, RESPONSE_LIBRARY_RESULT, RESPONSE_LIBRARY_RX_SWIFT, RESPONSE_LIBRARY_OBJC_BLOCK, RESPONSE_LIBRARY_PROMISE_KIT };
- @Setter protected String projectName = "OpenAPIClient";
- @Setter protected boolean nonPublicApi = false;
- @Setter protected boolean objcCompatible = false;
- @Setter protected boolean readonlyProperties = false;
- @Setter protected boolean swiftUseApiNamespace = false;
- @Setter protected boolean useSPMFileStructure = true;
- @Setter protected String swiftPackagePath = "Sources" + File.separator + projectName;
- @Setter protected boolean oneOfUnknownDefaultCase = false;
- @Setter protected boolean useClasses = false;
- @Setter protected boolean useBacktickEscapes = false;
- @Setter protected boolean generateModelAdditionalProperties = true;
- @Setter protected boolean hashableModels = true;
- @Setter protected boolean identifiableModels = true;
- @Setter protected boolean useJsonEncodable = true;
- @Getter @Setter protected boolean mapFileBinaryToData = false;
- @Setter protected boolean useCustomDateWithoutTime = false;
- @Setter protected boolean validatable = true;
- @Setter protected boolean apiStaticMethod = true;
- @Setter protected boolean combineDeferred = true;
- @Setter protected String[] responseAs = { RESPONSE_LIBRARY_ASYNC_AWAIT };
+ protected static final String[] RESPONSE_LIBRARIES = {RESPONSE_LIBRARY_ASYNC_AWAIT, RESPONSE_LIBRARY_COMBINE, RESPONSE_LIBRARY_RESULT, RESPONSE_LIBRARY_RX_SWIFT, RESPONSE_LIBRARY_OBJC_BLOCK, RESPONSE_LIBRARY_PROMISE_KIT};
+ @Setter
+ protected String projectName = "OpenAPIClient";
+ @Setter
+ protected boolean nonPublicApi = false;
+ @Setter
+ protected boolean objcCompatible = false;
+ @Setter
+ protected boolean readonlyProperties = false;
+ @Setter
+ protected boolean swiftUseApiNamespace = false;
+ @Setter
+ protected boolean useSPMFileStructure = true;
+ @Setter
+ protected String swiftPackagePath = "Sources" + File.separator + projectName;
+ @Setter
+ protected boolean oneOfUnknownDefaultCase = false;
+ @Setter
+ protected boolean useClasses = false;
+ @Setter
+ protected boolean useBacktickEscapes = false;
+ @Setter
+ protected boolean generateModelAdditionalProperties = true;
+ @Setter
+ protected boolean hashableModels = true;
+ @Setter
+ protected boolean identifiableModels = true;
+ @Setter
+ protected boolean useJsonEncodable = true;
+ @Getter
+ @Setter
+ protected boolean mapFileBinaryToData = false;
+ @Setter
+ protected boolean useCustomDateWithoutTime = false;
+ @Setter
+ protected boolean validatable = true;
+ @Setter
+ protected boolean apiStaticMethod = true;
+ @Setter
+ protected boolean combineDeferred = true;
+ @Setter
+ protected String[] responseAs = {RESPONSE_LIBRARY_ASYNC_AWAIT};
protected String sourceFolder = swiftPackagePath;
protected HashSet objcReservedWords;
protected String apiDocPath = "docs/";
@@ -326,7 +347,7 @@ public Swift6ClientCodegen() {
.defaultValue(Boolean.FALSE.toString()));
cliOptions.add(new CliOption(VALIDATABLE,
- "Make validation rules and validator for model properies (default: true)")
+ "Make validation rules and validator for model properties (default: true)")
.defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(API_STATIC_METHOD,
@@ -1222,7 +1243,7 @@ public void postProcessFile(File file, String fileType) {
}
// only process files with swift extension
if ("swift".equals(FilenameUtils.getExtension(file.toString()))) {
- this.executePostProcessor(new String[] {swiftPostProcessFile, file.toString()});
+ this.executePostProcessor(new String[]{swiftPostProcessFile, file.toString()});
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java
index 95bd6c3b0bb7..0985f0c3364f 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java
@@ -746,8 +746,8 @@ protected void addVendorExtensions(CodegenParameter cp, CodegenOperation operati
CodegenModel baseModel = modelMaps.get(cp.items.dataType);
boolean isBaseTypeEnum = cp.items.isEnum || cp.isEnum || (baseModel != null && baseModel.isEnum);
cp.vendorExtensions.put("x-swift-is-base-type-enum", isBaseTypeEnum);
- boolean isBaseTypeUdid = cp.items.isUuid || cp.isUuid;
- cp.vendorExtensions.put("x-swift-is-base-type-udid", isBaseTypeUdid);
+ boolean isBaseTypeUuid = cp.items.isUuid || cp.isUuid;
+ cp.vendorExtensions.put("x-swift-is-base-type-uuid", isBaseTypeUuid);
boolean useEncoder = !isBaseTypeEnum && !cp.items.isString || (baseModel != null && !baseModel.isString);
cp.vendorExtensions.put("x-swift-use-encoder", useEncoder);
diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache
index ae635d276b75..fa59c65e07ba 100644
--- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache
+++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache
@@ -6,6 +6,7 @@ cmake_policy(SET CMP0063 NEW)
set(CMAKE_C_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+set(CMAKE_C_FLAGS "-Werror=implicit-function-declaration -Werror=missing-declarations -Werror=int-conversion")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
@@ -14,7 +15,7 @@ find_package(OpenSSL)
if (OPENSSL_FOUND)
message (STATUS "OPENSSL found")
- set(CMAKE_C_FLAGS "-DOPENSSL")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL")
if(CMAKE_VERSION VERSION_LESS 3.4)
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${OPENSSL_INCLUDE_DIRS})
diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache
index 185e8c845a0a..cb01a7f9763a 100644
--- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache
+++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
{{#operations}}
{{#operation}}
@@ -140,7 +135,7 @@ end:
snprintf(localVarToReplace_{{paramName}}, sizeOfPathParams_{{paramName}}, "{%s}", "{{baseName}}");
char localVarBuff_{{paramName}}[256];
- intToStr(localVarBuff_{{paramName}}, {{paramName}});
+ snprintf(localVarBuff_{{paramName}}, sizeof localVarBuff_{{paramName}}, "%ld", (long){{paramName}});
localVarPath = strReplace(localVarPath, localVarToReplace_{{paramName}}, localVarBuff_{{paramName}});
@@ -153,7 +148,7 @@ end:
snprintf(localVarToReplace_{{paramName}}, sizeOfPathParams_{{paramName}}, "{%s}", "{{baseName}}");
char localVarBuff_{{paramName}}[256];
- intToStr(localVarBuff_{{paramName}}, *{{paramName}});
+ snprintf(localVarBuff_{{paramName}}, sizeof localVarBuff_{{paramName}}, "%ld", (long)*{{paramName}});
localVarPath = strReplace(localVarPath, localVarToReplace_{{paramName}}, localVarBuff_{{paramName}});
@@ -166,7 +161,7 @@ end:
snprintf(localVarToReplace_{{paramName}}, sizeOfPathParams_{{paramName}}, "{%s}", "{{baseName}}");
char localVarBuff_{{paramName}}[256];
- intToStr(localVarBuff_{{paramName}}, {{paramName}});
+ snprintf(localVarBuff_{{paramName}}, sizeof localVarBuff_{{paramName}}, "%ld", (long){{paramName}});
localVarPath = strReplace(localVarPath, localVarToReplace_{{paramName}}, localVarBuff_{{paramName}});
@@ -179,7 +174,7 @@ end:
snprintf(localVarToReplace_{{paramName}}, sizeOfPathParams_{{paramName}}, "{%s}", "{{baseName}}");
char localVarBuff_{{paramName}}[256];
- intToStr(localVarBuff_{{paramName}}, {{paramName}});
+ snprintf(localVarBuff_{{paramName}}, sizeof localVarBuff_{{paramName}}, "%ld", {{paramName}});
localVarPath = strReplace(localVarPath, localVarToReplace_{{paramName}}, localVarBuff_{{paramName}});
@@ -275,7 +270,7 @@ end:
{{/isFile}}
{{^isFile}}
char *keyForm_{{paramName}} = NULL;
- {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueForm_{{paramName}} = 0;
+ {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}char *{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueForm_{{paramName}} = 0;
keyValuePair_t *keyPairForm_{{paramName}} = 0;
{{/isFile}}
if ({{paramName}} != {{^isEnum}}NULL{{/isEnum}}{{#isEnum}}0{{/isEnum}})
@@ -301,7 +296,7 @@ end:
valueForm_{{paramName}} = {{#isString}}{{^isEnum}}strdup({{/isEnum}}{{/isString}}({{{paramName}}}){{#isString}}{{^isEnum}}){{/isEnum}}{{/isString}};
{{/isBoolean}}
{{/isInteger}}
- keyPairForm_{{paramName}} = keyValuePair_create(keyForm_{{paramName}},{{#isString}}{{#isEnum}}(void *){{/isEnum}}{{/isString}}{{^isString}}&{{/isString}}valueForm_{{paramName}});
+ keyPairForm_{{paramName}} = keyValuePair_create(keyForm_{{paramName}},{{#isString}}{{#isEnum}}(void *){{/isEnum}}{{/isString}}{{^isString}}{{^isBoolean}}&{{/isBoolean}}{{/isString}}valueForm_{{paramName}});
list_addElement(localVarFormParameters,keyPairForm_{{paramName}});
{{/isFile}}
}
diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache
index 899cb22ef7aa..d032b5de1fa8 100644
--- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache
+++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache
@@ -173,7 +173,7 @@ void sslConfig_free(sslConfig_t *sslConfig) {
free(sslConfig);
}
-void replaceSpaceWithPlus(char *stringToProcess) {
+static void replaceSpaceWithPlus(char *stringToProcess) {
for(int i = 0; i < strlen(stringToProcess); i++) {
if(stringToProcess[i] == ' ') {
stringToProcess[i] = '+';
@@ -181,9 +181,9 @@ void replaceSpaceWithPlus(char *stringToProcess) {
}
}
-char *assembleTargetUrl(const char *basePath,
- const char *operationParameter,
- list_t *queryParameters) {
+static char *assembleTargetUrl(const char *basePath,
+ const char *operationParameter,
+ list_t *queryParameters) {
int neededBufferSizeForQueryParameters = 0;
listEntry_t *listEntry;
@@ -234,7 +234,7 @@ char *assembleTargetUrl(const char *basePath,
return targetUrl;
}
-char *assembleHeaderField(char *key, char *value) {
+static char *assembleHeaderField(char *key, char *value) {
char *header = malloc(strlen(key) + strlen(value) + 3);
strcpy(header, key),
@@ -244,13 +244,13 @@ char *assembleHeaderField(char *key, char *value) {
return header;
}
-void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
+static void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters);
curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE,
(curl_off_t)bodyParametersLength);
}
-int lengthOfKeyPair(keyValuePair_t *keyPair) {
+static int lengthOfKeyPair(keyValuePair_t *keyPair) {
long length = 0;
if((keyPair->key != NULL) &&
(keyPair->value != NULL) )
diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache
index ebf15d178911..0cfe0541be17 100644
--- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache
+++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache
@@ -119,7 +119,7 @@ char* {{classname}}_{{name}}_ToString({{projectName}}_{{classVarName}}_{{enumNam
{{/isContainer}}
{{/vars}}
-{{classname}}_t *{{classname}}_create(
+static {{classname}}_t *{{classname}}_create_internal(
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
@@ -205,14 +205,103 @@ char* {{classname}}_{{name}}_ToString({{projectName}}_{{classVarName}}_{{enumNam
{{classname}}_local_var->{{{name}}} = {{{name}}};
{{/vars}}
+ {{classname}}_local_var->_library_owned = 1;
return {{classname}}_local_var;
}
+__attribute__((deprecated)) {{classname}}_t *{{classname}}_create(
+ {{#vars}}
+ {{^isContainer}}
+ {{^isPrimitiveType}}
+ {{#isModel}}
+ {{#isEnum}}
+ {{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}}
+ {{/isEnum}}
+ {{^isEnum}}
+ {{datatype}}_t *{{name}}{{^-last}},{{/-last}}
+ {{/isEnum}}
+ {{/isModel}}
+ {{^isModel}}
+ {{^isFreeFormObject}}
+ {{^isEnum}}
+ {{datatype}}_t *{{name}}{{^-last}},{{/-last}}
+ {{/isEnum}}
+ {{#isEnum}}
+ {{projectName}}_{{dataType}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}}
+ {{/isEnum}}
+ {{/isFreeFormObject}}
+ {{/isModel}}
+ {{#isUuid}}
+ {{datatype}} *{{name}}{{^-last}},{{/-last}}
+ {{/isUuid}}
+ {{#isEmail}}
+ {{datatype}} *{{name}}{{^-last}},{{/-last}}
+ {{/isEmail}}
+ {{#isFreeFormObject}}
+ {{datatype}}_t *{{name}}{{^-last}},{{/-last}}
+ {{/isFreeFormObject}}
+ {{/isPrimitiveType}}
+ {{#isPrimitiveType}}
+ {{#isNumeric}}
+ {{datatype}} {{name}}{{^-last}},{{/-last}}
+ {{/isNumeric}}
+ {{#isBoolean}}
+ {{datatype}} {{name}}{{^-last}},{{/-last}}
+ {{/isBoolean}}
+ {{#isEnum}}
+ {{#isString}}
+ {{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}}
+ {{/isString}}
+ {{/isEnum}}
+ {{^isEnum}}
+ {{#isString}}
+ {{datatype}} *{{name}}{{^-last}},{{/-last}}
+ {{/isString}}
+ {{/isEnum}}
+ {{#isByteArray}}
+ {{datatype}} *{{name}}{{^-last}},{{/-last}}
+ {{/isByteArray}}
+ {{#isBinary}}
+ {{datatype}} {{name}}{{^-last}},{{/-last}}
+ {{/isBinary}}
+ {{#isDate}}
+ {{datatype}} *{{name}}{{^-last}},{{/-last}}
+ {{/isDate}}
+ {{#isDateTime}}
+ {{datatype}} *{{name}}{{^-last}},{{/-last}}
+ {{/isDateTime}}
+ {{/isPrimitiveType}}
+ {{/isContainer}}
+ {{#isContainer}}
+ {{#isArray}}
+ {{#isPrimitiveType}}
+ {{datatype}}_t *{{name}}{{^-last}},{{/-last}}
+ {{/isPrimitiveType}}
+ {{^isPrimitiveType}}
+ {{datatype}}_t *{{name}}{{^-last}},{{/-last}}
+ {{/isPrimitiveType}}
+ {{/isArray}}
+ {{#isMap}}
+ {{datatype}} {{name}}{{^-last}},{{/-last}}
+ {{/isMap}}
+ {{/isContainer}}
+ {{/vars}}
+ ) {
+ return {{classname}}_create_internal (
+ {{#vars}}
+ {{name}}{{^-last}},{{/-last}}
+ {{/vars}}
+ );
+}
void {{classname}}_free({{classname}}_t *{{classname}}) {
if(NULL == {{classname}}){
return ;
}
+ if({{classname}}->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "{{classname}}_free");
+ return ;
+ }
listEntry_t *listEntry;
{{#vars}}
{{^isContainer}}
@@ -376,7 +465,7 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
{{/isBoolean}}
{{#isEnum}}
{{#isString}}
- if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{name}}}{{classname}}_ToString({{{classname}}}->{{{name}}})) == NULL)
+ if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{classname}}_{{name}}_ToString({{{classname}}}->{{{name}}})) == NULL)
{
goto fail; //Enum
}
@@ -859,7 +948,7 @@ fail:
{{/vars}}
- {{classname}}_local_var = {{classname}}_create (
+ {{classname}}_local_var = {{classname}}_create_internal (
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache
index d69dc8d5cd34..236d9e8c3cba 100644
--- a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache
+++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache
@@ -154,9 +154,10 @@ typedef struct {{classname}}_t {
{{/isContainer}}
{{/vars}}
+ int _library_owned; // Is the library responsible for freeing this object?
} {{classname}}_t;
-{{classname}}_t *{{classname}}_create(
+__attribute__((deprecated)) {{classname}}_t *{{classname}}_create(
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
diff --git a/modules/openapi-generator/src/main/resources/Java/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/JSON.mustache
index 1d0a8138787b..5ef02660d746 100644
--- a/modules/openapi-generator/src/main/resources/Java/JSON.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/JSON.mustache
@@ -31,9 +31,11 @@ import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
+{{#jsr310}}
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
+{{/jsr310}}
import java.util.Date;
import java.util.Locale;
import java.util.Map;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache
index 59896d820f43..4fefd6db233e 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache
@@ -223,7 +223,7 @@
1.5.18
9.2.9.v20150224
5.10.2
- 1.4.14
+ 1.5.13
{{#useBeanValidation}}
3.0.2
{{/useBeanValidation}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache
index e4ab3b15ec86..9462e0d9236b 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache
@@ -223,7 +223,7 @@
1.5.18
9.2.9.v20150224
5.10.2
- 1.4.14
+ 1.5.13
{{#useBeanValidation}}
3.0.1
{{/useBeanValidation}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
index ef6e35600998..519b37ed2eca 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache
@@ -47,9 +47,11 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.DateFormat;
+{{#jsr310}}
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
+{{/jsr310}}
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache
index 6cf7ec7898c4..eee7773c4cc0 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache
@@ -28,9 +28,11 @@ import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
+{{#jsr310}}
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
+{{/jsr310}}
import java.util.Date;
import java.util.Locale;
import java.util.Map;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache
index 077e8d6924b9..c05159d4e0a0 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache
@@ -46,7 +46,9 @@ import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.text.DateFormat;
+{{#jsr310}}
import java.time.format.DateTimeFormatter;
+{{/jsr310}}
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.HashMap;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache
index 2ff8b1cb739c..2e986485fcd8 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache
@@ -30,9 +30,11 @@ import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
+{{#jsr310}}
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
+{{/jsr310}}
import java.util.Date;
import java.util.Locale;
import java.util.Map;
diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache
index 3e5ed936625f..67af2ce5e31a 100644
--- a/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaInflector/pom.mustache
@@ -162,7 +162,7 @@
1.0.0
1.0.14
9.2.9.v20150224
- 1.2.12
+ 1.5.13
{{#useJakartaEe}}
2.1.1
{{/useJakartaEe}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache
index a4477b5a0aa3..7decc4e441d6 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache
@@ -8,6 +8,7 @@ import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
+import {{javaxPackage}}.validation.Valid;
import {{javaxPackage}}.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache
index 4900c6d27ded..71b5f42a18df 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache
@@ -220,7 +220,7 @@ for this project used jakarta.validation-api -->
1.5.22
9.2.9.v20150224
4.13.2
- 1.4.14
+ 1.5.13
{{#useBeanValidation}}
2.0.2
{{/useBeanValidation}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache
index dc1d394348d7..d744472a18f3 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache
@@ -342,7 +342,7 @@ for this project used jakarta.validation-api -->
{{/generateSpringApplication}}
{{^generateSpringBootApplication}}
4.13.2
- 1.2.12
+ 1.5.13
{{/generateSpringBootApplication}}
3.5.9
2.17.1
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache
index 8606cf7fb63d..bbaf8e4d9997 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache
@@ -8,6 +8,7 @@ import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
+import {{javaxPackage}}.validation.Valid;
import {{javaxPackage}}.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import org.apache.cxf.jaxrs.client.ClientConfiguration;
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache
index cbee86960906..35a5954ebb74 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache
@@ -241,7 +241,7 @@ for this project used jakarta.validation-api -->
1.5.18
9.2.9.v20150224
4.13.2
- 1.4.14
+ 1.5.13
{{#useBeanValidation}}
2.0.2
{{/useBeanValidation}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache
index 961cd74d1579..f6c85b652eae 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache
@@ -292,7 +292,7 @@ for this project used jakarta.validation-api -->
1.5.22
9.2.9.v20150224
4.13.2
- 1.4.14
+ 1.5.13
{{#useBeanValidation}}
2.0.2
{{/useBeanValidation}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache
index 5734fc17ddf4..bfc62eb8ae3e 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache
@@ -222,7 +222,7 @@
3.1.3
2.17.1
4.13.2
- 1.4.14
+ 1.5.13
5.0.0
UTF-8
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache
index 3b2a9f2dc3e1..954fc7cae4f2 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache
@@ -222,7 +222,7 @@ for this project used jakarta.validation-api -->
2.35
2.17.1
4.13.2
- 1.4.14
+ 1.5.13
4.0.4
UTF-8
diff --git a/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/ApiClient.mustache
index 77bdd5ff1eab..6aa25b8ee9dd 100644
--- a/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/ApiClient.mustache
@@ -55,15 +55,20 @@ class ApiClient {
}
- <={{ }}=>{{#emitJSDoc}}/**
+ <={{ }}=>
+ {{^skipDefaultUserAgent}}
+ {{#emitJSDoc}}
+ /**
* The default HTTP headers to be included for all API calls.
* @type {Array.}
* @default {}
- */{{/emitJSDoc}}
+ */
+ {{/emitJSDoc}}
this.defaultHeaders = {
'User-Agent': '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{projectVersion}}/Javascript{{/httpUserAgent}}'
};
+ {{/skipDefaultUserAgent}}
/**
* The default HTTP timeout for all API calls.
* @type {Number}
@@ -79,11 +84,13 @@ class ApiClient {
*/
this.cache = true;
- {{#emitJSDoc}}/**
+ {{#emitJSDoc}}
+ /**
* If set to true, the client will save the cookies from each server
* response, and return them in the next request.
* @default false
- */{{/emitJSDoc}}
+ */
+ {{/emitJSDoc}}
this.enableCookies = false;
/*
diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache
index 04c578517981..b97a7ad8da5f 100644
--- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache
@@ -229,7 +229,7 @@ web::json::value ModelBase::toJson( const std::vector& value )
template
web::json::value ModelBase::toJson( const std::set& value )
{
- // There's no protoype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array.
+ // There's no prototype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array.
std::vector ret;
for ( const auto& x : value )
{
diff --git a/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache
index f5cc312c6fe5..58c9cf6dba32 100644
--- a/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache
@@ -59,7 +59,7 @@ namespace {{packageName}}.Client
public string SigningAlgorithm { get; set; }
///
- /// Gets the Signature validaty period in seconds
+ /// Gets the Signature validity period in seconds
///
public int SignatureValidityPeriod { get; set; }
diff --git a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache
index 91ea70055b06..ec45cbab3c56 100644
--- a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache
@@ -384,6 +384,14 @@ namespace {{packageName}}.Client
}
}
+ if (options.HeaderParameters != null)
+ {
+ if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data")))
+ {
+ request.AlwaysMultipartFormData = true;
+ }
+ }
+
return request;
}
diff --git a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache
index faca675944a3..3105952c2473 100644
--- a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache
@@ -389,7 +389,7 @@ namespace {{packageName}}.Client
}
///
- /// Convert ANS1 format to DER format. Not recommended to use because it generate inavlid signature occationally.
+ /// Convert ANS1 format to DER format. Not recommended to use because it generate invalid signature occasionally.
///
///
///
diff --git a/modules/openapi-generator/src/main/resources/csharp/api.mustache b/modules/openapi-generator/src/main/resources/csharp/api.mustache
index fae106702fd5..527434ba1abe 100644
--- a/modules/openapi-generator/src/main/resources/csharp/api.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/api.mustache
@@ -290,6 +290,7 @@ namespace {{packageName}}.{{apiPackage}}
};
var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -375,7 +376,7 @@ namespace {{packageName}}.{{apiPackage}}
{{/isArray}}
{{/isFile}}
{{^isFile}}
- localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter
+ localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter
{{/isFile}}
{{/required}}
{{^required}}
@@ -397,7 +398,7 @@ namespace {{packageName}}.{{apiPackage}}
{{/isArray}}
{{/isFile}}
{{^isFile}}
- localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter
+ localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter
{{/isFile}}
}
{{/required}}
diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache
index 016ef7c697f2..b74fcfa0a1de 100644
--- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ExceptionEventArgs.mustache
@@ -13,7 +13,7 @@ namespace {{packageName}}.{{clientPackage}}
public Exception Exception { get; }
///
- /// The ExcepetionEventArgs
+ /// The ExceptionEventArgs
///
///
public ExceptionEventArgs(Exception exception)
diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache
index 5e0f7739df06..357626fcc6c2 100644
--- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HttpSigningConfiguration.mustache
@@ -65,7 +65,7 @@ namespace {{packageName}}.{{clientPackage}}
public string SigningAlgorithm { get; set; }
///
- /// Gets the Signature validaty period in seconds
+ /// Gets the Signature validity period in seconds
///
public int SignatureValidityPeriod { get; set; }
diff --git a/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache
index 5769512aa877..ade2832cd1c3 100644
--- a/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache
@@ -36,13 +36,13 @@
{{/useRestSharp}}
{{#useGenericHost}}
-
-
+
+
{{#supportsRetry}}
-
+
{{/supportsRetry}}
{{#net80OrLater}}
-
+
{{/net80OrLater}}
{{^net60OrLater}}
diff --git a/modules/openapi-generator/src/main/resources/csharp/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp/netcore_testproject.mustache
index eb8bd548d1e0..90434b77e297 100644
--- a/modules/openapi-generator/src/main/resources/csharp/netcore_testproject.mustache
+++ b/modules/openapi-generator/src/main/resources/csharp/netcore_testproject.mustache
@@ -9,8 +9,8 @@
-
-
+
+
diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache
index a71a194d56bf..77ffeef5254f 100644
--- a/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache
@@ -25,8 +25,8 @@
2.6.0
1.7.25
4.11
- 1.4.13
- 1.4.13
+ 1.5.13
+ 1.5.13
2.3.0
2.2.4
3.2.2
diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache
index a082fc34eb9d..5d9b6b553ae1 100644
--- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache
@@ -26,7 +26,7 @@
1.10
1.2
3.1.2
- 1.4.13
+ 1.5.13
4.13.2
2.1.0-beta.124
2.3.17.Final
diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/gradle.properties b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/gradle.properties
index fb877a9edd28..1fb076431bba 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/gradle.properties
+++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/gradle.properties
@@ -1,4 +1,4 @@
kotlin.code.style=official
ktor_version=3.0.2
kotlin_version=2.0.20
-logback_version=1.4.14
\ No newline at end of file
+logback_version=1.5.13
diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/gradle.properties b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/gradle.properties
index d507b58c1c87..126ddfe69da1 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/gradle.properties
+++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/gradle.properties
@@ -1,4 +1,4 @@
kotlin.code.style=official
ktor_version=2.3.12
kotlin_version=2.0.20
-logback_version=1.4.14
\ No newline at end of file
+logback_version=1.5.13
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradle-wrapper.jar
new file mode 100644
index 000000000000..e6441136f3d4
Binary files /dev/null and b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradle-wrapper.jar differ
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradle-wrapper.properties.mustache
new file mode 100644
index 000000000000..80187ac30432
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradle-wrapper.properties.mustache
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradlew.bat.mustache
new file mode 100644
index 000000000000..25da30dbdeee
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradlew.bat.mustache
@@ -0,0 +1,92 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradlew.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradlew.mustache
new file mode 100644
index 000000000000..9d0ce634cb11
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/gradlew.mustache
@@ -0,0 +1,249 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+[ -h "$app_path" ]
+do
+ls=$( ls -ld "$app_path" )
+link=${ls#*' -> '}
+case $link in #(
+/*) app_path=$link ;; #(
+*) app_path=$APP_HOME$link ;;
+esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+echo "$*"
+} >&2
+
+die () {
+echo
+echo "$*"
+echo
+exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+CYGWIN* ) cygwin=true ;; #(
+Darwin* ) darwin=true ;; #(
+MSYS* | MINGW* ) msys=true ;; #(
+NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+# IBM's JDK on AIX uses strange locations for the executables
+JAVACMD=$JAVA_HOME/jre/sh/java
+else
+JAVACMD=$JAVA_HOME/bin/java
+fi
+if [ ! -x "$JAVACMD" ] ; then
+die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+else
+JAVACMD=java
+if ! command -v java >/dev/null 2>&1
+then
+die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+case $MAX_FD in #(
+max*)
+# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+# shellcheck disable=SC2039,SC3045
+MAX_FD=$( ulimit -H -n ) ||
+warn "Could not query maximum file descriptor limit"
+esac
+case $MAX_FD in #(
+'' | soft) :;; #(
+*)
+# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+# shellcheck disable=SC2039,SC3045
+ulimit -n "$MAX_FD" ||
+warn "Could not set maximum file descriptor limit to $MAX_FD"
+esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+# Now convert the arguments - kludge to limit ourselves to /bin/sh
+for arg do
+if
+case $arg in #(
+-*) false ;; # don't mess with options #(
+/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+[ -e "$t" ] ;; #(
+*) false ;;
+esac
+then
+arg=$( cygpath --path --ignore --mixed "$arg" )
+fi
+# Roll the args list around exactly as many times as the number of
+# args, so each arg winds up back in the position where it started, but
+# possibly modified.
+#
+# NB: a `for` loop captures its iteration list before it begins, so
+# changing the positional parameters here affects neither the number of
+# iterations, nor the values presented in `arg`.
+shift # remove old arg
+set -- "$@" "$arg" # push replacement arg
+done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+"-Dorg.gradle.appname=$APP_BASE_NAME" \
+-classpath "$CLASSPATH" \
+org.gradle.wrapper.GradleWrapperMain \
+"$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+xargs -n1 |
+sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+tr '\n' ' '
+)" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradle-wrapper.jar
new file mode 100644
index 000000000000..e6441136f3d4
Binary files /dev/null and b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradle-wrapper.jar differ
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradle-wrapper.properties.mustache
new file mode 100644
index 000000000000..80187ac30432
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradle-wrapper.properties.mustache
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradlew.bat.mustache
new file mode 100644
index 000000000000..25da30dbdeee
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradlew.bat.mustache
@@ -0,0 +1,92 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradlew.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradlew.mustache
new file mode 100644
index 000000000000..9d0ce634cb11
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/gradlew.mustache
@@ -0,0 +1,249 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+[ -h "$app_path" ]
+do
+ls=$( ls -ld "$app_path" )
+link=${ls#*' -> '}
+case $link in #(
+/*) app_path=$link ;; #(
+*) app_path=$APP_HOME$link ;;
+esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+echo "$*"
+} >&2
+
+die () {
+echo
+echo "$*"
+echo
+exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+CYGWIN* ) cygwin=true ;; #(
+Darwin* ) darwin=true ;; #(
+MSYS* | MINGW* ) msys=true ;; #(
+NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+# IBM's JDK on AIX uses strange locations for the executables
+JAVACMD=$JAVA_HOME/jre/sh/java
+else
+JAVACMD=$JAVA_HOME/bin/java
+fi
+if [ ! -x "$JAVACMD" ] ; then
+die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+else
+JAVACMD=java
+if ! command -v java >/dev/null 2>&1
+then
+die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+case $MAX_FD in #(
+max*)
+# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+# shellcheck disable=SC2039,SC3045
+MAX_FD=$( ulimit -H -n ) ||
+warn "Could not query maximum file descriptor limit"
+esac
+case $MAX_FD in #(
+'' | soft) :;; #(
+*)
+# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+# shellcheck disable=SC2039,SC3045
+ulimit -n "$MAX_FD" ||
+warn "Could not set maximum file descriptor limit to $MAX_FD"
+esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+# Now convert the arguments - kludge to limit ourselves to /bin/sh
+for arg do
+if
+case $arg in #(
+-*) false ;; # don't mess with options #(
+/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+[ -e "$t" ] ;; #(
+*) false ;;
+esac
+then
+arg=$( cygpath --path --ignore --mixed "$arg" )
+fi
+# Roll the args list around exactly as many times as the number of
+# args, so each arg winds up back in the position where it started, but
+# possibly modified.
+#
+# NB: a `for` loop captures its iteration list before it begins, so
+# changing the positional parameters here affects neither the number of
+# iterations, nor the values presented in `arg`.
+shift # remove old arg
+set -- "$@" "$arg" # push replacement arg
+done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+"-Dorg.gradle.appname=$APP_BASE_NAME" \
+-classpath "$CLASSPATH" \
+org.gradle.wrapper.GradleWrapperMain \
+"$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+xargs -n1 |
+sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+tr '\n' ' '
+)" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache
index 6110545eda62..757c79827c25 100644
--- a/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache
+++ b/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache
@@ -164,7 +164,7 @@ use {{invokerPackage}}\ObjectSerializer;
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
- * @return {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}void{{/returnType}}
+ * @return {{{vendorExtensions.x-php-doc-return-type}}}
{{#isDeprecated}}
* @deprecated
{{/isDeprecated}}
@@ -172,7 +172,7 @@ use {{invokerPackage}}\ObjectSerializer;
public function {{operationId}}(
{{^vendorExtensions.x-group-parameters}}
{{#allParams}}
- {{^required}}?{{/required}}{{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
+ {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
{{/allParams}}
{{#servers}}
{{#-first}}
@@ -247,7 +247,7 @@ use {{invokerPackage}}\ObjectSerializer;
public function {{operationId}}WithHttpInfo(
{{^vendorExtensions.x-group-parameters}}
{{#allParams}}
- {{^required}}?{{/required}}{{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
+ {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
{{/allParams}}
{{#servers}}
{{#-first}}
@@ -446,7 +446,7 @@ use {{invokerPackage}}\ObjectSerializer;
public function {{operationId}}Async(
{{^vendorExtensions.x-group-parameters}}
{{#allParams}}
- {{^required}}?{{/required}}{{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
+ {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
{{/allParams}}
{{#servers}}
{{#-first}}
@@ -524,7 +524,7 @@ use {{invokerPackage}}\ObjectSerializer;
public function {{operationId}}AsyncWithHttpInfo(
{{^vendorExtensions.x-group-parameters}}
{{#allParams}}
- ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
+ {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
{{/allParams}}
{{#servers}}
{{#-first}}
@@ -630,7 +630,7 @@ use {{invokerPackage}}\ObjectSerializer;
public function {{operationId}}Request(
{{^vendorExtensions.x-group-parameters}}
{{#allParams}}
- ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
+ {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}},
{{/allParams}}
{{#servers}}
{{#-first}}
diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache
index f79f51908882..c81f28e4190c 100644
--- a/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache
+++ b/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache
@@ -190,6 +190,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
return self::$openAPIModelName;
}
+{{#discriminator}}
+{{#discriminator.mappedModels}}
+ public const {{#lambda.uppercase}}{{discriminator.propertyName}}_{{#lambda.snakecase}}{{mappingName}}{{/lambda.snakecase}}{{/lambda.uppercase}} = '{{mappingName}}';
+{{/discriminator.mappedModels}}
+{{/discriminator}}
+{{^discriminator}}
{{#vars}}
{{#isEnum}}
{{#allowableValues}}
@@ -199,6 +205,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
{{/allowableValues}}
{{/isEnum}}
{{/vars}}
+{{/discriminator}}
{{#vars}}
{{#isEnum}}
@@ -210,8 +217,15 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
public function {{getter}}AllowableValues()
{
return [
+{{#discriminator}}
+{{#discriminator.mappedModels}}
+ self::{{#lambda.uppercase}}{{discriminator.propertyName}}_{{#lambda.snakecase}}{{mappingName}}{{/lambda.snakecase}}{{/lambda.uppercase}},{{^-last}}
+{{/-last}}{{/discriminator.mappedModels}}
+{{/discriminator}}
+{{^discriminator}}
{{#allowableValues}}{{#enumVars}}self::{{enumName}}_{{{name}}},{{^-last}}
{{/-last}}{{/enumVars}}{{/allowableValues}}
+{{/discriminator}}
];
}
@@ -233,6 +247,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
*/
public function __construct(array $data = null)
{
+ {{#discriminator}}
+ // Initialize discriminator property with the model name.
+ $this->container['{{discriminatorName}}'] = static::$openAPIModelName;
+
+ {{/discriminator}}
{{#parentSchema}}
parent::__construct($data);
@@ -240,11 +259,6 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
{{#vars}}
$this->setIfExists('{{name}}', $data ?? [], {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}});
{{/vars}}
- {{#discriminator}}
-
- // Initialize discriminator property with the model name.
- $this->container['{{discriminatorName}}'] = static::$openAPIModelName;
- {{/discriminator}}
}
/**
diff --git a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache
index 5ec833183d46..7b286d94d034 100644
--- a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache
+++ b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache
@@ -181,7 +181,7 @@ use function sprintf;
{{/vendorExtensions.x-group-parameters}}
{{#servers}}
{{#-first}}
- * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
+ * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
{{/-first}}
* URL: {{{url}}}
{{#-last}}
@@ -219,7 +219,7 @@ use function sprintf;
{{/vendorExtensions.x-group-parameters}}
{{#servers}}
{{#-first}}
- * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
+ * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
{{/-first}}
* URL: {{{url}}}
{{#-last}}
@@ -342,7 +342,7 @@ use function sprintf;
{{/vendorExtensions.x-group-parameters}}
{{#servers}}
{{#-first}}
- * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
+ * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
{{/-first}}
* URL: {{{url}}}
{{#-last}}
@@ -383,7 +383,7 @@ use function sprintf;
{{/vendorExtensions.x-group-parameters}}
{{#servers}}
{{#-first}}
- * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
+ * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
{{/-first}}
* URL: {{{url}}}
{{#-last}}
@@ -448,7 +448,7 @@ use function sprintf;
{{/vendorExtensions.x-group-parameters}}
{{#servers}}
{{#-first}}
- * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
+ * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host.
{{/-first}}
* URL: {{{url}}}
{{#-last}}
diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache
index b9289fdb7e24..5380fa1e1691 100644
--- a/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache
+++ b/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache
@@ -19,7 +19,7 @@ To run the server, please execute the following from the root directory:
```bash
pip3 install -r requirements.txt
-PYTHONPATH=src uvicorn openapi_server.main:app --host 0.0.0.0 --port {{serverPort}}
+PYTHONPATH=src uvicorn {{packageName}}.main:app --host 0.0.0.0 --port {{serverPort}}
```
and open your browser at `http://localhost:{{serverPort}}/docs/` to see the docs.
diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/api_test.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/api_test.mustache
index 10a4d3ed5aa0..a758be5210a7 100644
--- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/api_test.mustache
@@ -15,14 +15,14 @@ class {{#operations}}Test{{classname}}(unittest.{{#asyncio}}IsolatedAsyncio{{/as
self.api = {{classname}}()
async def asyncTearDown(self) -> None:
- pass
+ await self.api.api_client.close()
{{/asyncio}}
{{^asyncio}}
def setUp(self) -> None:
self.api = {{classname}}()
def tearDown(self) -> None:
- pass
+ self.api.api_client.close()
{{/asyncio}}
{{#operation}}
diff --git a/modules/openapi-generator/src/main/resources/python/api_test.mustache b/modules/openapi-generator/src/main/resources/python/api_test.mustache
index 963d085af18e..2febe56956cf 100644
--- a/modules/openapi-generator/src/main/resources/python/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/python/api_test.mustache
@@ -15,7 +15,7 @@ class {{#operations}}Test{{classname}}(unittest.{{#asyncio}}IsolatedAsyncio{{/as
self.api = {{classname}}()
async def asyncTearDown(self) -> None:
- pass
+ await self.api.api_client.close()
{{/asyncio}}
{{^asyncio}}
def setUp(self) -> None:
diff --git a/modules/openapi-generator/src/main/resources/python/exceptions.mustache b/modules/openapi-generator/src/main/resources/python/exceptions.mustache
index a690ceb926cb..fb2ebae0eefa 100644
--- a/modules/openapi-generator/src/main/resources/python/exceptions.mustache
+++ b/modules/openapi-generator/src/main/resources/python/exceptions.mustache
@@ -140,6 +140,13 @@ class ApiException(OpenApiException):
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)
+ # Added new conditions for 409 and 422
+ if http_resp.status == 409:
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 422:
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
+
if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
@@ -178,6 +185,16 @@ class ServiceException(ApiException):
pass
+class ConflictException(ApiException):
+ """Exception for HTTP 409 Conflict."""
+ pass
+
+
+class UnprocessableEntityException(ApiException):
+ """Exception for HTTP 422 Unprocessable Entity."""
+ pass
+
+
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
diff --git a/modules/openapi-generator/src/main/resources/r/api_client.mustache b/modules/openapi-generator/src/main/resources/r/api_client.mustache
index b1844f4686b0..72287876e969 100644
--- a/modules/openapi-generator/src/main/resources/r/api_client.mustache
+++ b/modules/openapi-generator/src/main/resources/r/api_client.mustache
@@ -29,7 +29,7 @@
{{#authMethods}}
{{#isOAuth}}
#' @field oauth_flow_type OAuth flow type
-#' @field oauth_authorization_url Authoriziation URL
+#' @field oauth_authorization_url Authorization URL
#' @field oauth_token_url Token URL
#' @field oauth_pkce Boolean flag to enable PKCE
{{/isOAuth}}
@@ -73,7 +73,7 @@ ApiClient <- R6::R6Class(
{{#isOAuth}}
# Flow type
oauth_flow_type = "{{flow}}",
- # Authoriziation URL
+ # Authorization URL
oauth_authorization_url = "{{authorizationUrl}}",
# Token URL
oauth_token_url = "{{tokenUrl}}",
@@ -105,7 +105,7 @@ ApiClient <- R6::R6Class(
#' @param bearer_token Bearer token.
#' @param timeout Timeout.
#' @param retry_status_codes Status codes for retry.
- #' @param max_retry_attempts Maxmium number of retry.
+ #' @param max_retry_attempts Maximum number of retry.
#' @export
initialize = function(base_path = NULL, user_agent = NULL,
default_headers = NULL,
diff --git a/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache b/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache
index f2e95e679465..194083b2d38c 100644
--- a/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache
+++ b/modules/openapi-generator/src/main/resources/r/libraries/httr2/api_client.mustache
@@ -29,7 +29,7 @@
{{#authMethods}}
{{#isOAuth}}
#' @field oauth_flow_type OAuth flow type
-#' @field oauth_authorization_url Authoriziation URL
+#' @field oauth_authorization_url Authorization URL
#' @field oauth_token_url Token URL
#' @field oauth_pkce Boolean flag to enable PKCE
#' @field oauth_scopes OAuth scopes
@@ -73,7 +73,7 @@ ApiClient <- R6::R6Class(
{{#isOAuth}}
# Flow type
oauth_flow_type = "{{flow}}",
- # Authoriziation URL
+ # Authorization URL
oauth_authorization_url = "{{authorizationUrl}}",
# Token URL
oauth_token_url = "{{tokenUrl}}",
@@ -107,7 +107,7 @@ ApiClient <- R6::R6Class(
#' @param bearer_token Bearer token.
#' @param timeout Timeout.
#' @param retry_status_codes Status codes for retry.
- #' @param max_retry_attempts Maxmium number of retry.
+ #' @param max_retry_attempts Maximum number of retry.
#' @export
initialize = function(base_path = NULL, user_agent = NULL,
default_headers = NULL,
@@ -306,7 +306,7 @@ ApiClient <- R6::R6Class(
req <- req %>% req_oauth_auth_code(client, scope = req_oauth_scopes,
pkce = self$oauth_pkce,
- auth_url = self$oauth_authoriziation_url)
+ auth_url = self$oauth_authorization_url)
}
{{/hasOAuthMethods}}
diff --git a/modules/openapi-generator/src/main/resources/rust-server/auth.mustache b/modules/openapi-generator/src/main/resources/rust-server/auth.mustache
index cbaba3dca7c6..d2b1481eeb81 100644
--- a/modules/openapi-generator/src/main/resources/rust-server/auth.mustache
+++ b/modules/openapi-generator/src/main/resources/rust-server/auth.mustache
@@ -34,7 +34,7 @@ fn dummy_authorization() -> Authorization {
// However, if you want to use it anyway this can not be unimplemented, so dummy implementation added.
// unimplemented!()
Authorization{
- subject: "Dummmy".to_owned(),
+ subject: "Dummy".to_owned(),
scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used
issuer: None
}
diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache
index c5022acf84bb..f563459396a8 100644
--- a/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache
+++ b/modules/openapi-generator/src/main/resources/rust-server/server-request-body-multipart-form.mustache
@@ -39,7 +39,7 @@
return Ok(Response::builder()
.status(StatusCode::INTERNAL_SERVER_ERROR)
.body(Body::from("Failed to process message part due an internal error".to_string()))
- .expect("Unable to create Internal Server Error response due to an internal errror"))
+ .expect("Unable to create Internal Server Error response due to an internal error"))
},
SaveResult::Error(e) => {
return Ok(Response::builder()
diff --git a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache
index db49e368692d..187ab989a8d9 100644
--- a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache
+++ b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache
@@ -74,7 +74,7 @@ open class {{classname}} {
/// - defaultResponse: {{.}}{{/defaultResponse}}
{{#authMethods}}
/// - {{#isBasicBasic}}BASIC{{/isBasicBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}:
- /// - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}}
+ /// - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeader}}(HEADER){{/isKeyInHeader}}{{/keyParamName}}
/// - name: {{name}}
{{/authMethods}}
{{#hasResponseHeaders}}
@@ -212,4 +212,4 @@ open class {{classname}} {
}
{{/operation}}
}
-{{/operations}}
\ No newline at end of file
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache b/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache
index 5535cae98f1b..53ffae5b3b66 100644
--- a/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache
+++ b/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache
@@ -1 +1 @@
-{{#isDateTime}}OpenISO8601DateFormatter.shared.string(from: {{paramName}}){{/isDateTime}}{{#vendorExtensions.x-swift-use-encoder}}String(data: try self.encoder.encode({{paramName}}), encoding: .utf8) ?? ""{{/vendorExtensions.x-swift-use-encoder}}{{^vendorExtensions.x-swift-use-encoder}}{{#isArray}}{{paramName}}{{#vendorExtensions.x-swift-is-base-type-udid}}.map { $0.uuidString }{{/vendorExtensions.x-swift-is-base-type-udid}}{{#vendorExtensions.x-swift-is-base-type-enum}}.map { $0.rawValue }{{/vendorExtensions.x-swift-is-base-type-enum}}.joined(separator: ","){{/isArray}}{{^isArray}}{{#vendorExtensions.x-swift-is-enum-type}}{{paramName}}.rawValue{{/vendorExtensions.x-swift-is-enum-type}}{{^isEnum}}{{#isString}}{{#isUuid}}{{paramName}}.uuidString{{/isUuid}}{{^isUuid}}{{paramName}}{{/isUuid}}{{/isString}}{{#isInteger}}"\({{paramName}})"{{/isInteger}}{{#isDouble}}"\({{paramName}})"{{/isDouble}}{{#isFloat}}"\({{paramName}})"{{/isFloat}}{{#isNumber}}"\({{paramName}})"{{/isNumber}}{{#isLong}}"\({{paramName}})"{{/isLong}}{{#isBoolean}}{{paramName}} ? "true" : "false"{{/isBoolean}}{{/isEnum}}{{/isArray}}{{/vendorExtensions.x-swift-use-encoder}}
\ No newline at end of file
+{{#isDateTime}}OpenISO8601DateFormatter.shared.string(from: {{paramName}}){{/isDateTime}}{{#vendorExtensions.x-swift-use-encoder}}String(data: try self.encoder.encode({{paramName}}), encoding: .utf8) ?? ""{{/vendorExtensions.x-swift-use-encoder}}{{^vendorExtensions.x-swift-use-encoder}}{{#isArray}}{{paramName}}{{#vendorExtensions.x-swift-is-base-type-uuid}}.map { $0.uuidString }{{/vendorExtensions.x-swift-is-base-type-uuid}}{{#vendorExtensions.x-swift-is-base-type-enum}}.map { $0.rawValue }{{/vendorExtensions.x-swift-is-base-type-enum}}.joined(separator: ","){{/isArray}}{{^isArray}}{{#vendorExtensions.x-swift-is-enum-type}}{{paramName}}.rawValue{{/vendorExtensions.x-swift-is-enum-type}}{{^isEnum}}{{#isString}}{{#isUuid}}{{paramName}}.uuidString{{/isUuid}}{{^isUuid}}{{paramName}}{{/isUuid}}{{/isString}}{{#isInteger}}"\({{paramName}})"{{/isInteger}}{{#isDouble}}"\({{paramName}})"{{/isDouble}}{{#isFloat}}"\({{paramName}})"{{/isFloat}}{{#isNumber}}"\({{paramName}})"{{/isNumber}}{{#isLong}}"\({{paramName}})"{{/isLong}}{{#isBoolean}}{{paramName}} ? "true" : "false"{{/isBoolean}}{{/isEnum}}{{/isArray}}{{/vendorExtensions.x-swift-use-encoder}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/swift5/Validation.mustache b/modules/openapi-generator/src/main/resources/swift5/Validation.mustache
index 70e3abfb5057..91bbcf788555 100644
--- a/modules/openapi-generator/src/main/resources/swift5/Validation.mustache
+++ b/modules/openapi-generator/src/main/resources/swift5/Validation.mustache
@@ -77,11 +77,11 @@ import Foundation
/// - Throws: `ValidationError` if the numeric is invalid against the rule.
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T {
var error = ValidationError(kinds: [])
- if let minium = rule.minimum {
- if !rule.exclusiveMinimum, minium > numeric {
+ if let minimum = rule.minimum {
+ if !rule.exclusiveMinimum, minimum > numeric {
error.kinds.insert(.minimum)
}
- if rule.exclusiveMinimum, minium >= numeric {
+ if rule.exclusiveMinimum, minimum >= numeric {
error.kinds.insert(.minimum)
}
}
@@ -109,11 +109,11 @@ import Foundation
/// - Throws: `ValidationError` if the numeric is invalid against the rule.
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T {
var error = ValidationError(kinds: [])
- if let minium = rule.minimum {
- if !rule.exclusiveMinimum, minium > numeric {
+ if let minimum = rule.minimum {
+ if !rule.exclusiveMinimum, minimum > numeric {
error.kinds.insert(.minimum)
}
- if rule.exclusiveMinimum, minium >= numeric {
+ if rule.exclusiveMinimum, minimum >= numeric {
error.kinds.insert(.minimum)
}
}
diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache
index b045c18c66b5..3f60f35560ea 100644
--- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache
+++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache
@@ -611,12 +611,24 @@ private class FormURLEncoding: ParameterEncoding {
var urlRequest = urlRequest
var requestBodyComponents = URLComponents()
- requestBodyComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:])
+ let queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:])
+
+ /// `httpBody` needs to be percent encoded
+ /// -> https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST
+ /// "application/x-www-form-urlencoded: [...] Non-alphanumeric characters in both keys and values are percent-encoded"
+ let percentEncodedQueryItems = queryItems?.compactMap { queryItem in
+ return URLQueryItem(
+ name: queryItem.name.addingPercentEncoding(withAllowedCharacters: .alphanumerics) ?? queryItem.name,
+ value: queryItem.value?.addingPercentEncoding(withAllowedCharacters: .alphanumerics) ?? queryItem.value)
+ }
+ requestBodyComponents.queryItems = percentEncodedQueryItems
if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil {
urlRequest.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
}
+ /// We can't use `requestBodyComponents.percentEncodedQuery` since this does NOT percent encode the `+` sign
+ /// that is why we do the percent encoding manually for each key/value pair
urlRequest.httpBody = requestBodyComponents.query?.data(using: .utf8)
return urlRequest
diff --git a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache
index 71025d946997..cdc954502fd6 100644
--- a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache
+++ b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache
@@ -11,13 +11,13 @@
{{#validatable}}
{{#hasValidation}}
{{#isString}}
- static let {{{name}}}Rule = StringRule(minLength: {{#minLength}}{{{.}}}{{/minLength}}{{^minLength}}nil{{/minLength}}, maxLength: {{#maxLength}}{{{.}}}{{/maxLength}}{{^maxLength}}nil{{/maxLength}}, pattern: {{#pattern}}"{{{.}}}"{{/pattern}}{{^pattern}}nil{{/pattern}})
+ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static let {{{name}}}Rule = StringRule(minLength: {{#minLength}}{{{.}}}{{/minLength}}{{^minLength}}nil{{/minLength}}, maxLength: {{#maxLength}}{{{.}}}{{/maxLength}}{{^maxLength}}nil{{/maxLength}}, pattern: {{#pattern}}"{{{.}}}"{{/pattern}}{{^pattern}}nil{{/pattern}})
{{/isString}}
{{#isNumeric}}
- static let {{{name}}}Rule = NumericRule<{{{dataType}}}>(minimum: {{#minimum}}{{{.}}}{{/minimum}}{{^minimum}}nil{{/minimum}}, exclusiveMinimum: {{#exclusiveMinimum}}true{{/exclusiveMinimum}}{{^exclusiveMinimum}}false{{/exclusiveMinimum}}, maximum: {{#maximum}}{{{.}}}{{/maximum}}{{^maximum}}nil{{/maximum}}, exclusiveMaximum: {{#exclusiveMaximum}}true{{/exclusiveMaximum}}{{^exclusiveMaximum}}false{{/exclusiveMaximum}}, multipleOf: {{#multipleOf}}{{{.}}}{{/multipleOf}}{{^multipleOf}}nil{{/multipleOf}})
+ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static let {{{name}}}Rule = NumericRule<{{{dataType}}}>(minimum: {{#minimum}}{{{.}}}{{/minimum}}{{^minimum}}nil{{/minimum}}, exclusiveMinimum: {{#exclusiveMinimum}}true{{/exclusiveMinimum}}{{^exclusiveMinimum}}false{{/exclusiveMinimum}}, maximum: {{#maximum}}{{{.}}}{{/maximum}}{{^maximum}}nil{{/maximum}}, exclusiveMaximum: {{#exclusiveMaximum}}true{{/exclusiveMaximum}}{{^exclusiveMaximum}}false{{/exclusiveMaximum}}, multipleOf: {{#multipleOf}}{{{.}}}{{/multipleOf}}{{^multipleOf}}nil{{/multipleOf}})
{{/isNumeric}}
{{#isArray}}
- static let {{{name}}}Rule = ArrayRule(minItems: {{#minItems}}{{{.}}}{{/minItems}}{{^minItems}}nil{{/minItems}}, maxItems: {{#maxItems}}{{{.}}}{{/maxItems}}{{^maxItems}}nil{{/maxItems}}, uniqueItems: {{#uniqueItems}}true{{/uniqueItems}}{{^uniqueItems}}false{{/uniqueItems}})
+ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static let {{{name}}}Rule = ArrayRule(minItems: {{#minItems}}{{{.}}}{{/minItems}}{{^minItems}}nil{{/minItems}}, maxItems: {{#maxItems}}{{{.}}}{{/maxItems}}{{^maxItems}}nil{{/maxItems}}, uniqueItems: {{#uniqueItems}}true{{/uniqueItems}}{{^uniqueItems}}false{{/uniqueItems}})
{{/isArray}}
{{/hasValidation}}
{{/validatable}}
diff --git a/modules/openapi-generator/src/main/resources/swift6/Validation.mustache b/modules/openapi-generator/src/main/resources/swift6/Validation.mustache
index 148a5123760d..2a2dab67d0c4 100644
--- a/modules/openapi-generator/src/main/resources/swift6/Validation.mustache
+++ b/modules/openapi-generator/src/main/resources/swift6/Validation.mustache
@@ -78,11 +78,11 @@ extension NumericRule: Sendable where T: Sendable {}
/// - Throws: `ValidationError` if the numeric is invalid against the rule.
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T {
var error = ValidationError(kinds: [])
- if let minium = rule.minimum {
- if !rule.exclusiveMinimum, minium > numeric {
+ if let minimum = rule.minimum {
+ if !rule.exclusiveMinimum, minimum > numeric {
error.kinds.insert(.minimum)
}
- if rule.exclusiveMinimum, minium >= numeric {
+ if rule.exclusiveMinimum, minimum >= numeric {
error.kinds.insert(.minimum)
}
}
@@ -110,11 +110,11 @@ extension NumericRule: Sendable where T: Sendable {}
/// - Throws: `ValidationError` if the numeric is invalid against the rule.
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T {
var error = ValidationError(kinds: [])
- if let minium = rule.minimum {
- if !rule.exclusiveMinimum, minium > numeric {
+ if let minimum = rule.minimum {
+ if !rule.exclusiveMinimum, minimum > numeric {
error.kinds.insert(.minimum)
}
- if rule.exclusiveMinimum, minium >= numeric {
+ if rule.exclusiveMinimum, minimum >= numeric {
error.kinds.insert(.minimum)
}
}
diff --git a/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache
index a20f72804cd7..94fde0e7e582 100644
--- a/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache
+++ b/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache
@@ -636,12 +636,24 @@ private class FormURLEncoding: ParameterEncoding {
var urlRequest = urlRequest
var requestBodyComponents = URLComponents()
- requestBodyComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:])
+ let queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:])
+
+ /// `httpBody` needs to be percent encoded
+ /// -> https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST
+ /// "application/x-www-form-urlencoded: [...] Non-alphanumeric characters in both keys and values are percent-encoded"
+ let percentEncodedQueryItems = queryItems?.compactMap { queryItem in
+ return URLQueryItem(
+ name: queryItem.name.addingPercentEncoding(withAllowedCharacters: .alphanumerics) ?? queryItem.name,
+ value: queryItem.value?.addingPercentEncoding(withAllowedCharacters: .alphanumerics) ?? queryItem.value)
+ }
+ requestBodyComponents.queryItems = percentEncodedQueryItems
if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil {
urlRequest.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
}
+ /// We can't use `requestBodyComponents.percentEncodedQuery` since this does NOT percent encode the `+` sign
+ /// that is why we do the percent encoding manually for each key/value pair
urlRequest.httpBody = requestBodyComponents.query?.data(using: .utf8)
return urlRequest
diff --git a/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache
index c00584f6e57f..fa2f3c7c32d6 100644
--- a/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache
+++ b/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache
@@ -11,13 +11,13 @@
{{#validatable}}
{{#hasValidation}}
{{#isString}}
- static let {{{name}}}Rule = StringRule(minLength: {{#minLength}}{{{.}}}{{/minLength}}{{^minLength}}nil{{/minLength}}, maxLength: {{#maxLength}}{{{.}}}{{/maxLength}}{{^maxLength}}nil{{/maxLength}}, pattern: {{#pattern}}"{{{.}}}"{{/pattern}}{{^pattern}}nil{{/pattern}})
+ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static let {{{name}}}Rule = StringRule(minLength: {{#minLength}}{{{.}}}{{/minLength}}{{^minLength}}nil{{/minLength}}, maxLength: {{#maxLength}}{{{.}}}{{/maxLength}}{{^maxLength}}nil{{/maxLength}}, pattern: {{#pattern}}"{{{.}}}"{{/pattern}}{{^pattern}}nil{{/pattern}})
{{/isString}}
{{#isNumeric}}
- static let {{{name}}}Rule = NumericRule<{{{dataType}}}>(minimum: {{#minimum}}{{{.}}}{{/minimum}}{{^minimum}}nil{{/minimum}}, exclusiveMinimum: {{#exclusiveMinimum}}true{{/exclusiveMinimum}}{{^exclusiveMinimum}}false{{/exclusiveMinimum}}, maximum: {{#maximum}}{{{.}}}{{/maximum}}{{^maximum}}nil{{/maximum}}, exclusiveMaximum: {{#exclusiveMaximum}}true{{/exclusiveMaximum}}{{^exclusiveMaximum}}false{{/exclusiveMaximum}}, multipleOf: {{#multipleOf}}{{{.}}}{{/multipleOf}}{{^multipleOf}}nil{{/multipleOf}})
+ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static let {{{name}}}Rule = NumericRule<{{{dataType}}}>(minimum: {{#minimum}}{{{.}}}{{/minimum}}{{^minimum}}nil{{/minimum}}, exclusiveMinimum: {{#exclusiveMinimum}}true{{/exclusiveMinimum}}{{^exclusiveMinimum}}false{{/exclusiveMinimum}}, maximum: {{#maximum}}{{{.}}}{{/maximum}}{{^maximum}}nil{{/maximum}}, exclusiveMaximum: {{#exclusiveMaximum}}true{{/exclusiveMaximum}}{{^exclusiveMaximum}}false{{/exclusiveMaximum}}, multipleOf: {{#multipleOf}}{{{.}}}{{/multipleOf}}{{^multipleOf}}nil{{/multipleOf}})
{{/isNumeric}}
{{#isArray}}
- static let {{{name}}}Rule = ArrayRule(minItems: {{#minItems}}{{{.}}}{{/minItems}}{{^minItems}}nil{{/minItems}}, maxItems: {{#maxItems}}{{{.}}}{{/maxItems}}{{^maxItems}}nil{{/maxItems}}, uniqueItems: {{#uniqueItems}}true{{/uniqueItems}}{{^uniqueItems}}false{{/uniqueItems}})
+ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static let {{{name}}}Rule = ArrayRule(minItems: {{#minItems}}{{{.}}}{{/minItems}}{{^minItems}}nil{{/minItems}}, maxItems: {{#maxItems}}{{{.}}}{{/maxItems}}{{^maxItems}}nil{{/maxItems}}, uniqueItems: {{#uniqueItems}}true{{/uniqueItems}}{{^uniqueItems}}false{{/uniqueItems}})
{{/isArray}}
{{/hasValidation}}
{{/validatable}}
diff --git a/modules/openapi-generator/src/main/resources/typescript/package.mustache b/modules/openapi-generator/src/main/resources/typescript/package.mustache
index 34c324c08453..704e3a515a5c 100644
--- a/modules/openapi-generator/src/main/resources/typescript/package.mustache
+++ b/modules/openapi-generator/src/main/resources/typescript/package.mustache
@@ -71,12 +71,10 @@
{{#useInversify}}
"inversify": "^6.0.1",
{{/useInversify}}
- "es6-promise": "^4.2.4",
- "url-parse": "^1.4.3"
+ "es6-promise": "^4.2.4"
},
"devDependencies": {
- "typescript": "^4.0",
- "@types/url-parse": "1.4.4"
+ "typescript": "^4.0"
}{{#npmRepository}},{{/npmRepository}}
{{#npmRepository}}
"publishConfig":{
diff --git a/modules/openapi-generator/src/main/resources/xojo-client/README.mustache b/modules/openapi-generator/src/main/resources/xojo-client/README.mustache
index 2853be362675..027695ee135e 100644
--- a/modules/openapi-generator/src/main/resources/xojo-client/README.mustache
+++ b/modules/openapi-generator/src/main/resources/xojo-client/README.mustache
@@ -33,7 +33,7 @@ This project depends on [Xoson](https://github.com/Topheee/xoson) `v2.2.0` (and
git clone 'https://github.com/Topheee/xoson.git'
```
-Open the `Xoson.xojo_project` from the cloned git repository with Xojo and copy the `Xoson` module to your project. Similarily, open the `{{{projectName}}}.xojo_project` file with Xojo and copy `{{{projectName}}}` to your project.
+Open the `Xoson.xojo_project` from the cloned git repository with Xojo and copy the `Xoson` module to your project. Similarly, open the `{{{projectName}}}.xojo_project` file with Xojo and copy `{{{projectName}}}` to your project.
> Since Xojo currently has no package manager, you need to manually copy both the `Xoson` and the `{{{projectName}}}` modules to your Xojo project.
diff --git a/modules/openapi-generator/src/main/resources/zapier/authentication.mustache b/modules/openapi-generator/src/main/resources/zapier/authentication.mustache
index 8294e5fc99a6..8a1bf2e76b5e 100644
--- a/modules/openapi-generator/src/main/resources/zapier/authentication.mustache
+++ b/modules/openapi-generator/src/main/resources/zapier/authentication.mustache
@@ -1,4 +1,4 @@
module.exports = {
- // TODO: autentication logic
+ // TODO: authentication logic
// https://platform.zapier.com/cli_tutorials/getting-started#adding-authentication
};
\ No newline at end of file
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java
index 4e297f5b0af1..507d272c8e1e 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java
@@ -869,7 +869,7 @@ public void inheritanceWithInlineDiscriminator() {
// Contact
ComposedSchema contact = (ComposedSchema) openAPI.getComponents().getSchemas().get("Contact");
- Schema contactAllOf = contact.getAllOf().get(1); // use the inline child scheam directly
+ Schema contactAllOf = contact.getAllOf().get(1); // use the inline child schema directly
assertEquals(contact.getExtensions().get("x-discriminator-value"), "contact");
assertEquals(contact.getAllOf().get(0).get$ref(), "#/components/schemas/Party");
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java
index 21f36c1ee6a9..8bed0f7382eb 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java
@@ -99,7 +99,7 @@ public void testOpenAPINormalizerEnableKeepOnlyFirstTagInOperation() {
@Test
public void testOpenAPINormalizerRemoveAnyOfOneOfAndKeepPropertiesOnly() {
- // to test the rule REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIIES_ONLY
+ // to test the rule REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml");
Schema schema = openAPI.getComponents().getSchemas().get("Person");
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinSpringServerCodegenTest.java
new file mode 100644
index 000000000000..26f857c2d1e9
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinSpringServerCodegenTest.java
@@ -0,0 +1,63 @@
+package org.openapitools.codegen.kotlin;
+
+import org.openapitools.codegen.ClientOptInput;
+import org.openapitools.codegen.DefaultGenerator;
+import org.openapitools.codegen.TestUtils;
+import org.openapitools.codegen.languages.KotlinSpringServerCodegen;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import static org.testng.Assert.*;
+
+public class KotlinSpringServerCodegenTest {
+
+ @Test
+ public void gradleWrapperIsGenerated() throws IOException {
+ File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
+ output.deleteOnExit();
+
+ KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
+
+ codegen.setOutputDir(output.getAbsolutePath());
+ new DefaultGenerator().opts(
+ new ClientOptInput().openAPI(TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"))
+ .config(codegen)
+ ).generate();
+ String outputPath = output.getAbsolutePath();
+ Path gradleWrapperProperties = Paths.get(outputPath + "/gradle/wrapper/gradle-wrapper.properties");
+ Path gradleWrapperJar = Paths.get(outputPath + "/gradle/wrapper/gradle-wrapper.jar");
+ Path gradleWrapper = Paths.get(outputPath + "/gradlew");
+ Path gradleWrapperBat = Paths.get(outputPath + "/gradlew.bat");
+ TestUtils.assertFileExists(gradleWrapperProperties);
+ TestUtils.assertFileExists(gradleWrapper);
+ TestUtils.assertFileExists(gradleWrapperBat);
+ //Different because file is not a text file
+ assertTrue(Files.exists(gradleWrapperJar));
+
+ //Spring Cloud
+ File outputCloud = Files.createTempDirectory("testCloud").toFile().getCanonicalFile();
+ outputCloud.deleteOnExit();
+ codegen.setLibrary(KotlinSpringServerCodegen.SPRING_CLOUD_LIBRARY);
+ codegen.setOutputDir(outputCloud.getAbsolutePath());
+ new DefaultGenerator().opts(
+ new ClientOptInput().openAPI(TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"))
+ .config(codegen)
+ ).generate();
+
+ String outputPathCloud = outputCloud.getAbsolutePath();
+ Path gradleWrapperPropertiesCloud = Paths.get(outputPathCloud + "/gradle/wrapper/gradle-wrapper.properties");
+ Path gradleWrapperJarCloud = Paths.get(outputPathCloud + "/gradle/wrapper/gradle-wrapper.jar");
+ Path gradleWrapperCloud = Paths.get(outputPathCloud + "/gradlew");
+ Path gradleWrapperBatCloud = Paths.get(outputPathCloud + "/gradlew.bat");
+ TestUtils.assertFileExists(gradleWrapperPropertiesCloud);
+ TestUtils.assertFileExists(gradleWrapperCloud);
+ TestUtils.assertFileExists(gradleWrapperBatCloud);
+ //Different because file is not a text file
+ assertTrue(Files.exists(gradleWrapperJarCloud));
+ }
+}
diff --git a/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml b/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml
index f20f1569b6db..d8d01947081c 100644
--- a/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml
+++ b/modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml
@@ -395,6 +395,25 @@ paths:
schema:
type: string
description: Thank you message
+ '/store/recommend':
+ post:
+ tags:
+ - store
+ summary: Would you recommend our service to a friend?
+ description: ''
+ operationId: sendRecommend
+ parameters:
+ - in: formData
+ name: recommend
+ description: Would you recommend us or not?
+ required: no
+ type: boolean
+ responses:
+ '200':
+ description: successful operation
+ schema:
+ type: string
+ description: Thank you message
/store/daysWithoutIncident:
get:
tags:
diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json b/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json
index 1fee47e06241..ed62ce62b1e6 100644
--- a/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json
+++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json
@@ -94117,7 +94117,7 @@
"nullable": true
},
"idle_timeout_notice": {
- "description": "Text to show user when codespace idle timeout minutes has been overriden by an organization policy",
+ "description": "Text to show user when codespace idle timeout minutes has been overridden by an organization policy",
"type": "string",
"nullable": true
},
@@ -116606,7 +116606,7 @@
"nullable": true
},
"idle_timeout_notice": {
- "description": "Text to show user when codespace idle timeout minutes has been overriden by an organization policy",
+ "description": "Text to show user when codespace idle timeout minutes has been overridden by an organization policy",
"type": "string",
"nullable": true
},
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/.editorconfig b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/.editorconfig
deleted file mode 100644
index 5ad6921484a1..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/.editorconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-[*.cs]
-dotnet_diagnostic.xUnit1031.severity = none
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/BodyApiTests.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/BodyApiTests.cs
deleted file mode 100644
index 06da198a3efa..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/BodyApiTests.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Echo Server API
- *
- * Echo Server API
- *
- * The version of the OpenAPI document: 0.1.0
- * Contact: team@openapitools.org
- * Generated by: https://github.com/openapitools/openapi-generator.git
- */
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using RestSharp;
-using Xunit;
-
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Model;
-// uncomment below to import models
-//using Org.OpenAPITools.Model;
-
-namespace Org.OpenAPITools.Test.Api
-{
- ///
- /// Class for testing BodyApi
- ///
- ///
- /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
- /// Please update the test case below to test the API endpoint.
- ///
- public class BodyApiTests : IDisposable
- {
- private BodyApi instance;
-
- public BodyApiTests()
- {
- instance = new BodyApi();
- }
-
- public void Dispose()
- {
- // Cleanup when everything is done.
- }
-
- ///
- /// Test an instance of BodyApi
- ///
- [Fact]
- public void InstanceTest()
- {
- // TODO uncomment below to test 'IsType' BodyApi
- //Assert.IsType(instance);
- }
-
- ///
- /// Test TestBinaryGif
- ///
- [Fact]
- public void TestBinaryGifTest()
- {
- // TODO uncomment below to test the method and replace null with proper value
- //var response = instance.TestBinaryGif();
- //Assert.IsType(response);
- }
-
- ///
- /// Test TestBodyApplicationOctetstreamBinary
- ///
- [Fact]
- public void TestBodyApplicationOctetstreamBinaryTest()
- {
- // TODO uncomment below to test the method and replace null with proper value
- //System.IO.Stream? body = null;
- //var response = instance.TestBodyApplicationOctetstreamBinary(body);
- //Assert.IsType(response);
- }
-
- ///
- /// Test TestEchoBodyFreeFormObjectResponseString
- ///
- [Fact]
- public void TestEchoBodyFreeFormObjectResponseStringTest()
- {
- // TODO uncomment below to test the method and replace null with proper value
- //Object? body = null;
- //var response = instance.TestEchoBodyFreeFormObjectResponseString(body);
- //Assert.IsType(response);
- }
-
- ///
- /// Test TestEchoBodyPet
- ///
- [Fact]
- public void TestEchoBodyPetTest()
- {
- Pet? pet = new Pet(123, "cat", new Category() { Id = 12, Name = "Test" }, new List(){"http://google.com"},null, null);
- var response = instance.TestEchoBodyPet(pet);
- Assert.IsType(response);
- }
-
- ///
- /// Test TestEchoBodyPetResponseString
- ///
- [Fact]
- public void TestEchoBodyPetResponseStringTest()
- {
- // TODO uncomment below to test the method and replace null with proper value
- //Pet? pet = null;
- //var response = instance.TestEchoBodyPetResponseString(pet);
- //Assert.IsType(response);
- }
-
- ///
- /// Test TestEchoBodyTagResponseString
- ///
- [Fact]
- public void TestEchoBodyTagResponseStringTest()
- {
- // TODO uncomment below to test the method and replace null with proper value
- //Tag? tag = null;
- //var response = instance.TestEchoBodyTagResponseString(tag);
- //Assert.IsType(response);
- }
- }
-}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/FormApiTests.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/FormApiTests.cs
deleted file mode 100644
index d5bc490bddeb..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/FormApiTests.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Echo Server API
- *
- * Echo Server API
- *
- * The version of the OpenAPI document: 0.1.0
- * Contact: team@openapitools.org
- * Generated by: https://github.com/openapitools/openapi-generator.git
- */
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using RestSharp;
-using Xunit;
-
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Api;
-
-namespace Org.OpenAPITools.Test.Api
-{
- ///
- /// Class for testing FormApi
- ///
- ///
- /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
- /// Please update the test case below to test the API endpoint.
- ///
- public class FormApiTests : IDisposable
- {
- private FormApi instance;
-
- public FormApiTests()
- {
- instance = new FormApi();
- }
-
- public void Dispose()
- {
- // Cleanup when everything is done.
- }
-
- ///
- /// Test an instance of FormApi
- ///
- [Fact]
- public void InstanceTest()
- {
- // TODO uncomment below to test 'IsType' FormApi
- //Assert.IsType(instance);
- }
-
- ///
- /// Test TestFormIntegerBooleanString
- ///
- [Fact]
- public void TestFormIntegerBooleanStringTest()
- {
- // TODO uncomment below to test the method and replace null with proper value
- //int? integerForm = null;
- //bool? booleanForm = null;
- //string? stringForm = null;
- //var response = instance.TestFormIntegerBooleanString(integerForm, booleanForm, stringForm);
- //Assert.IsType(response);
- }
- }
-}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/CustomTest.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/CustomTest.cs
deleted file mode 100644
index 06b930205b5c..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/CustomTest.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using Newtonsoft.Json.Linq;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Model;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml;
-using Xunit;
-
-namespace Org.OpenAPITools.Test
-{
- public class CustomTest
- {
- private QueryApi api = new QueryApi();
- private BodyApi bodyApi = new BodyApi();
-
- [Fact]
- public void TestEchoBodyPet()
- {
- Pet queryObject = new Pet(12345L, "Hello World", new Category(987L, "new category"), new List { "http://a.com", "http://b.com" });
- Pet p = bodyApi.TestEchoBodyPet(queryObject);
- Assert.NotNull(p);
- Assert.Equal("Hello World", p.Name);
- Assert.Equal(12345L, p.Id);
-
- // response is empty body
- Pet p2 = bodyApi.TestEchoBodyPet(null);
- Assert.Null(p2);
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- *
- * @throws ApiException if the Api call fails
- */
- [Fact]
- public void TestQueryStyleFormExplodeTrueObjectTest()
- {
- Pet queryObject = new Pet(12345L, "Hello World", new Category(987L, "new category"), new List { "http://a.com", "http://b.com" });
- String response = api.TestQueryStyleFormExplodeTrueObject(queryObject);
- EchoServerResponseParser p = new EchoServerResponseParser(response);
- Assert.Equal("/query/style_form/explode_true/object?query_object=class%20Pet%20%7b%0a%20%20Id%3a%2012345%0a%20%20Name%3a%20Hello%20World%0a%20%20Category%3a%20class%20Category%20%7b%0a%20%20Id%3a%20987%0a%20%20Name%3a%20new%20category%0a%7d%0a%0a%20%20PhotoUrls%3a%20System.Collections.Generic.List%601%5bSystem.String%5d%0a%20%20Tags%3a%20%0a%20%20Status%3a%20%0a%7d%0a", p.path);
- }
-
- [Fact]
- public void testQueryStyleDeepObjectExplodeTrueObjectTest()
- {
- Pet queryObject = new Pet(12345L, "Hello World", new Category(987L, "new category"), new List { "http://a.com", "http://b.com" });
- String response = api.TestQueryStyleDeepObjectExplodeTrueObject(queryObject);
- EchoServerResponseParser p = new EchoServerResponseParser(response);
- Assert.Equal("/query/style_deepObject/explode_true/object?queryObject%5bid%5d=12345&queryObject%5bname%5d=Hello%20World&queryObject%5bcategory%5d=class%20Category%20%7b%0a%20%20Id%3a%20987%0a%20%20Name%3a%20new%20category%0a%7d%0a&queryObject%5bphotoUrls%5d=http%3a%2f%2fa.com%2chttp%3a%2f%2fb.com", p.path);
- }
-
-
- [Fact]
- public void testQueryStyleDeepObjectExplodeTrueObjectAsyncTest()
- {
- Pet queryObject = new Pet(12345L, "Hello World", new Category(987L, "new category"), new List { "http://a.com", "http://b.com" });
- Task responseTask = api.TestQueryStyleDeepObjectExplodeTrueObjectAsync(queryObject);
- EchoServerResponseParser p = new EchoServerResponseParser(responseTask.Result);
- Assert.Equal("/query/style_deepObject/explode_true/object?queryObject%5bid%5d=12345&queryObject%5bname%5d=Hello%20World&queryObject%5bcategory%5d=class%20Category%20%7b%0a%20%20Id%3a%20987%0a%20%20Name%3a%20new%20category%0a%7d%0a&queryObject%5bphotoUrls%5d=http%3a%2f%2fa.com%2chttp%3a%2f%2fb.com", p.path);
- }
- }
-}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/EchoServerResponseParser.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/EchoServerResponseParser.cs
deleted file mode 100644
index f87dae4ed12e..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/EchoServerResponseParser.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using static System.Net.Mime.MediaTypeNames;
-
-namespace Org.OpenAPITools.Test
-{
- public class EchoServerResponseParser
- {
- public String method; // e.g. GET
- public String path; // e.g. /query/style_form/explode_true/object?id=12345
- public String protocol; // e.g. HTTP/1.1
- public Dictionary headers = new Dictionary();
- public String body; // e.g. Hello World!
-
- public EchoServerResponseParser(String response)
- {
- if (response == null)
- {
- throw new SystemException("Echo server response cannot be null");
- }
-
- String[] lines = Regex.Split(response, "\r\n|\r|\n");
- bool firstLine = true;
- bool bodyStart = false;
- StringBuilder bodyBuilder = new StringBuilder();
-
- foreach (String line in lines)
- {
- if (firstLine)
- {
- String[] items = line.Split(" ");
- this.method = items[0];
- this.path = items[1];
- this.protocol = items[2];
- firstLine = false;
- continue;
- }
-
- if (bodyStart)
- {
- bodyBuilder.Append(line);
- bodyBuilder.Append("\n");
- }
-
- if (String.IsNullOrEmpty(line))
- {
- bodyStart = true;
- continue;
- }
-
- // store the header key-value pair in headers
- String[] keyValue = line.Split(": ");
- if (keyValue.Length == 2)
- { // skip blank line, non key-value pair
- this.headers.Add(keyValue[0], keyValue[1]);
- }
- }
-
- body = bodyBuilder.ToString();
- }
- }
-}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
deleted file mode 100644
index a381e6a2f3cf..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- Org.OpenAPITools.Test
- Org.OpenAPITools.Test
- net6.0
- false
- annotations
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs
deleted file mode 100644
index 655b101ecf78..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs
+++ /dev/null
@@ -1,815 +0,0 @@
-/*
- * Echo Server API
- *
- * Echo Server API
- *
- * The version of the OpenAPI document: 0.1.0
- * Contact: team@openapitools.org
- * Generated by: https://github.com/openapitools/openapi-generator.git
- */
-
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Formatters;
-using System.Text;
-using System.Threading;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
-using RestSharp;
-using RestSharp.Serializers;
-using RestSharpMethod = RestSharp.Method;
-using FileIO = System.IO.File;
-using Polly;
-using Org.OpenAPITools.Model;
-
-namespace Org.OpenAPITools.Client
-{
- ///
- /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
- ///
- internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer
- {
- private readonly IReadableConfiguration _configuration;
- private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
- {
- // OpenAPI generated types generally hide default constructors.
- ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
- ContractResolver = new DefaultContractResolver
- {
- NamingStrategy = new CamelCaseNamingStrategy
- {
- OverrideSpecifiedNames = false
- }
- }
- };
-
- public CustomJsonCodec(IReadableConfiguration configuration)
- {
- _configuration = configuration;
- }
-
- public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
- {
- _serializerSettings = serializerSettings;
- _configuration = configuration;
- }
-
- ///
- /// Serialize the object into a JSON string.
- ///
- /// Object to be serialized.
- /// A JSON string.
- public string Serialize(object obj)
- {
- if (obj != null && obj is AbstractOpenAPISchema)
- {
- // the object to be serialized is an oneOf/anyOf schema
- return ((AbstractOpenAPISchema)obj).ToJson();
- }
- else
- {
- return JsonConvert.SerializeObject(obj, _serializerSettings);
- }
- }
-
- public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value);
-
- public T Deserialize(RestResponse response)
- {
- var result = (T)Deserialize(response, typeof(T));
- return result;
- }
-
- ///
- /// Deserialize the JSON string into a proper object.
- ///
- /// The HTTP response.
- /// Object type.
- /// Object representation of the JSON string.
- internal object Deserialize(RestResponse response, Type type)
- {
- if (type == typeof(byte[])) // return byte array
- {
- return response.RawBytes;
- }
-
- // TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
- if (type == typeof(Stream))
- {
- var bytes = response.RawBytes;
- if (response.Headers != null)
- {
- var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath)
- ? global::System.IO.Path.GetTempPath()
- : _configuration.TempFolderPath;
- var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
- foreach (var header in response.Headers)
- {
- var match = regex.Match(header.ToString());
- if (match.Success)
- {
- string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
- FileIO.WriteAllBytes(fileName, bytes);
- return new FileStream(fileName, FileMode.Open);
- }
- }
- }
- var stream = new MemoryStream(bytes);
- return stream;
- }
-
- if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
- {
- return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind);
- }
-
- if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type
- {
- return Convert.ChangeType(response.Content, type);
- }
-
- // at this point, it must be a model (json)
- try
- {
- return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
- }
- catch (Exception e)
- {
- throw new ApiException(500, e.Message);
- }
- }
-
- public ISerializer Serializer => this;
- public IDeserializer Deserializer => this;
-
- public string[] AcceptedContentTypes => ContentType.JsonAccept;
-
- public SupportsContentType SupportsContentType => contentType =>
- contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) ||
- contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase);
-
- public ContentType ContentType { get; set; } = ContentType.Json;
-
- public DataFormat DataFormat => DataFormat.Json;
- }
- ///
- /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
- /// encapsulating general REST accessor use cases.
- ///
- public partial class ApiClient : ISynchronousClient, IAsynchronousClient
- {
- private readonly string _baseUrl;
-
- ///
- /// Specifies the settings on a object.
- /// These settings can be adjusted to accommodate custom serialization rules.
- ///
- public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
- {
- // OpenAPI generated types generally hide default constructors.
- ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
- ContractResolver = new DefaultContractResolver
- {
- NamingStrategy = new CamelCaseNamingStrategy
- {
- OverrideSpecifiedNames = false
- }
- }
- };
-
- ///
- /// Allows for extending request processing for generated code.
- ///
- /// The RestSharp request object
- partial void InterceptRequest(RestRequest request);
-
- ///
- /// Allows for extending response processing for generated code.
- ///
- /// The RestSharp request object
- /// The RestSharp response object
- partial void InterceptResponse(RestRequest request, RestResponse response);
-
- ///
- /// Initializes a new instance of the , defaulting to the global configurations' base url.
- ///
- public ApiClient()
- {
- _baseUrl = GlobalConfiguration.Instance.BasePath;
- }
-
- ///
- /// Initializes a new instance of the
- ///
- /// The target service's base path in URL format.
- ///
- public ApiClient(string basePath)
- {
- if (string.IsNullOrEmpty(basePath))
- throw new ArgumentException("basePath cannot be empty");
-
- _baseUrl = basePath;
- }
-
- ///
- /// Constructs the RestSharp version of an http method
- ///
- /// Swagger Client Custom HttpMethod
- /// RestSharp's HttpMethod instance.
- ///
- private RestSharpMethod Method(HttpMethod method)
- {
- RestSharpMethod other;
- switch (method)
- {
- case HttpMethod.Get:
- other = RestSharpMethod.Get;
- break;
- case HttpMethod.Post:
- other = RestSharpMethod.Post;
- break;
- case HttpMethod.Put:
- other = RestSharpMethod.Put;
- break;
- case HttpMethod.Delete:
- other = RestSharpMethod.Delete;
- break;
- case HttpMethod.Head:
- other = RestSharpMethod.Head;
- break;
- case HttpMethod.Options:
- other = RestSharpMethod.Options;
- break;
- case HttpMethod.Patch:
- other = RestSharpMethod.Patch;
- break;
- default:
- throw new ArgumentOutOfRangeException("method", method, null);
- }
-
- return other;
- }
-
- ///
- /// Provides all logic for constructing a new RestSharp .
- /// At this point, all information for querying the service is known.
- /// Here, it is simply mapped into the RestSharp request.
- ///
- /// The http verb.
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object.
- /// It is assumed that any merge with GlobalConfiguration has been done before calling this method.
- /// [private] A new RestRequest instance.
- ///
- private RestRequest NewRequest(
- HttpMethod method,
- string path,
- RequestOptions options,
- IReadableConfiguration configuration)
- {
- if (path == null) throw new ArgumentNullException("path");
- if (options == null) throw new ArgumentNullException("options");
- if (configuration == null) throw new ArgumentNullException("configuration");
-
- RestRequest request = new RestRequest(path, Method(method));
-
- if (options.PathParameters != null)
- {
- foreach (var pathParam in options.PathParameters)
- {
- request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment);
- }
- }
-
- if (options.QueryParameters != null)
- {
- foreach (var queryParam in options.QueryParameters)
- {
- foreach (var value in queryParam.Value)
- {
- request.AddQueryParameter(queryParam.Key, value);
- }
- }
- }
-
- if (configuration.DefaultHeaders != null)
- {
- foreach (var headerParam in configuration.DefaultHeaders)
- {
- request.AddHeader(headerParam.Key, headerParam.Value);
- }
- }
-
- if (options.HeaderParameters != null)
- {
- foreach (var headerParam in options.HeaderParameters)
- {
- foreach (var value in headerParam.Value)
- {
- request.AddHeader(headerParam.Key, value);
- }
- }
- }
-
- if (options.FormParameters != null)
- {
- foreach (var formParam in options.FormParameters)
- {
- request.AddParameter(formParam.Key, formParam.Value);
- }
- }
-
- if (options.Data != null)
- {
- if (options.Data is Stream stream)
- {
- var contentType = "application/octet-stream";
- if (options.HeaderParameters != null)
- {
- var contentTypes = options.HeaderParameters["Content-Type"];
- contentType = contentTypes[0];
- }
-
- var bytes = ClientUtils.ReadAsBytes(stream);
- request.AddParameter(contentType, bytes, ParameterType.RequestBody);
- }
- else
- {
- if (options.HeaderParameters != null)
- {
- var contentTypes = options.HeaderParameters["Content-Type"];
- if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json")))
- {
- request.RequestFormat = DataFormat.Json;
- }
- else
- {
- // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default.
- }
- }
- else
- {
- // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly.
- request.RequestFormat = DataFormat.Json;
- }
-
- request.AddJsonBody(options.Data);
- }
- }
-
- if (options.FileParameters != null)
- {
- foreach (var fileParam in options.FileParameters)
- {
- foreach (var file in fileParam.Value)
- {
- var bytes = ClientUtils.ReadAsBytes(file);
- var fileStream = file as FileStream;
- if (fileStream != null)
- request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name));
- else
- request.AddFile(fileParam.Key, bytes, "no_file_name_provided");
- }
- }
- }
-
- return request;
- }
-
- ///
- /// Transforms a RestResponse instance into a new ApiResponse instance.
- /// At this point, we have a concrete http response from the service.
- /// Here, it is simply mapped into the [public] ApiResponse object.
- ///
- /// The RestSharp response object
- /// A new ApiResponse instance.
- private ApiResponse ToApiResponse(RestResponse response)
- {
- T result = response.Data;
- string rawContent = response.Content;
-
- var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent)
- {
- ErrorText = response.ErrorMessage,
- Cookies = new List()
- };
-
- if (response.Headers != null)
- {
- foreach (var responseHeader in response.Headers)
- {
- transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
- }
- }
-
- if (response.ContentHeaders != null)
- {
- foreach (var responseHeader in response.ContentHeaders)
- {
- transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
- }
- }
-
- if (response.Cookies != null)
- {
- foreach (var responseCookies in response.Cookies.Cast())
- {
- transformed.Cookies.Add(
- new Cookie(
- responseCookies.Name,
- responseCookies.Value,
- responseCookies.Path,
- responseCookies.Domain)
- );
- }
- }
-
- return transformed;
- }
-
- ///
- /// Executes the HTTP request for the current service.
- /// Based on functions received it can be async or sync.
- ///
- /// Local function that executes http request and returns http response.
- /// Local function to specify options for the service.
- /// The RestSharp request object
- /// The RestSharp options object
- /// A per-request configuration object.
- /// It is assumed that any merge with GlobalConfiguration has been done before calling this method.
- /// A new ApiResponse instance.
- private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration)
- {
- var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl;
- var clientOptions = new RestClientOptions(baseUrl)
- {
- ClientCertificates = configuration.ClientCertificates,
- Timeout = configuration.Timeout,
- Proxy = configuration.Proxy,
- UserAgent = configuration.UserAgent,
- UseDefaultCredentials = configuration.UseDefaultCredentials,
- RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback
- };
- setOptions(clientOptions);
-
- using (RestClient client = new RestClient(clientOptions,
- configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration))))
- {
- InterceptRequest(request);
-
- RestResponse response = await getResponse(client);
-
- // if the response type is oneOf/anyOf, call FromJSON to deserialize the data
- if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
- {
- try
- {
- response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content });
- }
- catch (Exception ex)
- {
- throw ex.InnerException != null ? ex.InnerException : ex;
- }
- }
- else if (typeof(T).Name == "Stream") // for binary response
- {
- response.Data = (T)(object)new MemoryStream(response.RawBytes);
- }
- else if (typeof(T).Name == "Byte[]") // for byte response
- {
- response.Data = (T)(object)response.RawBytes;
- }
- else if (typeof(T).Name == "String") // for string response
- {
- response.Data = (T)(object)response.Content;
- }
-
- InterceptResponse(request, response);
-
- var result = ToApiResponse(response);
- if (response.ErrorMessage != null)
- {
- result.ErrorText = response.ErrorMessage;
- }
-
- if (response.Cookies != null && response.Cookies.Count > 0)
- {
- if (result.Cookies == null) result.Cookies = new List();
- foreach (var restResponseCookie in response.Cookies.Cast())
- {
- var cookie = new Cookie(
- restResponseCookie.Name,
- restResponseCookie.Value,
- restResponseCookie.Path,
- restResponseCookie.Domain
- )
- {
- Comment = restResponseCookie.Comment,
- CommentUri = restResponseCookie.CommentUri,
- Discard = restResponseCookie.Discard,
- Expired = restResponseCookie.Expired,
- Expires = restResponseCookie.Expires,
- HttpOnly = restResponseCookie.HttpOnly,
- Port = restResponseCookie.Port,
- Secure = restResponseCookie.Secure,
- Version = restResponseCookie.Version
- };
-
- result.Cookies.Add(cookie);
- }
- }
- return result;
- }
- }
-
- private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default)
- {
- if (policyResult.Outcome == OutcomeType.Successful)
- {
- return await client.Deserialize(policyResult.Result, cancellationToken);
- }
- else
- {
- return new RestResponse(request)
- {
- ErrorException = policyResult.FinalException
- };
- }
- }
-
- private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration)
- {
- Action setOptions = (clientOptions) =>
- {
- var cookies = new CookieContainer();
-
- if (options.Cookies != null && options.Cookies.Count > 0)
- {
- foreach (var cookie in options.Cookies)
- {
- cookies.Add(new Cookie(cookie.Name, cookie.Value));
- }
- }
- clientOptions.CookieContainer = cookies;
- };
-
- Func>> getResponse = (client) =>
- {
- if (RetryConfiguration.RetryPolicy != null)
- {
- var policy = RetryConfiguration.RetryPolicy;
- var policyResult = policy.ExecuteAndCapture(() => client.Execute(request));
- return DeserializeRestResponseFromPolicyAsync(client, request, policyResult);
- }
- else
- {
- return Task.FromResult(client.Execute(request));
- }
- };
-
- return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult();
- }
-
- private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken))
- {
- Action setOptions = (clientOptions) =>
- {
- //no extra options
- };
-
- Func>> getResponse = async (client) =>
- {
- if (RetryConfiguration.AsyncRetryPolicy != null)
- {
- var policy = RetryConfiguration.AsyncRetryPolicy;
- var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false);
- return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken);
- }
- else
- {
- return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
- }
- };
-
- return ExecClientAsync(getResponse, setOptions, request, options, configuration);
- }
-
- #region IAsynchronousClient
- ///
- /// Make a HTTP GET request (async).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// Token that enables callers to cancel the request.
- /// A Task containing ApiResponse
- public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken);
- }
-
- ///
- /// Make a HTTP POST request (async).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// Token that enables callers to cancel the request.
- /// A Task containing ApiResponse
- public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken);
- }
-
- ///
- /// Make a HTTP PUT request (async).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// Token that enables callers to cancel the request.
- /// A Task containing ApiResponse
- public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken);
- }
-
- ///
- /// Make a HTTP DELETE request (async).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// Token that enables callers to cancel the request.
- /// A Task containing ApiResponse
- public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken);
- }
-
- ///
- /// Make a HTTP HEAD request (async).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// Token that enables callers to cancel the request.
- /// A Task containing ApiResponse
- public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken);
- }
-
- ///
- /// Make a HTTP OPTION request (async).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// Token that enables callers to cancel the request.
- /// A Task containing ApiResponse
- public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken);
- }
-
- ///
- /// Make a HTTP PATCH request (async).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// Token that enables callers to cancel the request.
- /// A Task containing ApiResponse
- public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken);
- }
- #endregion IAsynchronousClient
-
- #region ISynchronousClient
- ///
- /// Make a HTTP GET request (synchronous).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// A Task containing ApiResponse
- public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config);
- }
-
- ///
- /// Make a HTTP POST request (synchronous).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// A Task containing ApiResponse
- public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config);
- }
-
- ///
- /// Make a HTTP PUT request (synchronous).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// A Task containing ApiResponse
- public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config);
- }
-
- ///
- /// Make a HTTP DELETE request (synchronous).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// A Task containing ApiResponse
- public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config);
- }
-
- ///
- /// Make a HTTP HEAD request (synchronous).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// A Task containing ApiResponse
- public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config);
- }
-
- ///
- /// Make a HTTP OPTION request (synchronous).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// A Task containing ApiResponse
- public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config);
- }
-
- ///
- /// Make a HTTP PATCH request (synchronous).
- ///
- /// The target path (or resource).
- /// The additional request options.
- /// A per-request configuration object. It is assumed that any merge with
- /// GlobalConfiguration has been done before calling this method.
- /// A Task containing ApiResponse
- public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null)
- {
- var config = configuration ?? GlobalConfiguration.Instance;
- return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config);
- }
- #endregion ISynchronousClient
- }
-}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj
deleted file mode 100644
index a5a6bf6200b9..000000000000
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
- false
- net6.0
- Org.OpenAPITools
- Org.OpenAPITools
- Library
- OpenAPI
- OpenAPI
- OpenAPI Library
- A library generated from a OpenAPI doc
- No Copyright
- Org.OpenAPITools
- 1.0.0
- bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml
- https://github.com/GIT_USER_ID/GIT_REPO_ID.git
- git
- Minor update
- annotations
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/client/echo_api/csharp-restsharp/.gitignore b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/.gitignore
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/.gitignore
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/.gitignore
diff --git a/samples/client/echo_api/csharp-restsharp/.openapi-generator-ignore b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/.openapi-generator-ignore
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/.openapi-generator-ignore
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/.openapi-generator-ignore
diff --git a/samples/client/echo_api/csharp-restsharp/.openapi-generator/FILES b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/.openapi-generator/FILES
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/.openapi-generator/FILES
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/.openapi-generator/FILES
diff --git a/samples/client/echo_api/csharp-restsharp/.openapi-generator/VERSION b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/.openapi-generator/VERSION
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/.openapi-generator/VERSION
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/.openapi-generator/VERSION
diff --git a/samples/client/echo_api/csharp-restsharp/Org.OpenAPITools.sln b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/Org.OpenAPITools.sln
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/Org.OpenAPITools.sln
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/Org.OpenAPITools.sln
diff --git a/samples/client/echo_api/csharp-restsharp/README.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/README.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/README.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/README.md
diff --git a/samples/client/echo_api/csharp-restsharp/api/openapi.yaml b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/api/openapi.yaml
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/api/openapi.yaml
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/api/openapi.yaml
diff --git a/samples/client/echo_api/csharp-restsharp/appveyor.yml b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/appveyor.yml
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/appveyor.yml
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/appveyor.yml
diff --git a/samples/client/echo_api/csharp-restsharp/docs/AuthApi.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/AuthApi.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/AuthApi.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/AuthApi.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/Bird.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Bird.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/Bird.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Bird.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/BodyApi.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/BodyApi.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/BodyApi.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/BodyApi.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/Category.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Category.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/Category.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Category.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/DataQuery.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/DataQuery.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/DataQuery.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/DataQuery.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/DefaultValue.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/DefaultValue.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/DefaultValue.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/DefaultValue.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/FormApi.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/FormApi.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/FormApi.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/FormApi.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/HeaderApi.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/HeaderApi.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/HeaderApi.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/HeaderApi.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/NumberPropertiesOnly.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/NumberPropertiesOnly.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/NumberPropertiesOnly.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/NumberPropertiesOnly.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/PathApi.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/PathApi.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/PathApi.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/PathApi.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/Pet.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Pet.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/Pet.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Pet.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/Query.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Query.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/Query.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Query.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/QueryApi.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/QueryApi.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/QueryApi.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/QueryApi.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/StringEnumRef.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/StringEnumRef.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/StringEnumRef.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/StringEnumRef.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/Tag.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Tag.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/Tag.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/Tag.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/TestFormObjectMultipartRequestMarker.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/TestFormObjectMultipartRequestMarker.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/TestFormObjectMultipartRequestMarker.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/TestFormObjectMultipartRequestMarker.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
diff --git a/samples/client/echo_api/csharp-restsharp/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
diff --git a/samples/client/echo_api/csharp-restsharp/git_push.sh b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/git_push.sh
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/git_push.sh
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/git_push.sh
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/AuthApiTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/AuthApiTests.cs
similarity index 82%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/AuthApiTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/AuthApiTests.cs
index 456245d7bab6..7aee0fb1720e 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/AuthApiTests.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/AuthApiTests.cs
@@ -63,5 +63,16 @@ public void TestAuthHttpBasicTest()
//var response = instance.TestAuthHttpBasic();
//Assert.IsType(response);
}
+
+ ///
+ /// Test TestAuthHttpBearer
+ ///
+ [Fact]
+ public void TestAuthHttpBearerTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //var response = instance.TestAuthHttpBearer();
+ //Assert.IsType(response);
+ }
}
}
diff --git a/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/BodyApiTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/BodyApiTests.cs
new file mode 100644
index 000000000000..44f3129559b7
--- /dev/null
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/BodyApiTests.cs
@@ -0,0 +1,177 @@
+/*
+ * Echo Server API
+ *
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Reflection;
+using RestSharp;
+using Xunit;
+
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Api;
+// uncomment below to import models
+//using Org.OpenAPITools.Model;
+
+namespace Org.OpenAPITools.Test.Api
+{
+ ///
+ /// Class for testing BodyApi
+ ///
+ ///
+ /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
+ /// Please update the test case below to test the API endpoint.
+ ///
+ public class BodyApiTests : IDisposable
+ {
+ private BodyApi instance;
+
+ public BodyApiTests()
+ {
+ instance = new BodyApi();
+ }
+
+ public void Dispose()
+ {
+ // Cleanup when everything is done.
+ }
+
+ ///
+ /// Test an instance of BodyApi
+ ///
+ [Fact]
+ public void InstanceTest()
+ {
+ // TODO uncomment below to test 'IsType' BodyApi
+ //Assert.IsType(instance);
+ }
+
+ ///
+ /// Test TestBinaryGif
+ ///
+ [Fact]
+ public void TestBinaryGifTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //var response = instance.TestBinaryGif();
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestBodyApplicationOctetstreamBinary
+ ///
+ [Fact]
+ public void TestBodyApplicationOctetstreamBinaryTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //System.IO.Stream? body = null;
+ //var response = instance.TestBodyApplicationOctetstreamBinary(body);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestBodyMultipartFormdataArrayOfBinary
+ ///
+ [Fact]
+ public void TestBodyMultipartFormdataArrayOfBinaryTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //List files = null;
+ //var response = instance.TestBodyMultipartFormdataArrayOfBinary(files);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestBodyMultipartFormdataSingleBinary
+ ///
+ [Fact]
+ public void TestBodyMultipartFormdataSingleBinaryTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //System.IO.Stream? myFile = null;
+ //var response = instance.TestBodyMultipartFormdataSingleBinary(myFile);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestEchoBodyAllOfPet
+ ///
+ [Fact]
+ public void TestEchoBodyAllOfPetTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //Pet? pet = null;
+ //var response = instance.TestEchoBodyAllOfPet(pet);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestEchoBodyFreeFormObjectResponseString
+ ///
+ [Fact]
+ public void TestEchoBodyFreeFormObjectResponseStringTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //Object? body = null;
+ //var response = instance.TestEchoBodyFreeFormObjectResponseString(body);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestEchoBodyPet
+ ///
+ [Fact]
+ public void TestEchoBodyPetTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //Pet? pet = null;
+ //var response = instance.TestEchoBodyPet(pet);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestEchoBodyPetResponseString
+ ///
+ [Fact]
+ public void TestEchoBodyPetResponseStringTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //Pet? pet = null;
+ //var response = instance.TestEchoBodyPetResponseString(pet);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestEchoBodyStringEnum
+ ///
+ [Fact]
+ public void TestEchoBodyStringEnumTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //string? body = null;
+ //var response = instance.TestEchoBodyStringEnum(body);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestEchoBodyTagResponseString
+ ///
+ [Fact]
+ public void TestEchoBodyTagResponseStringTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //Tag? tag = null;
+ //var response = instance.TestEchoBodyTagResponseString(tag);
+ //Assert.IsType(response);
+ }
+ }
+}
diff --git a/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/FormApiTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/FormApiTests.cs
new file mode 100644
index 000000000000..00b610e43f03
--- /dev/null
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/FormApiTests.cs
@@ -0,0 +1,101 @@
+/*
+ * Echo Server API
+ *
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Reflection;
+using RestSharp;
+using Xunit;
+
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Api;
+// uncomment below to import models
+//using Org.OpenAPITools.Model;
+
+namespace Org.OpenAPITools.Test.Api
+{
+ ///
+ /// Class for testing FormApi
+ ///
+ ///
+ /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
+ /// Please update the test case below to test the API endpoint.
+ ///
+ public class FormApiTests : IDisposable
+ {
+ private FormApi instance;
+
+ public FormApiTests()
+ {
+ instance = new FormApi();
+ }
+
+ public void Dispose()
+ {
+ // Cleanup when everything is done.
+ }
+
+ ///
+ /// Test an instance of FormApi
+ ///
+ [Fact]
+ public void InstanceTest()
+ {
+ // TODO uncomment below to test 'IsType' FormApi
+ //Assert.IsType(instance);
+ }
+
+ ///
+ /// Test TestFormIntegerBooleanString
+ ///
+ [Fact]
+ public void TestFormIntegerBooleanStringTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //int? integerForm = null;
+ //bool? booleanForm = null;
+ //string? stringForm = null;
+ //var response = instance.TestFormIntegerBooleanString(integerForm, booleanForm, stringForm);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestFormObjectMultipart
+ ///
+ [Fact]
+ public void TestFormObjectMultipartTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //TestFormObjectMultipartRequestMarker marker = null;
+ //var response = instance.TestFormObjectMultipart(marker);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestFormOneof
+ ///
+ [Fact]
+ public void TestFormOneofTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //string? form1 = null;
+ //int? form2 = null;
+ //string? form3 = null;
+ //bool? form4 = null;
+ //long? id = null;
+ //string? name = null;
+ //var response = instance.TestFormOneof(form1, form2, form3, form4, id, name);
+ //Assert.IsType(response);
+ }
+ }
+}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/HeaderApiTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/HeaderApiTests.cs
similarity index 81%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/HeaderApiTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/HeaderApiTests.cs
index a2e6d2032ede..4f2fbcffaf9f 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/HeaderApiTests.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/HeaderApiTests.cs
@@ -19,6 +19,8 @@
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
+// uncomment below to import models
+//using Org.OpenAPITools.Model;
namespace Org.OpenAPITools.Test.Api
{
@@ -54,16 +56,18 @@ public void InstanceTest()
}
///
- /// Test TestHeaderIntegerBooleanString
+ /// Test TestHeaderIntegerBooleanStringEnums
///
[Fact]
- public void TestHeaderIntegerBooleanStringTest()
+ public void TestHeaderIntegerBooleanStringEnumsTest()
{
// TODO uncomment below to test the method and replace null with proper value
//int? integerHeader = null;
//bool? booleanHeader = null;
//string? stringHeader = null;
- //var response = instance.TestHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader);
+ //string? enumNonrefStringHeader = null;
+ //StringEnumRef? enumRefStringHeader = null;
+ //var response = instance.TestHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader);
//Assert.IsType(response);
}
}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/PathApiTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/PathApiTests.cs
similarity index 76%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/PathApiTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/PathApiTests.cs
index f2879c217dfb..bb27fd798dec 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/PathApiTests.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/PathApiTests.cs
@@ -19,6 +19,8 @@
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
+// uncomment below to import models
+//using Org.OpenAPITools.Model;
namespace Org.OpenAPITools.Test.Api
{
@@ -54,15 +56,17 @@ public void InstanceTest()
}
///
- /// Test TestsPathStringPathStringIntegerPathInteger
+ /// Test TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath
///
[Fact]
- public void TestsPathStringPathStringIntegerPathIntegerTest()
+ public void TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathTest()
{
// TODO uncomment below to test the method and replace null with proper value
//string pathString = null;
//int pathInteger = null;
- //var response = instance.TestsPathStringPathStringIntegerPathInteger(pathString, pathInteger);
+ //string enumNonrefStringPath = null;
+ //StringEnumRef enumRefStringPath = null;
+ //var response = instance.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
//Assert.IsType(response);
}
}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/QueryApiTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/QueryApiTests.cs
similarity index 81%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/QueryApiTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/QueryApiTests.cs
index d551bb07dbc1..7c5e580130de 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Api/QueryApiTests.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Api/QueryApiTests.cs
@@ -62,8 +62,9 @@ public void InstanceTest()
public void TestEnumRefStringTest()
{
// TODO uncomment below to test the method and replace null with proper value
+ //string? enumNonrefStringQuery = null;
//StringEnumRef? enumRefStringQuery = null;
- //var response = instance.TestEnumRefString(enumRefStringQuery);
+ //var response = instance.TestEnumRefString(enumNonrefStringQuery, enumRefStringQuery);
//Assert.IsType(response);
}
@@ -75,7 +76,7 @@ public void TestQueryDatetimeDateStringTest()
{
// TODO uncomment below to test the method and replace null with proper value
//DateTime? datetimeQuery = null;
- //DateTime? dateQuery = null;
+ //DateOnly? dateQuery = null;
//string? stringQuery = null;
//var response = instance.TestQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery);
//Assert.IsType(response);
@@ -119,6 +120,30 @@ public void TestQueryStyleDeepObjectExplodeTrueObjectAllOfTest()
//Assert.IsType(response);
}
+ ///
+ /// Test TestQueryStyleFormExplodeFalseArrayInteger
+ ///
+ [Fact]
+ public void TestQueryStyleFormExplodeFalseArrayIntegerTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //List? queryObject = null;
+ //var response = instance.TestQueryStyleFormExplodeFalseArrayInteger(queryObject);
+ //Assert.IsType(response);
+ }
+
+ ///
+ /// Test TestQueryStyleFormExplodeFalseArrayString
+ ///
+ [Fact]
+ public void TestQueryStyleFormExplodeFalseArrayStringTest()
+ {
+ // TODO uncomment below to test the method and replace null with proper value
+ //List? queryObject = null;
+ //var response = instance.TestQueryStyleFormExplodeFalseArrayString(queryObject);
+ //Assert.IsType(response);
+ }
+
///
/// Test TestQueryStyleFormExplodeTrueArrayString
///
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/BirdTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/BirdTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/BirdTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/BirdTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/CategoryTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/CategoryTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/CategoryTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/DataQueryTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/DataQueryTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/DataQueryTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/DataQueryTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/DefaultValueTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/DefaultValueTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/DefaultValueTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/DefaultValueTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/NumberPropertiesOnlyTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/NumberPropertiesOnlyTests.cs
similarity index 87%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/NumberPropertiesOnlyTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/NumberPropertiesOnlyTests.cs
index e889f6a7a2c1..300daf5c40fa 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/NumberPropertiesOnlyTests.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/NumberPropertiesOnlyTests.cs
@@ -65,21 +65,21 @@ public void NumberTest()
}
///
- /// Test the property 'VarFloat'
+ /// Test the property 'Float'
///
[Fact]
- public void VarFloatTest()
+ public void FloatTest()
{
- // TODO unit test for the property 'VarFloat'
+ // TODO unit test for the property 'Float'
}
///
- /// Test the property 'VarDouble'
+ /// Test the property 'Double'
///
[Fact]
- public void VarDoubleTest()
+ public void DoubleTest()
{
- // TODO unit test for the property 'VarDouble'
+ // TODO unit test for the property 'Double'
}
}
}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/PetTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/PetTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/PetTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/QueryTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/QueryTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/QueryTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/QueryTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/StringEnumRefTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/StringEnumRefTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/StringEnumRefTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/StringEnumRefTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TagTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TagTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TagTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TestFormObjectMultipartRequestMarkerTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TestFormObjectMultipartRequestMarkerTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TestFormObjectMultipartRequestMarkerTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TestFormObjectMultipartRequestMarkerTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTests.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTests.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTests.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools.Test/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTests.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTests.cs
diff --git a/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
new file mode 100644
index 000000000000..64ebed26518e
--- /dev/null
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
@@ -0,0 +1,20 @@
+
+
+
+ Org.OpenAPITools.Test
+ Org.OpenAPITools.Test
+ net8.0
+ false
+ annotations
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/AuthApi.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/AuthApi.cs
similarity index 99%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/AuthApi.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/AuthApi.cs
index 2b34a89ac857..649e8375cfe4 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/AuthApi.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/AuthApi.cs
@@ -274,6 +274,7 @@ public Org.OpenAPITools.Client.ApiResponse TestAuthHttpBasicWithHttpInfo
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -412,6 +413,7 @@ public Org.OpenAPITools.Client.ApiResponse TestAuthHttpBearerWithHttpInf
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/BodyApi.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/BodyApi.cs
similarity index 99%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/BodyApi.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/BodyApi.cs
index 159ebbd2542f..4b91b3612e5f 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/BodyApi.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/BodyApi.cs
@@ -663,6 +663,7 @@ public System.IO.Stream TestBinaryGif(int operationIndex = 0)
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -792,6 +793,7 @@ public System.IO.Stream TestBinaryGif(int operationIndex = 0)
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -932,6 +934,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1078,6 +1081,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1218,6 +1222,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1352,6 +1357,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1486,6 +1492,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1620,6 +1627,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1754,6 +1762,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1888,6 +1897,7 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyMultipartFormdataArra
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/FormApi.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/FormApi.cs
similarity index 99%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/FormApi.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/FormApi.cs
index 03ef6de434e1..45025c63f81d 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/FormApi.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/FormApi.cs
@@ -366,6 +366,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -532,6 +533,7 @@ public Org.OpenAPITools.Client.ApiResponse TestFormObjectMultipartWithHt
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -543,7 +545,7 @@ public Org.OpenAPITools.Client.ApiResponse TestFormObjectMultipartWithHt
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
- localVarRequestOptions.FormParameters.Add("marker", Org.OpenAPITools.Client.ClientUtils.Serialize(marker)); // form parameter
+ localVarRequestOptions.FormParameters.Add("marker", localVarMultipartFormData ? Org.OpenAPITools.Client.ClientUtils.ParameterToString(marker) : Org.OpenAPITools.Client.ClientUtils.Serialize(marker)); // form parameter
localVarRequestOptions.Operation = "FormApi.TestFormObjectMultipart";
localVarRequestOptions.OperationIndex = operationIndex;
@@ -682,6 +684,7 @@ public Org.OpenAPITools.Client.ApiResponse TestFormObjectMultipartWithHt
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/HeaderApi.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/HeaderApi.cs
similarity index 99%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/HeaderApi.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/HeaderApi.cs
index 41b07bcf1fca..ad1e9009e3c6 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/HeaderApi.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/HeaderApi.cs
@@ -261,6 +261,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/PathApi.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/PathApi.cs
similarity index 99%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/PathApi.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/PathApi.cs
index a1ae25b575a6..a4a1ff7fc105 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/PathApi.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/PathApi.cs
@@ -267,6 +267,7 @@ public Org.OpenAPITools.Client.ApiResponse TestsPathStringPathStringInte
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/QueryApi.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/QueryApi.cs
similarity index 99%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/QueryApi.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/QueryApi.cs
index 5b5dd8318d56..7c25c5d572f5 100644
--- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Api/QueryApi.cs
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Api/QueryApi.cs
@@ -691,6 +691,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -843,6 +844,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1005,6 +1007,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1163,6 +1166,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1347,6 +1351,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1483,6 +1488,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1621,6 +1627,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1759,6 +1766,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -1897,6 +1905,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -2035,6 +2044,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
diff --git a/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ApiClient.cs
new file mode 100644
index 000000000000..8fab398a3f83
--- /dev/null
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ApiClient.cs
@@ -0,0 +1,823 @@
+/*
+ * Echo Server API
+ *
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Reflection;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters;
+using System.Text;
+using System.Threading;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
+using RestSharp;
+using RestSharp.Serializers;
+using RestSharpMethod = RestSharp.Method;
+using FileIO = System.IO.File;
+using Polly;
+using Org.OpenAPITools.Model;
+
+namespace Org.OpenAPITools.Client
+{
+ ///
+ /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
+ ///
+ internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer
+ {
+ private readonly IReadableConfiguration _configuration;
+ private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
+ {
+ // OpenAPI generated types generally hide default constructors.
+ ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
+ ContractResolver = new DefaultContractResolver
+ {
+ NamingStrategy = new CamelCaseNamingStrategy
+ {
+ OverrideSpecifiedNames = false
+ }
+ }
+ };
+
+ public CustomJsonCodec(IReadableConfiguration configuration)
+ {
+ _configuration = configuration;
+ }
+
+ public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
+ {
+ _serializerSettings = serializerSettings;
+ _configuration = configuration;
+ }
+
+ ///
+ /// Serialize the object into a JSON string.
+ ///
+ /// Object to be serialized.
+ /// A JSON string.
+ public string Serialize(object obj)
+ {
+ if (obj != null && obj is AbstractOpenAPISchema)
+ {
+ // the object to be serialized is an oneOf/anyOf schema
+ return ((AbstractOpenAPISchema)obj).ToJson();
+ }
+ else
+ {
+ return JsonConvert.SerializeObject(obj, _serializerSettings);
+ }
+ }
+
+ public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value);
+
+ public T Deserialize(RestResponse response)
+ {
+ var result = (T)Deserialize(response, typeof(T));
+ return result;
+ }
+
+ ///
+ /// Deserialize the JSON string into a proper object.
+ ///
+ /// The HTTP response.
+ /// Object type.
+ /// Object representation of the JSON string.
+ internal object Deserialize(RestResponse response, Type type)
+ {
+ if (type == typeof(byte[])) // return byte array
+ {
+ return response.RawBytes;
+ }
+
+ // TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
+ if (type == typeof(Stream))
+ {
+ var bytes = response.RawBytes;
+ if (response.Headers != null)
+ {
+ var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath)
+ ? global::System.IO.Path.GetTempPath()
+ : _configuration.TempFolderPath;
+ var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
+ foreach (var header in response.Headers)
+ {
+ var match = regex.Match(header.ToString());
+ if (match.Success)
+ {
+ string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
+ FileIO.WriteAllBytes(fileName, bytes);
+ return new FileStream(fileName, FileMode.Open);
+ }
+ }
+ }
+ var stream = new MemoryStream(bytes);
+ return stream;
+ }
+
+ if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
+ {
+ return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind);
+ }
+
+ if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type
+ {
+ return Convert.ChangeType(response.Content, type);
+ }
+
+ // at this point, it must be a model (json)
+ try
+ {
+ return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
+ }
+ catch (Exception e)
+ {
+ throw new ApiException(500, e.Message);
+ }
+ }
+
+ public ISerializer Serializer => this;
+ public IDeserializer Deserializer => this;
+
+ public string[] AcceptedContentTypes => ContentType.JsonAccept;
+
+ public SupportsContentType SupportsContentType => contentType =>
+ contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) ||
+ contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase);
+
+ public ContentType ContentType { get; set; } = ContentType.Json;
+
+ public DataFormat DataFormat => DataFormat.Json;
+ }
+ ///
+ /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
+ /// encapsulating general REST accessor use cases.
+ ///
+ public partial class ApiClient : ISynchronousClient, IAsynchronousClient
+ {
+ private readonly string _baseUrl;
+
+ ///
+ /// Specifies the settings on a object.
+ /// These settings can be adjusted to accommodate custom serialization rules.
+ ///
+ public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
+ {
+ // OpenAPI generated types generally hide default constructors.
+ ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
+ ContractResolver = new DefaultContractResolver
+ {
+ NamingStrategy = new CamelCaseNamingStrategy
+ {
+ OverrideSpecifiedNames = false
+ }
+ }
+ };
+
+ ///
+ /// Allows for extending request processing for generated code.
+ ///
+ /// The RestSharp request object
+ partial void InterceptRequest(RestRequest request);
+
+ ///
+ /// Allows for extending response processing for generated code.
+ ///
+ /// The RestSharp request object
+ /// The RestSharp response object
+ partial void InterceptResponse(RestRequest request, RestResponse response);
+
+ ///
+ /// Initializes a new instance of the , defaulting to the global configurations' base url.
+ ///
+ public ApiClient()
+ {
+ _baseUrl = GlobalConfiguration.Instance.BasePath;
+ }
+
+ ///
+ /// Initializes a new instance of the
+ ///
+ /// The target service's base path in URL format.
+ ///
+ public ApiClient(string basePath)
+ {
+ if (string.IsNullOrEmpty(basePath))
+ throw new ArgumentException("basePath cannot be empty");
+
+ _baseUrl = basePath;
+ }
+
+ ///
+ /// Constructs the RestSharp version of an http method
+ ///
+ /// Swagger Client Custom HttpMethod
+ /// RestSharp's HttpMethod instance.
+ ///
+ private RestSharpMethod Method(HttpMethod method)
+ {
+ RestSharpMethod other;
+ switch (method)
+ {
+ case HttpMethod.Get:
+ other = RestSharpMethod.Get;
+ break;
+ case HttpMethod.Post:
+ other = RestSharpMethod.Post;
+ break;
+ case HttpMethod.Put:
+ other = RestSharpMethod.Put;
+ break;
+ case HttpMethod.Delete:
+ other = RestSharpMethod.Delete;
+ break;
+ case HttpMethod.Head:
+ other = RestSharpMethod.Head;
+ break;
+ case HttpMethod.Options:
+ other = RestSharpMethod.Options;
+ break;
+ case HttpMethod.Patch:
+ other = RestSharpMethod.Patch;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException("method", method, null);
+ }
+
+ return other;
+ }
+
+ ///
+ /// Provides all logic for constructing a new RestSharp .
+ /// At this point, all information for querying the service is known.
+ /// Here, it is simply mapped into the RestSharp request.
+ ///
+ /// The http verb.
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object.
+ /// It is assumed that any merge with GlobalConfiguration has been done before calling this method.
+ /// [private] A new RestRequest instance.
+ ///
+ private RestRequest NewRequest(
+ HttpMethod method,
+ string path,
+ RequestOptions options,
+ IReadableConfiguration configuration)
+ {
+ if (path == null) throw new ArgumentNullException("path");
+ if (options == null) throw new ArgumentNullException("options");
+ if (configuration == null) throw new ArgumentNullException("configuration");
+
+ RestRequest request = new RestRequest(path, Method(method));
+
+ if (options.PathParameters != null)
+ {
+ foreach (var pathParam in options.PathParameters)
+ {
+ request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment);
+ }
+ }
+
+ if (options.QueryParameters != null)
+ {
+ foreach (var queryParam in options.QueryParameters)
+ {
+ foreach (var value in queryParam.Value)
+ {
+ request.AddQueryParameter(queryParam.Key, value);
+ }
+ }
+ }
+
+ if (configuration.DefaultHeaders != null)
+ {
+ foreach (var headerParam in configuration.DefaultHeaders)
+ {
+ request.AddHeader(headerParam.Key, headerParam.Value);
+ }
+ }
+
+ if (options.HeaderParameters != null)
+ {
+ foreach (var headerParam in options.HeaderParameters)
+ {
+ foreach (var value in headerParam.Value)
+ {
+ request.AddHeader(headerParam.Key, value);
+ }
+ }
+ }
+
+ if (options.FormParameters != null)
+ {
+ foreach (var formParam in options.FormParameters)
+ {
+ request.AddParameter(formParam.Key, formParam.Value);
+ }
+ }
+
+ if (options.Data != null)
+ {
+ if (options.Data is Stream stream)
+ {
+ var contentType = "application/octet-stream";
+ if (options.HeaderParameters != null)
+ {
+ var contentTypes = options.HeaderParameters["Content-Type"];
+ contentType = contentTypes[0];
+ }
+
+ var bytes = ClientUtils.ReadAsBytes(stream);
+ request.AddParameter(contentType, bytes, ParameterType.RequestBody);
+ }
+ else
+ {
+ if (options.HeaderParameters != null)
+ {
+ var contentTypes = options.HeaderParameters["Content-Type"];
+ if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json")))
+ {
+ request.RequestFormat = DataFormat.Json;
+ }
+ else
+ {
+ // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default.
+ }
+ }
+ else
+ {
+ // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly.
+ request.RequestFormat = DataFormat.Json;
+ }
+
+ request.AddJsonBody(options.Data);
+ }
+ }
+
+ if (options.FileParameters != null)
+ {
+ foreach (var fileParam in options.FileParameters)
+ {
+ foreach (var file in fileParam.Value)
+ {
+ var bytes = ClientUtils.ReadAsBytes(file);
+ var fileStream = file as FileStream;
+ if (fileStream != null)
+ request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name));
+ else
+ request.AddFile(fileParam.Key, bytes, "no_file_name_provided");
+ }
+ }
+ }
+
+ if (options.HeaderParameters != null)
+ {
+ if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data")))
+ {
+ request.AlwaysMultipartFormData = true;
+ }
+ }
+
+ return request;
+ }
+
+ ///
+ /// Transforms a RestResponse instance into a new ApiResponse instance.
+ /// At this point, we have a concrete http response from the service.
+ /// Here, it is simply mapped into the [public] ApiResponse object.
+ ///
+ /// The RestSharp response object
+ /// A new ApiResponse instance.
+ private ApiResponse ToApiResponse(RestResponse response)
+ {
+ T result = response.Data;
+ string rawContent = response.Content;
+
+ var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent)
+ {
+ ErrorText = response.ErrorMessage,
+ Cookies = new List()
+ };
+
+ if (response.Headers != null)
+ {
+ foreach (var responseHeader in response.Headers)
+ {
+ transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
+ }
+ }
+
+ if (response.ContentHeaders != null)
+ {
+ foreach (var responseHeader in response.ContentHeaders)
+ {
+ transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
+ }
+ }
+
+ if (response.Cookies != null)
+ {
+ foreach (var responseCookies in response.Cookies.Cast())
+ {
+ transformed.Cookies.Add(
+ new Cookie(
+ responseCookies.Name,
+ responseCookies.Value,
+ responseCookies.Path,
+ responseCookies.Domain)
+ );
+ }
+ }
+
+ return transformed;
+ }
+
+ ///
+ /// Executes the HTTP request for the current service.
+ /// Based on functions received it can be async or sync.
+ ///
+ /// Local function that executes http request and returns http response.
+ /// Local function to specify options for the service.
+ /// The RestSharp request object
+ /// The RestSharp options object
+ /// A per-request configuration object.
+ /// It is assumed that any merge with GlobalConfiguration has been done before calling this method.
+ /// A new ApiResponse instance.
+ private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration)
+ {
+ var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl;
+ var clientOptions = new RestClientOptions(baseUrl)
+ {
+ ClientCertificates = configuration.ClientCertificates,
+ Timeout = configuration.Timeout,
+ Proxy = configuration.Proxy,
+ UserAgent = configuration.UserAgent,
+ UseDefaultCredentials = configuration.UseDefaultCredentials,
+ RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback
+ };
+ setOptions(clientOptions);
+
+ using (RestClient client = new RestClient(clientOptions,
+ configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration))))
+ {
+ InterceptRequest(request);
+
+ RestResponse response = await getResponse(client);
+
+ // if the response type is oneOf/anyOf, call FromJSON to deserialize the data
+ if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
+ {
+ try
+ {
+ response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content });
+ }
+ catch (Exception ex)
+ {
+ throw ex.InnerException != null ? ex.InnerException : ex;
+ }
+ }
+ else if (typeof(T).Name == "Stream") // for binary response
+ {
+ response.Data = (T)(object)new MemoryStream(response.RawBytes);
+ }
+ else if (typeof(T).Name == "Byte[]") // for byte response
+ {
+ response.Data = (T)(object)response.RawBytes;
+ }
+ else if (typeof(T).Name == "String") // for string response
+ {
+ response.Data = (T)(object)response.Content;
+ }
+
+ InterceptResponse(request, response);
+
+ var result = ToApiResponse(response);
+ if (response.ErrorMessage != null)
+ {
+ result.ErrorText = response.ErrorMessage;
+ }
+
+ if (response.Cookies != null && response.Cookies.Count > 0)
+ {
+ if (result.Cookies == null) result.Cookies = new List();
+ foreach (var restResponseCookie in response.Cookies.Cast())
+ {
+ var cookie = new Cookie(
+ restResponseCookie.Name,
+ restResponseCookie.Value,
+ restResponseCookie.Path,
+ restResponseCookie.Domain
+ )
+ {
+ Comment = restResponseCookie.Comment,
+ CommentUri = restResponseCookie.CommentUri,
+ Discard = restResponseCookie.Discard,
+ Expired = restResponseCookie.Expired,
+ Expires = restResponseCookie.Expires,
+ HttpOnly = restResponseCookie.HttpOnly,
+ Port = restResponseCookie.Port,
+ Secure = restResponseCookie.Secure,
+ Version = restResponseCookie.Version
+ };
+
+ result.Cookies.Add(cookie);
+ }
+ }
+ return result;
+ }
+ }
+
+ private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default)
+ {
+ if (policyResult.Outcome == OutcomeType.Successful)
+ {
+ return await client.Deserialize(policyResult.Result, cancellationToken);
+ }
+ else
+ {
+ return new RestResponse(request)
+ {
+ ErrorException = policyResult.FinalException
+ };
+ }
+ }
+
+ private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration)
+ {
+ Action setOptions = (clientOptions) =>
+ {
+ var cookies = new CookieContainer();
+
+ if (options.Cookies != null && options.Cookies.Count > 0)
+ {
+ foreach (var cookie in options.Cookies)
+ {
+ cookies.Add(new Cookie(cookie.Name, cookie.Value));
+ }
+ }
+ clientOptions.CookieContainer = cookies;
+ };
+
+ Func>> getResponse = (client) =>
+ {
+ if (RetryConfiguration.RetryPolicy != null)
+ {
+ var policy = RetryConfiguration.RetryPolicy;
+ var policyResult = policy.ExecuteAndCapture(() => client.Execute(request));
+ return DeserializeRestResponseFromPolicyAsync(client, request, policyResult);
+ }
+ else
+ {
+ return Task.FromResult(client.Execute(request));
+ }
+ };
+
+ return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult();
+ }
+
+ private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ Action setOptions = (clientOptions) =>
+ {
+ //no extra options
+ };
+
+ Func>> getResponse = async (client) =>
+ {
+ if (RetryConfiguration.AsyncRetryPolicy != null)
+ {
+ var policy = RetryConfiguration.AsyncRetryPolicy;
+ var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false);
+ return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken);
+ }
+ else
+ {
+ return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
+ }
+ };
+
+ return ExecClientAsync(getResponse, setOptions, request, options, configuration);
+ }
+
+ #region IAsynchronousClient
+ ///
+ /// Make a HTTP GET request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP POST request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP PUT request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP DELETE request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP HEAD request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP OPTION request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP PATCH request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken);
+ }
+ #endregion IAsynchronousClient
+
+ #region ISynchronousClient
+ ///
+ /// Make a HTTP GET request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// A Task containing ApiResponse
+ public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config);
+ }
+
+ ///
+ /// Make a HTTP POST request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// A Task containing ApiResponse
+ public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config);
+ }
+
+ ///
+ /// Make a HTTP PUT request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// A Task containing ApiResponse
+ public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config);
+ }
+
+ ///
+ /// Make a HTTP DELETE request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// A Task containing ApiResponse
+ public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config);
+ }
+
+ ///
+ /// Make a HTTP HEAD request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// A Task containing ApiResponse
+ public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config);
+ }
+
+ ///
+ /// Make a HTTP OPTION request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// A Task containing ApiResponse
+ public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config);
+ }
+
+ ///
+ /// Make a HTTP PATCH request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ /// A Task containing ApiResponse
+ public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config);
+ }
+ #endregion ISynchronousClient
+ }
+}
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ApiException.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiException.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ApiException.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ApiResponse.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiResponse.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ApiResponse.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ClientUtils.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ClientUtils.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ClientUtils.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/Configuration.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/Configuration.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/Configuration.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ExceptionFactory.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ExceptionFactory.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ExceptionFactory.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/GlobalConfiguration.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/GlobalConfiguration.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/GlobalConfiguration.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/HttpMethod.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/HttpMethod.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/HttpMethod.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/HttpMethod.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/IApiAccessor.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IApiAccessor.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/IApiAccessor.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/IAsynchronousClient.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IAsynchronousClient.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/IAsynchronousClient.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/IReadableConfiguration.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/IReadableConfiguration.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ISynchronousClient.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ISynchronousClient.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ISynchronousClient.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/ISynchronousClient.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/Multimap.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/Multimap.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/Multimap.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/RequestOptions.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/RequestOptions.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/RequestOptions.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/RetryConfiguration.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/RetryConfiguration.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Client/RetryConfiguration.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Bird.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Bird.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Bird.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Bird.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Category.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Category.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Category.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Category.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DataQuery.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/DataQuery.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DataQuery.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/DataQuery.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DefaultValue.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/DefaultValue.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DefaultValue.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/DefaultValue.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Pet.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Pet.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Pet.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Query.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Query.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Query.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Query.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/StringEnumRef.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/StringEnumRef.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/StringEnumRef.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/StringEnumRef.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Tag.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Tag.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/Tag.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs
diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs
similarity index 100%
rename from samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs
rename to samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs
diff --git a/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Org.OpenAPITools.csproj
new file mode 100644
index 000000000000..ccb09c252b62
--- /dev/null
+++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/src/Org.OpenAPITools/Org.OpenAPITools.csproj
@@ -0,0 +1,35 @@
+
+
+
+ false
+ net8.0
+ Org.OpenAPITools
+ Org.OpenAPITools
+ Library
+ OpenAPI
+ OpenAPI
+ OpenAPI Library
+ A library generated from a OpenAPI doc
+ No Copyright
+ Org.OpenAPITools
+ 1.0.0
+ bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml
+ https://github.com/GIT_USER_ID/GIT_REPO_ID.git
+ git
+ Minor update
+ annotations
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/client/echo_api/php-nextgen-streaming/src/Api/BodyApi.php b/samples/client/echo_api/php-nextgen-streaming/src/Api/BodyApi.php
index abbbbcf1bc00..32de9920511c 100644
--- a/samples/client/echo_api/php-nextgen-streaming/src/Api/BodyApi.php
+++ b/samples/client/echo_api/php-nextgen-streaming/src/Api/BodyApi.php
@@ -633,7 +633,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testBodyApplicationOctetstreamBinaryAsyncWithHttpInfo(
- $body = null,
+ ?\Psr\Http\Message\StreamInterface $body = null,
string $contentType = self::contentTypes['testBodyApplicationOctetstreamBinary'][0]
): PromiseInterface
{
@@ -686,7 +686,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyApplicationOctetstreamBinaryRequest(
- $body = null,
+ ?\Psr\Http\Message\StreamInterface $body = null,
string $contentType = self::contentTypes['testBodyApplicationOctetstreamBinary'][0]
): Request
{
@@ -949,7 +949,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testBodyMultipartFormdataArrayOfBinaryAsyncWithHttpInfo(
- $files,
+ array $files,
string $contentType = self::contentTypes['testBodyMultipartFormdataArrayOfBinary'][0]
): PromiseInterface
{
@@ -1002,7 +1002,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyMultipartFormdataArrayOfBinaryRequest(
- $files,
+ array $files,
string $contentType = self::contentTypes['testBodyMultipartFormdataArrayOfBinary'][0]
): Request
{
@@ -1278,7 +1278,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testBodyMultipartFormdataSingleBinaryAsyncWithHttpInfo(
- $my_file = null,
+ ?\Psr\Http\Message\StreamInterface $my_file = null,
string $contentType = self::contentTypes['testBodyMultipartFormdataSingleBinary'][0]
): PromiseInterface
{
@@ -1331,7 +1331,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyMultipartFormdataSingleBinaryRequest(
- $my_file = null,
+ ?\Psr\Http\Message\StreamInterface $my_file = null,
string $contentType = self::contentTypes['testBodyMultipartFormdataSingleBinary'][0]
): Request
{
@@ -1601,7 +1601,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyAllOfPetAsyncWithHttpInfo(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyAllOfPet'][0]
): PromiseInterface
{
@@ -1654,7 +1654,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyAllOfPetRequest(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyAllOfPet'][0]
): Request
{
@@ -1745,7 +1745,7 @@ public function testEchoBodyAllOfPetRequest(
* @return string
*/
public function testEchoBodyFreeFormObjectResponseString(
- ?array $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): string
{
@@ -1766,7 +1766,7 @@ public function testEchoBodyFreeFormObjectResponseString(
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testEchoBodyFreeFormObjectResponseStringWithHttpInfo(
- ?array $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): array
{
@@ -1893,7 +1893,7 @@ public function testEchoBodyFreeFormObjectResponseStringWithHttpInfo(
* @return PromiseInterface
*/
public function testEchoBodyFreeFormObjectResponseStringAsync(
- ?array $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): PromiseInterface
{
@@ -1917,7 +1917,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyFreeFormObjectResponseStringAsyncWithHttpInfo(
- $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): PromiseInterface
{
@@ -1970,7 +1970,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyFreeFormObjectResponseStringRequest(
- $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): Request
{
@@ -2233,7 +2233,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyPetAsyncWithHttpInfo(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPet'][0]
): PromiseInterface
{
@@ -2286,7 +2286,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyPetRequest(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPet'][0]
): Request
{
@@ -2549,7 +2549,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyPetResponseStringAsyncWithHttpInfo(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPetResponseString'][0]
): PromiseInterface
{
@@ -2602,7 +2602,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyPetResponseStringRequest(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPetResponseString'][0]
): Request
{
@@ -2865,7 +2865,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyStringEnumAsyncWithHttpInfo(
- $body = null,
+ ?string $body = null,
string $contentType = self::contentTypes['testEchoBodyStringEnum'][0]
): PromiseInterface
{
@@ -2918,7 +2918,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyStringEnumRequest(
- $body = null,
+ ?string $body = null,
string $contentType = self::contentTypes['testEchoBodyStringEnum'][0]
): Request
{
@@ -3181,7 +3181,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyTagResponseStringAsyncWithHttpInfo(
- $tag = null,
+ ?\OpenAPI\Client\Model\Tag $tag = null,
string $contentType = self::contentTypes['testEchoBodyTagResponseString'][0]
): PromiseInterface
{
@@ -3234,7 +3234,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyTagResponseStringRequest(
- $tag = null,
+ ?\OpenAPI\Client\Model\Tag $tag = null,
string $contentType = self::contentTypes['testEchoBodyTagResponseString'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen-streaming/src/Api/FormApi.php b/samples/client/echo_api/php-nextgen-streaming/src/Api/FormApi.php
index 241754b30b08..ddaa5c47ab6c 100644
--- a/samples/client/echo_api/php-nextgen-streaming/src/Api/FormApi.php
+++ b/samples/client/echo_api/php-nextgen-streaming/src/Api/FormApi.php
@@ -328,9 +328,9 @@ function ($response) {
* @return PromiseInterface
*/
public function testFormIntegerBooleanStringAsyncWithHttpInfo(
- $integer_form = null,
- $boolean_form = null,
- $string_form = null,
+ ?int $integer_form = null,
+ ?bool $boolean_form = null,
+ ?string $string_form = null,
string $contentType = self::contentTypes['testFormIntegerBooleanString'][0]
): PromiseInterface
{
@@ -385,9 +385,9 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormIntegerBooleanStringRequest(
- $integer_form = null,
- $boolean_form = null,
- $string_form = null,
+ ?int $integer_form = null,
+ ?bool $boolean_form = null,
+ ?string $string_form = null,
string $contentType = self::contentTypes['testFormIntegerBooleanString'][0]
): Request
{
@@ -657,7 +657,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testFormObjectMultipartAsyncWithHttpInfo(
- $marker,
+ \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): PromiseInterface
{
@@ -710,7 +710,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormObjectMultipartRequest(
- $marker,
+ \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): Request
{
@@ -1011,12 +1011,12 @@ function ($response) {
* @return PromiseInterface
*/
public function testFormOneofAsyncWithHttpInfo(
- $form1 = null,
- $form2 = null,
- $form3 = null,
- $form4 = null,
- $id = null,
- $name = null,
+ ?string $form1 = null,
+ ?int $form2 = null,
+ ?string $form3 = null,
+ ?bool $form4 = null,
+ ?int $id = null,
+ ?string $name = null,
string $contentType = self::contentTypes['testFormOneof'][0]
): PromiseInterface
{
@@ -1074,12 +1074,12 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormOneofRequest(
- $form1 = null,
- $form2 = null,
- $form3 = null,
- $form4 = null,
- $id = null,
- $name = null,
+ ?string $form1 = null,
+ ?int $form2 = null,
+ ?string $form3 = null,
+ ?bool $form4 = null,
+ ?int $id = null,
+ ?string $name = null,
string $contentType = self::contentTypes['testFormOneof'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen-streaming/src/Api/HeaderApi.php b/samples/client/echo_api/php-nextgen-streaming/src/Api/HeaderApi.php
index 871fd002020b..3337854a883e 100644
--- a/samples/client/echo_api/php-nextgen-streaming/src/Api/HeaderApi.php
+++ b/samples/client/echo_api/php-nextgen-streaming/src/Api/HeaderApi.php
@@ -336,11 +336,11 @@ function ($response) {
* @return PromiseInterface
*/
public function testHeaderIntegerBooleanStringEnumsAsyncWithHttpInfo(
- $integer_header = null,
- $boolean_header = null,
- $string_header = null,
- $enum_nonref_string_header = null,
- $enum_ref_string_header = null,
+ ?int $integer_header = null,
+ ?bool $boolean_header = null,
+ ?string $string_header = null,
+ ?string $enum_nonref_string_header = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_header = null,
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
): PromiseInterface
{
@@ -397,11 +397,11 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testHeaderIntegerBooleanStringEnumsRequest(
- $integer_header = null,
- $boolean_header = null,
- $string_header = null,
- $enum_nonref_string_header = null,
- $enum_ref_string_header = null,
+ ?int $integer_header = null,
+ ?bool $boolean_header = null,
+ ?string $string_header = null,
+ ?string $enum_nonref_string_header = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_header = null,
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen-streaming/src/Api/PathApi.php b/samples/client/echo_api/php-nextgen-streaming/src/Api/PathApi.php
index e806d61c9453..c6a13a2a6f14 100644
--- a/samples/client/echo_api/php-nextgen-streaming/src/Api/PathApi.php
+++ b/samples/client/echo_api/php-nextgen-streaming/src/Api/PathApi.php
@@ -329,10 +329,10 @@ function ($response) {
* @return PromiseInterface
*/
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsyncWithHttpInfo(
- $path_string,
- $path_integer,
- $enum_nonref_string_path,
- $enum_ref_string_path,
+ string $path_string,
+ int $path_integer,
+ string $enum_nonref_string_path,
+ \OpenAPI\Client\Model\StringEnumRef $enum_ref_string_path,
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
): PromiseInterface
{
@@ -388,10 +388,10 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest(
- $path_string,
- $path_integer,
- $enum_nonref_string_path,
- $enum_ref_string_path,
+ string $path_string,
+ int $path_integer,
+ string $enum_nonref_string_path,
+ \OpenAPI\Client\Model\StringEnumRef $enum_ref_string_path,
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php b/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php
index 8e64ba5648ce..f0e76da188be 100644
--- a/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php
+++ b/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php
@@ -342,8 +342,8 @@ function ($response) {
* @return PromiseInterface
*/
public function testEnumRefStringAsyncWithHttpInfo(
- $enum_nonref_string_query = null,
- $enum_ref_string_query = null,
+ ?string $enum_nonref_string_query = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_query = null,
string $contentType = self::contentTypes['testEnumRefString'][0]
): PromiseInterface
{
@@ -397,8 +397,8 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEnumRefStringRequest(
- $enum_nonref_string_query = null,
- $enum_ref_string_query = null,
+ ?string $enum_nonref_string_query = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_query = null,
string $contentType = self::contentTypes['testEnumRefString'][0]
): Request
{
@@ -687,9 +687,9 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryDatetimeDateStringAsyncWithHttpInfo(
- $datetime_query = null,
- $date_query = null,
- $string_query = null,
+ ?\DateTime $datetime_query = null,
+ ?\DateTime $date_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryDatetimeDateString'][0]
): PromiseInterface
{
@@ -744,9 +744,9 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryDatetimeDateStringRequest(
- $datetime_query = null,
- $date_query = null,
- $string_query = null,
+ ?\DateTime $datetime_query = null,
+ ?\DateTime $date_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryDatetimeDateString'][0]
): Request
{
@@ -1045,9 +1045,9 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryIntegerBooleanStringAsyncWithHttpInfo(
- $integer_query = null,
- $boolean_query = null,
- $string_query = null,
+ ?int $integer_query = null,
+ ?bool $boolean_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryIntegerBooleanString'][0]
): PromiseInterface
{
@@ -1102,9 +1102,9 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryIntegerBooleanStringRequest(
- $integer_query = null,
- $boolean_query = null,
- $string_query = null,
+ ?int $integer_query = null,
+ ?bool $boolean_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryIntegerBooleanString'][0]
): Request
{
@@ -1389,7 +1389,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObject'][0]
): PromiseInterface
{
@@ -1442,7 +1442,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleDeepObjectExplodeTrueObjectRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObject'][0]
): Request
{
@@ -1707,7 +1707,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAllOfAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObjectAllOf'][0]
): PromiseInterface
{
@@ -1760,7 +1760,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAllOfRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObjectAllOf'][0]
): Request
{
@@ -1853,7 +1853,7 @@ public function testQueryStyleDeepObjectExplodeTrueObjectAllOfRequest(
* @return string
*/
public function testQueryStyleFormExplodeFalseArrayInteger(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): string
{
@@ -1874,7 +1874,7 @@ public function testQueryStyleFormExplodeFalseArrayInteger(
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): array
{
@@ -2001,7 +2001,7 @@ public function testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayIntegerAsync(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): PromiseInterface
{
@@ -2025,7 +2025,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayIntegerAsyncWithHttpInfo(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): PromiseInterface
{
@@ -2078,7 +2078,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeFalseArrayIntegerRequest(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): Request
{
@@ -2171,7 +2171,7 @@ public function testQueryStyleFormExplodeFalseArrayIntegerRequest(
* @return string
*/
public function testQueryStyleFormExplodeFalseArrayString(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): string
{
@@ -2192,7 +2192,7 @@ public function testQueryStyleFormExplodeFalseArrayString(
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): array
{
@@ -2319,7 +2319,7 @@ public function testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayStringAsync(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): PromiseInterface
{
@@ -2343,7 +2343,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayStringAsyncWithHttpInfo(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): PromiseInterface
{
@@ -2396,7 +2396,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeFalseArrayStringRequest(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): Request
{
@@ -2661,7 +2661,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueArrayStringAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueArrayString'][0]
): PromiseInterface
{
@@ -2714,7 +2714,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueArrayStringRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueArrayString'][0]
): Request
{
@@ -2979,7 +2979,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueObjectAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObject'][0]
): PromiseInterface
{
@@ -3032,7 +3032,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueObjectRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObject'][0]
): Request
{
@@ -3297,7 +3297,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueObjectAllOfAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\DataQuery $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObjectAllOf'][0]
): PromiseInterface
{
@@ -3350,7 +3350,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueObjectAllOfRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\DataQuery $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObjectAllOf'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen/src/Api/BodyApi.php b/samples/client/echo_api/php-nextgen/src/Api/BodyApi.php
index 1b49ec023e98..fec58cc88f2d 100644
--- a/samples/client/echo_api/php-nextgen/src/Api/BodyApi.php
+++ b/samples/client/echo_api/php-nextgen/src/Api/BodyApi.php
@@ -633,7 +633,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testBodyApplicationOctetstreamBinaryAsyncWithHttpInfo(
- $body = null,
+ ?\SplFileObject $body = null,
string $contentType = self::contentTypes['testBodyApplicationOctetstreamBinary'][0]
): PromiseInterface
{
@@ -686,7 +686,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyApplicationOctetstreamBinaryRequest(
- $body = null,
+ ?\SplFileObject $body = null,
string $contentType = self::contentTypes['testBodyApplicationOctetstreamBinary'][0]
): Request
{
@@ -949,7 +949,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testBodyMultipartFormdataArrayOfBinaryAsyncWithHttpInfo(
- $files,
+ array $files,
string $contentType = self::contentTypes['testBodyMultipartFormdataArrayOfBinary'][0]
): PromiseInterface
{
@@ -1002,7 +1002,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyMultipartFormdataArrayOfBinaryRequest(
- $files,
+ array $files,
string $contentType = self::contentTypes['testBodyMultipartFormdataArrayOfBinary'][0]
): Request
{
@@ -1278,7 +1278,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testBodyMultipartFormdataSingleBinaryAsyncWithHttpInfo(
- $my_file = null,
+ ?\SplFileObject $my_file = null,
string $contentType = self::contentTypes['testBodyMultipartFormdataSingleBinary'][0]
): PromiseInterface
{
@@ -1331,7 +1331,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyMultipartFormdataSingleBinaryRequest(
- $my_file = null,
+ ?\SplFileObject $my_file = null,
string $contentType = self::contentTypes['testBodyMultipartFormdataSingleBinary'][0]
): Request
{
@@ -1601,7 +1601,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyAllOfPetAsyncWithHttpInfo(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyAllOfPet'][0]
): PromiseInterface
{
@@ -1654,7 +1654,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyAllOfPetRequest(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyAllOfPet'][0]
): Request
{
@@ -1745,7 +1745,7 @@ public function testEchoBodyAllOfPetRequest(
* @return string
*/
public function testEchoBodyFreeFormObjectResponseString(
- ?array $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): string
{
@@ -1766,7 +1766,7 @@ public function testEchoBodyFreeFormObjectResponseString(
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testEchoBodyFreeFormObjectResponseStringWithHttpInfo(
- ?array $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): array
{
@@ -1893,7 +1893,7 @@ public function testEchoBodyFreeFormObjectResponseStringWithHttpInfo(
* @return PromiseInterface
*/
public function testEchoBodyFreeFormObjectResponseStringAsync(
- ?array $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): PromiseInterface
{
@@ -1917,7 +1917,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyFreeFormObjectResponseStringAsyncWithHttpInfo(
- $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): PromiseInterface
{
@@ -1970,7 +1970,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyFreeFormObjectResponseStringRequest(
- $body = null,
+ array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): Request
{
@@ -2233,7 +2233,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyPetAsyncWithHttpInfo(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPet'][0]
): PromiseInterface
{
@@ -2286,7 +2286,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyPetRequest(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPet'][0]
): Request
{
@@ -2549,7 +2549,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyPetResponseStringAsyncWithHttpInfo(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPetResponseString'][0]
): PromiseInterface
{
@@ -2602,7 +2602,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyPetResponseStringRequest(
- $pet = null,
+ ?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPetResponseString'][0]
): Request
{
@@ -2865,7 +2865,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyStringEnumAsyncWithHttpInfo(
- $body = null,
+ ?string $body = null,
string $contentType = self::contentTypes['testEchoBodyStringEnum'][0]
): PromiseInterface
{
@@ -2918,7 +2918,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyStringEnumRequest(
- $body = null,
+ ?string $body = null,
string $contentType = self::contentTypes['testEchoBodyStringEnum'][0]
): Request
{
@@ -3181,7 +3181,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testEchoBodyTagResponseStringAsyncWithHttpInfo(
- $tag = null,
+ ?\OpenAPI\Client\Model\Tag $tag = null,
string $contentType = self::contentTypes['testEchoBodyTagResponseString'][0]
): PromiseInterface
{
@@ -3234,7 +3234,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyTagResponseStringRequest(
- $tag = null,
+ ?\OpenAPI\Client\Model\Tag $tag = null,
string $contentType = self::contentTypes['testEchoBodyTagResponseString'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen/src/Api/FormApi.php b/samples/client/echo_api/php-nextgen/src/Api/FormApi.php
index 241754b30b08..ddaa5c47ab6c 100644
--- a/samples/client/echo_api/php-nextgen/src/Api/FormApi.php
+++ b/samples/client/echo_api/php-nextgen/src/Api/FormApi.php
@@ -328,9 +328,9 @@ function ($response) {
* @return PromiseInterface
*/
public function testFormIntegerBooleanStringAsyncWithHttpInfo(
- $integer_form = null,
- $boolean_form = null,
- $string_form = null,
+ ?int $integer_form = null,
+ ?bool $boolean_form = null,
+ ?string $string_form = null,
string $contentType = self::contentTypes['testFormIntegerBooleanString'][0]
): PromiseInterface
{
@@ -385,9 +385,9 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormIntegerBooleanStringRequest(
- $integer_form = null,
- $boolean_form = null,
- $string_form = null,
+ ?int $integer_form = null,
+ ?bool $boolean_form = null,
+ ?string $string_form = null,
string $contentType = self::contentTypes['testFormIntegerBooleanString'][0]
): Request
{
@@ -657,7 +657,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testFormObjectMultipartAsyncWithHttpInfo(
- $marker,
+ \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): PromiseInterface
{
@@ -710,7 +710,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormObjectMultipartRequest(
- $marker,
+ \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): Request
{
@@ -1011,12 +1011,12 @@ function ($response) {
* @return PromiseInterface
*/
public function testFormOneofAsyncWithHttpInfo(
- $form1 = null,
- $form2 = null,
- $form3 = null,
- $form4 = null,
- $id = null,
- $name = null,
+ ?string $form1 = null,
+ ?int $form2 = null,
+ ?string $form3 = null,
+ ?bool $form4 = null,
+ ?int $id = null,
+ ?string $name = null,
string $contentType = self::contentTypes['testFormOneof'][0]
): PromiseInterface
{
@@ -1074,12 +1074,12 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormOneofRequest(
- $form1 = null,
- $form2 = null,
- $form3 = null,
- $form4 = null,
- $id = null,
- $name = null,
+ ?string $form1 = null,
+ ?int $form2 = null,
+ ?string $form3 = null,
+ ?bool $form4 = null,
+ ?int $id = null,
+ ?string $name = null,
string $contentType = self::contentTypes['testFormOneof'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen/src/Api/HeaderApi.php b/samples/client/echo_api/php-nextgen/src/Api/HeaderApi.php
index 871fd002020b..3337854a883e 100644
--- a/samples/client/echo_api/php-nextgen/src/Api/HeaderApi.php
+++ b/samples/client/echo_api/php-nextgen/src/Api/HeaderApi.php
@@ -336,11 +336,11 @@ function ($response) {
* @return PromiseInterface
*/
public function testHeaderIntegerBooleanStringEnumsAsyncWithHttpInfo(
- $integer_header = null,
- $boolean_header = null,
- $string_header = null,
- $enum_nonref_string_header = null,
- $enum_ref_string_header = null,
+ ?int $integer_header = null,
+ ?bool $boolean_header = null,
+ ?string $string_header = null,
+ ?string $enum_nonref_string_header = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_header = null,
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
): PromiseInterface
{
@@ -397,11 +397,11 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testHeaderIntegerBooleanStringEnumsRequest(
- $integer_header = null,
- $boolean_header = null,
- $string_header = null,
- $enum_nonref_string_header = null,
- $enum_ref_string_header = null,
+ ?int $integer_header = null,
+ ?bool $boolean_header = null,
+ ?string $string_header = null,
+ ?string $enum_nonref_string_header = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_header = null,
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen/src/Api/PathApi.php b/samples/client/echo_api/php-nextgen/src/Api/PathApi.php
index e806d61c9453..c6a13a2a6f14 100644
--- a/samples/client/echo_api/php-nextgen/src/Api/PathApi.php
+++ b/samples/client/echo_api/php-nextgen/src/Api/PathApi.php
@@ -329,10 +329,10 @@ function ($response) {
* @return PromiseInterface
*/
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsyncWithHttpInfo(
- $path_string,
- $path_integer,
- $enum_nonref_string_path,
- $enum_ref_string_path,
+ string $path_string,
+ int $path_integer,
+ string $enum_nonref_string_path,
+ \OpenAPI\Client\Model\StringEnumRef $enum_ref_string_path,
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
): PromiseInterface
{
@@ -388,10 +388,10 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest(
- $path_string,
- $path_integer,
- $enum_nonref_string_path,
- $enum_ref_string_path,
+ string $path_string,
+ int $path_integer,
+ string $enum_nonref_string_path,
+ \OpenAPI\Client\Model\StringEnumRef $enum_ref_string_path,
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
): Request
{
diff --git a/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php b/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php
index 8e64ba5648ce..f0e76da188be 100644
--- a/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php
+++ b/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php
@@ -342,8 +342,8 @@ function ($response) {
* @return PromiseInterface
*/
public function testEnumRefStringAsyncWithHttpInfo(
- $enum_nonref_string_query = null,
- $enum_ref_string_query = null,
+ ?string $enum_nonref_string_query = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_query = null,
string $contentType = self::contentTypes['testEnumRefString'][0]
): PromiseInterface
{
@@ -397,8 +397,8 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testEnumRefStringRequest(
- $enum_nonref_string_query = null,
- $enum_ref_string_query = null,
+ ?string $enum_nonref_string_query = null,
+ ?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_query = null,
string $contentType = self::contentTypes['testEnumRefString'][0]
): Request
{
@@ -687,9 +687,9 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryDatetimeDateStringAsyncWithHttpInfo(
- $datetime_query = null,
- $date_query = null,
- $string_query = null,
+ ?\DateTime $datetime_query = null,
+ ?\DateTime $date_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryDatetimeDateString'][0]
): PromiseInterface
{
@@ -744,9 +744,9 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryDatetimeDateStringRequest(
- $datetime_query = null,
- $date_query = null,
- $string_query = null,
+ ?\DateTime $datetime_query = null,
+ ?\DateTime $date_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryDatetimeDateString'][0]
): Request
{
@@ -1045,9 +1045,9 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryIntegerBooleanStringAsyncWithHttpInfo(
- $integer_query = null,
- $boolean_query = null,
- $string_query = null,
+ ?int $integer_query = null,
+ ?bool $boolean_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryIntegerBooleanString'][0]
): PromiseInterface
{
@@ -1102,9 +1102,9 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryIntegerBooleanStringRequest(
- $integer_query = null,
- $boolean_query = null,
- $string_query = null,
+ ?int $integer_query = null,
+ ?bool $boolean_query = null,
+ ?string $string_query = null,
string $contentType = self::contentTypes['testQueryIntegerBooleanString'][0]
): Request
{
@@ -1389,7 +1389,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObject'][0]
): PromiseInterface
{
@@ -1442,7 +1442,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleDeepObjectExplodeTrueObjectRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObject'][0]
): Request
{
@@ -1707,7 +1707,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAllOfAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObjectAllOf'][0]
): PromiseInterface
{
@@ -1760,7 +1760,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAllOfRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObjectAllOf'][0]
): Request
{
@@ -1853,7 +1853,7 @@ public function testQueryStyleDeepObjectExplodeTrueObjectAllOfRequest(
* @return string
*/
public function testQueryStyleFormExplodeFalseArrayInteger(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): string
{
@@ -1874,7 +1874,7 @@ public function testQueryStyleFormExplodeFalseArrayInteger(
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): array
{
@@ -2001,7 +2001,7 @@ public function testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayIntegerAsync(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): PromiseInterface
{
@@ -2025,7 +2025,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayIntegerAsyncWithHttpInfo(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): PromiseInterface
{
@@ -2078,7 +2078,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeFalseArrayIntegerRequest(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): Request
{
@@ -2171,7 +2171,7 @@ public function testQueryStyleFormExplodeFalseArrayIntegerRequest(
* @return string
*/
public function testQueryStyleFormExplodeFalseArrayString(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): string
{
@@ -2192,7 +2192,7 @@ public function testQueryStyleFormExplodeFalseArrayString(
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): array
{
@@ -2319,7 +2319,7 @@ public function testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayStringAsync(
- ?array $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): PromiseInterface
{
@@ -2343,7 +2343,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayStringAsyncWithHttpInfo(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): PromiseInterface
{
@@ -2396,7 +2396,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeFalseArrayStringRequest(
- $query_object = null,
+ array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): Request
{
@@ -2661,7 +2661,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueArrayStringAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueArrayString'][0]
): PromiseInterface
{
@@ -2714,7 +2714,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueArrayStringRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueArrayString'][0]
): Request
{
@@ -2979,7 +2979,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueObjectAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObject'][0]
): PromiseInterface
{
@@ -3032,7 +3032,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueObjectRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObject'][0]
): Request
{
@@ -3297,7 +3297,7 @@ function ($response) {
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueObjectAllOfAsyncWithHttpInfo(
- $query_object = null,
+ ?\OpenAPI\Client\Model\DataQuery $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObjectAllOf'][0]
): PromiseInterface
{
@@ -3350,7 +3350,7 @@ function ($exception) {
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueObjectAllOfRequest(
- $query_object = null,
+ ?\OpenAPI\Client\Model\DataQuery $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObjectAllOf'][0]
): Request
{
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py
index bd5561d241ed..f38ce4018036 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py
@@ -151,6 +151,13 @@ def from_response(
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)
+ # Added new conditions for 409 and 422
+ if http_resp.status == 409:
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 422:
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
+
if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
@@ -189,6 +196,16 @@ class ServiceException(ApiException):
pass
+class ConflictException(ApiException):
+ """Exception for HTTP 409 Conflict."""
+ pass
+
+
+class UnprocessableEntityException(ApiException):
+ """Exception for HTTP 422 Unprocessable Entity."""
+ pass
+
+
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_auth_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_auth_api.py
index bfd827933bd6..47756f746042 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_auth_api.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_auth_api.py
@@ -15,14 +15,14 @@
import unittest
-from openapi_client.api.auth_api import AuthApi # noqa: E501
+from openapi_client.api.auth_api import AuthApi
class TestAuthApi(unittest.TestCase):
"""AuthApi unit test stubs"""
def setUp(self) -> None:
- self.api = AuthApi() # noqa: E501
+ self.api = AuthApi()
def tearDown(self) -> None:
pass
@@ -30,7 +30,14 @@ def tearDown(self) -> None:
def test_test_auth_http_basic(self) -> None:
"""Test case for test_auth_http_basic
- To test HTTP basic authentication # noqa: E501
+ To test HTTP basic authentication
+ """
+ pass
+
+ def test_test_auth_http_bearer(self) -> None:
+ """Test case for test_auth_http_bearer
+
+ To test HTTP bearer authentication
"""
pass
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_bird.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_bird.py
index d95a104d7147..1a2289c0d472 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_bird.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_bird.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.bird import Bird # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.bird import Bird
class TestBird(unittest.TestCase):
"""Bird unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Bird:
"""Test Bird
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Bird`
"""
- model = openapi_client.models.bird.Bird() # noqa: E501
- if include_optional :
+ model = Bird()
+ if include_optional:
return Bird(
- size = '',
+ size = '',
color = ''
)
- else :
+ else:
return Bird(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_body_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_body_api.py
index e5e24ace8102..f9b7917ee006 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_body_api.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_body_api.py
@@ -3,36 +3,97 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.body_api import BodyApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.body_api import BodyApi
class TestBodyApi(unittest.TestCase):
"""BodyApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.body_api.BodyApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = BodyApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_test_binary_gif(self) -> None:
+ """Test case for test_binary_gif
+
+ Test binary (gif) response body
+ """
+ pass
+
+ def test_test_body_application_octetstream_binary(self) -> None:
+ """Test case for test_body_application_octetstream_binary
+
+ Test body parameter(s)
+ """
+ pass
+
+ def test_test_body_multipart_formdata_array_of_binary(self) -> None:
+ """Test case for test_body_multipart_formdata_array_of_binary
+
+ Test array of binary in multipart mime
+ """
+ pass
+
+ def test_test_body_multipart_formdata_single_binary(self) -> None:
+ """Test case for test_body_multipart_formdata_single_binary
+
+ Test single binary in multipart mime
+ """
+ pass
+
+ def test_test_echo_body_all_of_pet(self) -> None:
+ """Test case for test_echo_body_all_of_pet
+
+ Test body parameter(s)
+ """
+ pass
+
+ def test_test_echo_body_free_form_object_response_string(self) -> None:
+ """Test case for test_echo_body_free_form_object_response_string
- def tearDown(self):
+ Test free form object
+ """
pass
- def test_test_echo_body_pet(self):
+ def test_test_echo_body_pet(self) -> None:
"""Test case for test_echo_body_pet
- Test body parameter(s) # noqa: E501
+ Test body parameter(s)
+ """
+ pass
+
+ def test_test_echo_body_pet_response_string(self) -> None:
+ """Test case for test_echo_body_pet_response_string
+
+ Test empty response body
+ """
+ pass
+
+ def test_test_echo_body_string_enum(self) -> None:
+ """Test case for test_echo_body_string_enum
+
+ Test string enum response body
+ """
+ pass
+
+ def test_test_echo_body_tag_response_string(self) -> None:
+ """Test case for test_echo_body_tag_response_string
+
+ Test empty json (request body)
"""
pass
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_category.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_category.py
index b5771c572d33..12dfe19f63ac 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_category.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_category.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.category import Category # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.category import Category
class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Category:
"""Test Category
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Category`
"""
- model = openapi_client.models.category.Category() # noqa: E501
- if include_optional :
+ model = Category()
+ if include_optional:
return Category(
- id = 1,
+ id = 1,
name = 'Dogs'
)
- else :
+ else:
return Category(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_data_query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_data_query.py
index f33d8daabae1..fcd7c9566a37 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_data_query.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_data_query.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.data_query import DataQuery # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.data_query import DataQuery
class TestDataQuery(unittest.TestCase):
"""DataQuery unit test stubs"""
@@ -29,21 +26,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> DataQuery:
"""Test DataQuery
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DataQuery`
"""
- model = openapi_client.models.data_query.DataQuery() # noqa: E501
- if include_optional :
+ model = DataQuery()
+ if include_optional:
return DataQuery(
- suffix = '',
- text = 'Some text',
+ suffix = '',
+ text = 'Some text',
var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
)
- else :
+ else:
return DataQuery(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_default_value.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_default_value.py
index 6e5f35fd2eff..4bdc49448868 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_default_value.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_default_value.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.default_value import DefaultValue # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.default_value import DefaultValue
class TestDefaultValue(unittest.TestCase):
"""DefaultValue unit test stubs"""
@@ -29,34 +26,40 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> DefaultValue:
"""Test DefaultValue
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DefaultValue`
"""
- model = openapi_client.models.default_value.DefaultValue() # noqa: E501
- if include_optional :
+ model = DefaultValue()
+ if include_optional:
return DefaultValue(
+ array_string_enum_ref_default = [
+ 'success'
+ ],
array_string_enum_default = [
'success'
- ],
+ ],
array_string_default = [
''
- ],
+ ],
array_integer_default = [
56
- ],
+ ],
array_string = [
''
- ],
+ ],
array_string_nullable = [
''
- ],
+ ],
+ array_string_extension_nullable = [
+ ''
+ ],
string_nullable = ''
)
- else :
+ else:
return DefaultValue(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_form_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_form_api.py
index 6422432c79ba..fbd7ed641e6a 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_form_api.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_form_api.py
@@ -3,36 +3,48 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.form_api import FormApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.form_api import FormApi
class TestFormApi(unittest.TestCase):
"""FormApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.form_api.FormApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = FormApi()
- def tearDown(self):
+ def tearDown(self) -> None:
pass
- def test_test_form_integer_boolean_string(self):
+ def test_test_form_integer_boolean_string(self) -> None:
"""Test case for test_form_integer_boolean_string
- Test form parameter(s) # noqa: E501
+ Test form parameter(s)
+ """
+ pass
+
+ def test_test_form_object_multipart(self) -> None:
+ """Test case for test_form_object_multipart
+
+ Test form parameter(s) for multipart schema
+ """
+ pass
+
+ def test_test_form_oneof(self) -> None:
+ """Test case for test_form_oneof
+
+ Test form parameter(s) for oneOf schema
"""
pass
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_header_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_header_api.py
index c1b7ed44e8f8..68670ebc567f 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_header_api.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_header_api.py
@@ -3,36 +3,34 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.header_api import HeaderApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.header_api import HeaderApi
class TestHeaderApi(unittest.TestCase):
"""HeaderApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.header_api.HeaderApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = HeaderApi()
- def tearDown(self):
+ def tearDown(self) -> None:
pass
- def test_test_header_integer_boolean_string(self):
- """Test case for test_header_integer_boolean_string
+ def test_test_header_integer_boolean_string_enums(self) -> None:
+ """Test case for test_header_integer_boolean_string_enums
- Test header parameter(s) # noqa: E501
+ Test header parameter(s)
"""
pass
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_number_properties_only.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_number_properties_only.py
index 68aa757f9df9..682503a0cbf7 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_number_properties_only.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_number_properties_only.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
-"""
+""" # noqa: E501
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.number_properties_only import NumberPropertiesOnly # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.number_properties_only import NumberPropertiesOnly
class TestNumberPropertiesOnly(unittest.TestCase):
"""NumberPropertiesOnly unit test stubs"""
@@ -29,21 +26,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> NumberPropertiesOnly:
"""Test NumberPropertiesOnly
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NumberPropertiesOnly`
"""
- model = openapi_client.models.number_properties_only.NumberPropertiesOnly() # noqa: E501
- if include_optional :
+ model = NumberPropertiesOnly()
+ if include_optional:
return NumberPropertiesOnly(
- number = 1.337,
- float = 1.337,
- double = ''
+ number = 1.337,
+ var_float = 1.337,
+ double = 0.8
)
- else :
+ else:
return NumberPropertiesOnly(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_path_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_path_api.py
index 4d8e71f7ce6a..faabe2102426 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_path_api.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_path_api.py
@@ -3,36 +3,34 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.path_api import PathApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.path_api import PathApi
class TestPathApi(unittest.TestCase):
"""PathApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.path_api.PathApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = PathApi()
- def tearDown(self):
+ def tearDown(self) -> None:
pass
- def test_tests_path_string_path_string_integer_path_integer(self):
- """Test case for tests_path_string_path_string_integer_path_integer
+ def test_tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(self) -> None:
+ """Test case for tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path
- Test path parameter(s) # noqa: E501
+ Test path parameter(s)
"""
pass
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_pet.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_pet.py
index e02d8615bc08..21965554b265 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_pet.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_pet.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.pet import Pet # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.pet import Pet
class TestPet(unittest.TestCase):
"""Pet unit test stubs"""
@@ -29,32 +26,32 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Pet:
"""Test Pet
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pet`
"""
- model = openapi_client.models.pet.Pet() # noqa: E501
- if include_optional :
+ model = Pet()
+ if include_optional:
return Pet(
- id = 10,
- name = 'doggie',
+ id = 10,
+ name = 'doggie',
category = openapi_client.models.category.Category(
id = 1,
- name = 'Dogs', ),
+ name = 'Dogs', ),
photo_urls = [
''
- ],
+ ],
tags = [
openapi_client.models.tag.Tag(
id = 56,
name = '', )
- ],
+ ],
status = 'available'
)
- else :
+ else:
return Pet(
name = 'doggie',
photo_urls = [
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query.py
index a7652e1ae59c..c3d033ef0b51 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.query import Query # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.query import Query
class TestQuery(unittest.TestCase):
"""Query unit test stubs"""
@@ -29,22 +26,22 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Query:
"""Test Query
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Query`
"""
- model = openapi_client.models.query.Query() # noqa: E501
- if include_optional :
+ model = Query()
+ if include_optional:
return Query(
- id = 56,
+ id = 56,
outcomes = [
'SUCCESS'
]
)
- else :
+ else:
return Query(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query_api.py
index 829a635d99b9..e2e6c2dac461 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query_api.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_query_api.py
@@ -3,50 +3,97 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.query_api import QueryApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.query_api import QueryApi
class TestQueryApi(unittest.TestCase):
"""QueryApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.query_api.QueryApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = QueryApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_test_enum_ref_string(self) -> None:
+ """Test case for test_enum_ref_string
- def tearDown(self):
+ Test query parameter(s)
+ """
pass
- def test_test_query_integer_boolean_string(self):
+ def test_test_query_datetime_date_string(self) -> None:
+ """Test case for test_query_datetime_date_string
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_integer_boolean_string(self) -> None:
"""Test case for test_query_integer_boolean_string
- Test query parameter(s) # noqa: E501
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_deep_object_explode_true_object(self) -> None:
+ """Test case for test_query_style_deep_object_explode_true_object
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_deep_object_explode_true_object_all_of(self) -> None:
+ """Test case for test_query_style_deep_object_explode_true_object_all_of
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_form_explode_false_array_integer(self) -> None:
+ """Test case for test_query_style_form_explode_false_array_integer
+
+ Test query parameter(s)
"""
pass
- def test_test_query_style_form_explode_true_array_string(self):
+ def test_test_query_style_form_explode_false_array_string(self) -> None:
+ """Test case for test_query_style_form_explode_false_array_string
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_form_explode_true_array_string(self) -> None:
"""Test case for test_query_style_form_explode_true_array_string
- Test query parameter(s) # noqa: E501
+ Test query parameter(s)
"""
pass
- def test_test_query_style_form_explode_true_object(self):
+ def test_test_query_style_form_explode_true_object(self) -> None:
"""Test case for test_query_style_form_explode_true_object
- Test query parameter(s) # noqa: E501
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_form_explode_true_object_all_of(self) -> None:
+ """Test case for test_query_style_form_explode_true_object_all_of
+
+ Test query parameter(s)
"""
pass
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_string_enum_ref.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_string_enum_ref.py
index 60a3f0781b18..ece5b369cc22 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_string_enum_ref.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_string_enum_ref.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.string_enum_ref import StringEnumRef # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.string_enum_ref import StringEnumRef
class TestStringEnumRef(unittest.TestCase):
"""StringEnumRef unit test stubs"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_tag.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_tag.py
index 8e48170ab6ae..7e235ac8b95b 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_tag.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_tag.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.tag import Tag # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.tag import Tag
class TestTag(unittest.TestCase):
"""Tag unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Tag:
"""Test Tag
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Tag`
"""
- model = openapi_client.models.tag.Tag() # noqa: E501
- if include_optional :
+ model = Tag()
+ if include_optional:
return Tag(
- id = 56,
+ id = 56,
name = ''
)
- else :
+ else:
return Tag(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_form_object_multipart_request_marker.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_form_object_multipart_request_marker.py
index d49974286060..97f5600a234d 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_form_object_multipart_request_marker.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_form_object_multipart_request_marker.py
@@ -28,7 +28,7 @@ def tearDown(self):
def make_instance(self, include_optional) -> TestFormObjectMultipartRequestMarker:
"""Test TestFormObjectMultipartRequestMarker
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestFormObjectMultipartRequestMarker`
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
index 395407345615..22731b578cc8 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter unit test stubs"""
@@ -29,22 +26,22 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter:
"""Test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`
"""
- model = openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() # noqa: E501
- if include_optional :
+ model = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter()
+ if include_optional:
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
- size = '',
- color = '',
- id = 1,
+ size = '',
+ color = '',
+ id = 1,
name = 'Dogs'
)
- else :
+ else:
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
)
"""
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py
deleted file mode 100644
index 2b35c46cb3f6..000000000000
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# coding: utf-8
-
-"""
- Echo Server API
-
- Echo Server API
-
- The version of the OpenAPI document: 0.1.0
- Contact: team@openapitools.org
- Generated by OpenAPI Generator (https://openapi-generator.tech)
-
- Do not edit the class manually.
-""" # noqa: E501
-
-
-import unittest
-
-from openapi_client.models.test_query_style_form_explode_true_array_integer_query_object_parameter import TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter
-
-class TestTestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(unittest.TestCase):
- """TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter:
- """Test TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter`
- """
- model = TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter()
- if include_optional:
- return TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(
- values = [
- 56
- ]
- )
- else:
- return TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(
- )
- """
-
- def testTestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(self):
- """Test TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter"""
- # inst_req_only = self.make_instance(include_optional=False)
- # inst_req_and_optional = self.make_instance(include_optional=True)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
index 6366b5c23587..2656fbf8e027 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter unit test stubs"""
@@ -29,21 +26,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter:
"""Test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`
"""
- model = openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() # noqa: E501
- if include_optional :
+ model = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
+ if include_optional:
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
values = [
''
]
)
- else :
+ else:
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_auth_api.py b/samples/client/echo_api/python-pydantic-v1/test/test_auth_api.py
index bfd827933bd6..5c53a30e09c4 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_auth_api.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_auth_api.py
@@ -22,10 +22,10 @@ class TestAuthApi(unittest.TestCase):
"""AuthApi unit test stubs"""
def setUp(self) -> None:
- self.api = AuthApi() # noqa: E501
+ self.api = AuthApi()
def tearDown(self) -> None:
- pass
+ self.api.api_client.close()
def test_test_auth_http_basic(self) -> None:
"""Test case for test_auth_http_basic
@@ -34,6 +34,13 @@ def test_test_auth_http_basic(self) -> None:
"""
pass
+ def test_test_auth_http_bearer(self) -> None:
+ """Test case for test_auth_http_bearer
+
+ To test HTTP bearer authentication # noqa: E501
+ """
+ pass
+
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_bird.py b/samples/client/echo_api/python-pydantic-v1/test/test_bird.py
index d95a104d7147..0ce8736bd8a6 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_bird.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_bird.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.bird import Bird # noqa: E501
-from openapi_client.rest import ApiException
class TestBird(unittest.TestCase):
"""Bird unit test stubs"""
@@ -29,20 +27,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Bird:
"""Test Bird
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Bird`
"""
- model = openapi_client.models.bird.Bird() # noqa: E501
- if include_optional :
+ model = Bird() # noqa: E501
+ if include_optional:
return Bird(
- size = '',
+ size = '',
color = ''
)
- else :
+ else:
return Bird(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_body_api.py b/samples/client/echo_api/python-pydantic-v1/test/test_body_api.py
index e5e24ace8102..6727be6c74ca 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_body_api.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_body_api.py
@@ -3,39 +3,100 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
from openapi_client.api.body_api import BodyApi # noqa: E501
-from openapi_client.rest import ApiException
class TestBodyApi(unittest.TestCase):
"""BodyApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.body_api.BodyApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = BodyApi()
+
+ def tearDown(self) -> None:
+ self.api.api_client.close()
+
+ def test_test_binary_gif(self) -> None:
+ """Test case for test_binary_gif
+
+ Test binary (gif) response body # noqa: E501
+ """
+ pass
+
+ def test_test_body_application_octetstream_binary(self) -> None:
+ """Test case for test_body_application_octetstream_binary
+
+ Test body parameter(s) # noqa: E501
+ """
+ pass
+
+ def test_test_body_multipart_formdata_array_of_binary(self) -> None:
+ """Test case for test_body_multipart_formdata_array_of_binary
+
+ Test array of binary in multipart mime # noqa: E501
+ """
+ pass
+
+ def test_test_body_multipart_formdata_single_binary(self) -> None:
+ """Test case for test_body_multipart_formdata_single_binary
- def tearDown(self):
+ Test single binary in multipart mime # noqa: E501
+ """
pass
- def test_test_echo_body_pet(self):
+ def test_test_echo_body_all_of_pet(self) -> None:
+ """Test case for test_echo_body_all_of_pet
+
+ Test body parameter(s) # noqa: E501
+ """
+ pass
+
+ def test_test_echo_body_free_form_object_response_string(self) -> None:
+ """Test case for test_echo_body_free_form_object_response_string
+
+ Test free form object # noqa: E501
+ """
+ pass
+
+ def test_test_echo_body_pet(self) -> None:
"""Test case for test_echo_body_pet
Test body parameter(s) # noqa: E501
"""
pass
+ def test_test_echo_body_pet_response_string(self) -> None:
+ """Test case for test_echo_body_pet_response_string
+
+ Test empty response body # noqa: E501
+ """
+ pass
+
+ def test_test_echo_body_string_enum(self) -> None:
+ """Test case for test_echo_body_string_enum
+
+ Test string enum response body # noqa: E501
+ """
+ pass
+
+ def test_test_echo_body_tag_response_string(self) -> None:
+ """Test case for test_echo_body_tag_response_string
+
+ Test empty json (request body) # noqa: E501
+ """
+ pass
+
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_category.py b/samples/client/echo_api/python-pydantic-v1/test/test_category.py
index b5771c572d33..487e50d95d5c 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_category.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_category.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.category import Category # noqa: E501
-from openapi_client.rest import ApiException
class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
@@ -29,20 +27,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Category:
"""Test Category
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Category`
"""
- model = openapi_client.models.category.Category() # noqa: E501
- if include_optional :
+ model = Category() # noqa: E501
+ if include_optional:
return Category(
- id = 1,
+ id = 1,
name = 'Dogs'
)
- else :
+ else:
return Category(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_data_query.py b/samples/client/echo_api/python-pydantic-v1/test/test_data_query.py
index f33d8daabae1..5ae6bdbf8778 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_data_query.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_data_query.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.data_query import DataQuery # noqa: E501
-from openapi_client.rest import ApiException
class TestDataQuery(unittest.TestCase):
"""DataQuery unit test stubs"""
@@ -29,21 +27,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> DataQuery:
"""Test DataQuery
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DataQuery`
"""
- model = openapi_client.models.data_query.DataQuery() # noqa: E501
- if include_optional :
+ model = DataQuery() # noqa: E501
+ if include_optional:
return DataQuery(
- suffix = '',
- text = 'Some text',
+ suffix = '',
+ text = 'Some text',
var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
)
- else :
+ else:
return DataQuery(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_default_value.py b/samples/client/echo_api/python-pydantic-v1/test/test_default_value.py
index 6e5f35fd2eff..a38f9d85c970 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_default_value.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_default_value.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.default_value import DefaultValue # noqa: E501
-from openapi_client.rest import ApiException
class TestDefaultValue(unittest.TestCase):
"""DefaultValue unit test stubs"""
@@ -29,34 +27,40 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> DefaultValue:
"""Test DefaultValue
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DefaultValue`
"""
- model = openapi_client.models.default_value.DefaultValue() # noqa: E501
- if include_optional :
+ model = DefaultValue() # noqa: E501
+ if include_optional:
return DefaultValue(
+ array_string_enum_ref_default = [
+ 'success'
+ ],
array_string_enum_default = [
'success'
- ],
+ ],
array_string_default = [
''
- ],
+ ],
array_integer_default = [
56
- ],
+ ],
array_string = [
''
- ],
+ ],
array_string_nullable = [
''
- ],
+ ],
+ array_string_extension_nullable = [
+ ''
+ ],
string_nullable = ''
)
- else :
+ else:
return DefaultValue(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_form_api.py b/samples/client/echo_api/python-pydantic-v1/test/test_form_api.py
index 6422432c79ba..6c888452a47b 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_form_api.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_form_api.py
@@ -3,39 +3,51 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
from openapi_client.api.form_api import FormApi # noqa: E501
-from openapi_client.rest import ApiException
class TestFormApi(unittest.TestCase):
"""FormApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.form_api.FormApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = FormApi()
- def tearDown(self):
- pass
+ def tearDown(self) -> None:
+ self.api.api_client.close()
- def test_test_form_integer_boolean_string(self):
+ def test_test_form_integer_boolean_string(self) -> None:
"""Test case for test_form_integer_boolean_string
Test form parameter(s) # noqa: E501
"""
pass
+ def test_test_form_object_multipart(self) -> None:
+ """Test case for test_form_object_multipart
+
+ Test form parameter(s) for multipart schema # noqa: E501
+ """
+ pass
+
+ def test_test_form_oneof(self) -> None:
+ """Test case for test_form_oneof
+
+ Test form parameter(s) for oneOf schema # noqa: E501
+ """
+ pass
+
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_header_api.py b/samples/client/echo_api/python-pydantic-v1/test/test_header_api.py
index c1b7ed44e8f8..d9bcf17bfa1e 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_header_api.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_header_api.py
@@ -3,34 +3,32 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
from openapi_client.api.header_api import HeaderApi # noqa: E501
-from openapi_client.rest import ApiException
class TestHeaderApi(unittest.TestCase):
"""HeaderApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.header_api.HeaderApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = HeaderApi()
- def tearDown(self):
- pass
+ def tearDown(self) -> None:
+ self.api.api_client.close()
- def test_test_header_integer_boolean_string(self):
- """Test case for test_header_integer_boolean_string
+ def test_test_header_integer_boolean_string_enums(self) -> None:
+ """Test case for test_header_integer_boolean_string_enums
Test header parameter(s) # noqa: E501
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_number_properties_only.py b/samples/client/echo_api/python-pydantic-v1/test/test_number_properties_only.py
index 68aa757f9df9..e5072e660a20 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_number_properties_only.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_number_properties_only.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
-"""
+""" # noqa: E501
import unittest
import datetime
-import openapi_client
from openapi_client.models.number_properties_only import NumberPropertiesOnly # noqa: E501
-from openapi_client.rest import ApiException
class TestNumberPropertiesOnly(unittest.TestCase):
"""NumberPropertiesOnly unit test stubs"""
@@ -29,21 +27,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> NumberPropertiesOnly:
"""Test NumberPropertiesOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NumberPropertiesOnly`
"""
- model = openapi_client.models.number_properties_only.NumberPropertiesOnly() # noqa: E501
- if include_optional :
+ model = NumberPropertiesOnly() # noqa: E501
+ if include_optional:
return NumberPropertiesOnly(
- number = 1.337,
- float = 1.337,
- double = ''
+ number = 1.337,
+ float = 1.337,
+ double = 0.8
)
- else :
+ else:
return NumberPropertiesOnly(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_path_api.py b/samples/client/echo_api/python-pydantic-v1/test/test_path_api.py
index 4d8e71f7ce6a..2b0bfc82ebfa 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_path_api.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_path_api.py
@@ -3,34 +3,32 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
from openapi_client.api.path_api import PathApi # noqa: E501
-from openapi_client.rest import ApiException
class TestPathApi(unittest.TestCase):
"""PathApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.path_api.PathApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = PathApi()
- def tearDown(self):
- pass
+ def tearDown(self) -> None:
+ self.api.api_client.close()
- def test_tests_path_string_path_string_integer_path_integer(self):
- """Test case for tests_path_string_path_string_integer_path_integer
+ def test_tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(self) -> None:
+ """Test case for tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path
Test path parameter(s) # noqa: E501
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_pet.py b/samples/client/echo_api/python-pydantic-v1/test/test_pet.py
index e02d8615bc08..17f0d1221411 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_pet.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_pet.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.pet import Pet # noqa: E501
-from openapi_client.rest import ApiException
class TestPet(unittest.TestCase):
"""Pet unit test stubs"""
@@ -29,32 +27,32 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Pet:
"""Test Pet
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pet`
"""
- model = openapi_client.models.pet.Pet() # noqa: E501
- if include_optional :
+ model = Pet() # noqa: E501
+ if include_optional:
return Pet(
- id = 10,
- name = 'doggie',
+ id = 10,
+ name = 'doggie',
category = openapi_client.models.category.Category(
id = 1,
- name = 'Dogs', ),
+ name = 'Dogs', ),
photo_urls = [
''
- ],
+ ],
tags = [
openapi_client.models.tag.Tag(
id = 56,
name = '', )
- ],
+ ],
status = 'available'
)
- else :
+ else:
return Pet(
name = 'doggie',
photo_urls = [
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_query.py b/samples/client/echo_api/python-pydantic-v1/test/test_query.py
index a7652e1ae59c..bc3dfd5afd1f 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_query.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_query.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.query import Query # noqa: E501
-from openapi_client.rest import ApiException
class TestQuery(unittest.TestCase):
"""Query unit test stubs"""
@@ -29,22 +27,22 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Query:
"""Test Query
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Query`
"""
- model = openapi_client.models.query.Query() # noqa: E501
- if include_optional :
+ model = Query() # noqa: E501
+ if include_optional:
return Query(
- id = 56,
+ id = 56,
outcomes = [
'SUCCESS'
]
)
- else :
+ else:
return Query(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_query_api.py b/samples/client/echo_api/python-pydantic-v1/test/test_query_api.py
index 829a635d99b9..bf9837100754 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_query_api.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_query_api.py
@@ -3,53 +3,100 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
from openapi_client.api.query_api import QueryApi # noqa: E501
-from openapi_client.rest import ApiException
class TestQueryApi(unittest.TestCase):
"""QueryApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.query_api.QueryApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = QueryApi()
+
+ def tearDown(self) -> None:
+ self.api.api_client.close()
+
+ def test_test_enum_ref_string(self) -> None:
+ """Test case for test_enum_ref_string
+
+ Test query parameter(s) # noqa: E501
+ """
+ pass
+
+ def test_test_query_datetime_date_string(self) -> None:
+ """Test case for test_query_datetime_date_string
- def tearDown(self):
+ Test query parameter(s) # noqa: E501
+ """
pass
- def test_test_query_integer_boolean_string(self):
+ def test_test_query_integer_boolean_string(self) -> None:
"""Test case for test_query_integer_boolean_string
Test query parameter(s) # noqa: E501
"""
pass
- def test_test_query_style_form_explode_true_array_string(self):
+ def test_test_query_style_deep_object_explode_true_object(self) -> None:
+ """Test case for test_query_style_deep_object_explode_true_object
+
+ Test query parameter(s) # noqa: E501
+ """
+ pass
+
+ def test_test_query_style_deep_object_explode_true_object_all_of(self) -> None:
+ """Test case for test_query_style_deep_object_explode_true_object_all_of
+
+ Test query parameter(s) # noqa: E501
+ """
+ pass
+
+ def test_test_query_style_form_explode_false_array_integer(self) -> None:
+ """Test case for test_query_style_form_explode_false_array_integer
+
+ Test query parameter(s) # noqa: E501
+ """
+ pass
+
+ def test_test_query_style_form_explode_false_array_string(self) -> None:
+ """Test case for test_query_style_form_explode_false_array_string
+
+ Test query parameter(s) # noqa: E501
+ """
+ pass
+
+ def test_test_query_style_form_explode_true_array_string(self) -> None:
"""Test case for test_query_style_form_explode_true_array_string
Test query parameter(s) # noqa: E501
"""
pass
- def test_test_query_style_form_explode_true_object(self):
+ def test_test_query_style_form_explode_true_object(self) -> None:
"""Test case for test_query_style_form_explode_true_object
Test query parameter(s) # noqa: E501
"""
pass
+ def test_test_query_style_form_explode_true_object_all_of(self) -> None:
+ """Test case for test_query_style_form_explode_true_object_all_of
+
+ Test query parameter(s) # noqa: E501
+ """
+ pass
+
if __name__ == '__main__':
unittest.main()
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_string_enum_ref.py b/samples/client/echo_api/python-pydantic-v1/test/test_string_enum_ref.py
index 60a3f0781b18..f48d7776fccf 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_string_enum_ref.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_string_enum_ref.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef # noqa: E501
-from openapi_client.rest import ApiException
class TestStringEnumRef(unittest.TestCase):
"""StringEnumRef unit test stubs"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_tag.py b/samples/client/echo_api/python-pydantic-v1/test/test_tag.py
index 8e48170ab6ae..ce6f8f0cdbc5 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_tag.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_tag.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.tag import Tag # noqa: E501
-from openapi_client.rest import ApiException
class TestTag(unittest.TestCase):
"""Tag unit test stubs"""
@@ -29,20 +27,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Tag:
"""Test Tag
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Tag`
"""
- model = openapi_client.models.tag.Tag() # noqa: E501
- if include_optional :
+ model = Tag() # noqa: E501
+ if include_optional:
return Tag(
- id = 56,
+ id = 56,
name = ''
)
- else :
+ else:
return Tag(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
index 395407345615..8063f5b7b630 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter # noqa: E501
-from openapi_client.rest import ApiException
class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter unit test stubs"""
@@ -29,22 +27,22 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter:
"""Test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`
"""
- model = openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() # noqa: E501
- if include_optional :
+ model = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() # noqa: E501
+ if include_optional:
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
- size = '',
- color = '',
- id = 1,
+ size = '',
+ color = '',
+ id = 1,
name = 'Dogs'
)
- else :
+ else:
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
)
"""
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py b/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py
deleted file mode 100644
index 3fc17ba947e5..000000000000
--- a/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# coding: utf-8
-
-"""
- Echo Server API
-
- Echo Server API
-
- The version of the OpenAPI document: 0.1.0
- Contact: team@openapitools.org
- Generated by OpenAPI Generator (https://openapi-generator.tech)
-
- Do not edit the class manually.
-""" # noqa: E501
-
-
-import unittest
-import datetime
-
-from openapi_client.models.test_query_style_form_explode_true_array_integer_query_object_parameter import TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter # noqa: E501
-
-class TestTestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(unittest.TestCase):
- """TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter:
- """Test TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter`
- """
- model = TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter() # noqa: E501
- if include_optional:
- return TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(
- values = [
- 56
- ]
- )
- else:
- return TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(
- )
- """
-
- def testTestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(self):
- """Test TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter"""
- # inst_req_only = self.make_instance(include_optional=False)
- # inst_req_and_optional = self.make_instance(include_optional=True)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
index 6366b5c23587..f0ce75f334f5 100644
--- a/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
+++ b/samples/client/echo_api/python-pydantic-v1/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
@@ -3,22 +3,20 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
import datetime
-import openapi_client
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter # noqa: E501
-from openapi_client.rest import ApiException
class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter unit test stubs"""
@@ -29,21 +27,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter:
"""Test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`
"""
- model = openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() # noqa: E501
- if include_optional :
+ model = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() # noqa: E501
+ if include_optional:
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
values = [
''
]
)
- else :
+ else:
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
)
"""
diff --git a/samples/client/echo_api/python/openapi_client/exceptions.py b/samples/client/echo_api/python/openapi_client/exceptions.py
index bd5561d241ed..f38ce4018036 100644
--- a/samples/client/echo_api/python/openapi_client/exceptions.py
+++ b/samples/client/echo_api/python/openapi_client/exceptions.py
@@ -151,6 +151,13 @@ def from_response(
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)
+ # Added new conditions for 409 and 422
+ if http_resp.status == 409:
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 422:
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
+
if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
@@ -189,6 +196,16 @@ class ServiceException(ApiException):
pass
+class ConflictException(ApiException):
+ """Exception for HTTP 409 Conflict."""
+ pass
+
+
+class UnprocessableEntityException(ApiException):
+ """Exception for HTTP 422 Unprocessable Entity."""
+ pass
+
+
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
diff --git a/samples/client/echo_api/python/test/test_auth_api.py b/samples/client/echo_api/python/test/test_auth_api.py
index bfd827933bd6..47756f746042 100644
--- a/samples/client/echo_api/python/test/test_auth_api.py
+++ b/samples/client/echo_api/python/test/test_auth_api.py
@@ -15,14 +15,14 @@
import unittest
-from openapi_client.api.auth_api import AuthApi # noqa: E501
+from openapi_client.api.auth_api import AuthApi
class TestAuthApi(unittest.TestCase):
"""AuthApi unit test stubs"""
def setUp(self) -> None:
- self.api = AuthApi() # noqa: E501
+ self.api = AuthApi()
def tearDown(self) -> None:
pass
@@ -30,7 +30,14 @@ def tearDown(self) -> None:
def test_test_auth_http_basic(self) -> None:
"""Test case for test_auth_http_basic
- To test HTTP basic authentication # noqa: E501
+ To test HTTP basic authentication
+ """
+ pass
+
+ def test_test_auth_http_bearer(self) -> None:
+ """Test case for test_auth_http_bearer
+
+ To test HTTP bearer authentication
"""
pass
diff --git a/samples/client/echo_api/python/test/test_bird.py b/samples/client/echo_api/python/test/test_bird.py
index d95a104d7147..1a2289c0d472 100644
--- a/samples/client/echo_api/python/test/test_bird.py
+++ b/samples/client/echo_api/python/test/test_bird.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.bird import Bird # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.bird import Bird
class TestBird(unittest.TestCase):
"""Bird unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Bird:
"""Test Bird
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Bird`
"""
- model = openapi_client.models.bird.Bird() # noqa: E501
- if include_optional :
+ model = Bird()
+ if include_optional:
return Bird(
- size = '',
+ size = '',
color = ''
)
- else :
+ else:
return Bird(
)
"""
diff --git a/samples/client/echo_api/python/test/test_body_api.py b/samples/client/echo_api/python/test/test_body_api.py
index e5e24ace8102..f9b7917ee006 100644
--- a/samples/client/echo_api/python/test/test_body_api.py
+++ b/samples/client/echo_api/python/test/test_body_api.py
@@ -3,36 +3,97 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.body_api import BodyApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.body_api import BodyApi
class TestBodyApi(unittest.TestCase):
"""BodyApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.body_api.BodyApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = BodyApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_test_binary_gif(self) -> None:
+ """Test case for test_binary_gif
+
+ Test binary (gif) response body
+ """
+ pass
+
+ def test_test_body_application_octetstream_binary(self) -> None:
+ """Test case for test_body_application_octetstream_binary
+
+ Test body parameter(s)
+ """
+ pass
+
+ def test_test_body_multipart_formdata_array_of_binary(self) -> None:
+ """Test case for test_body_multipart_formdata_array_of_binary
+
+ Test array of binary in multipart mime
+ """
+ pass
+
+ def test_test_body_multipart_formdata_single_binary(self) -> None:
+ """Test case for test_body_multipart_formdata_single_binary
+
+ Test single binary in multipart mime
+ """
+ pass
+
+ def test_test_echo_body_all_of_pet(self) -> None:
+ """Test case for test_echo_body_all_of_pet
+
+ Test body parameter(s)
+ """
+ pass
+
+ def test_test_echo_body_free_form_object_response_string(self) -> None:
+ """Test case for test_echo_body_free_form_object_response_string
- def tearDown(self):
+ Test free form object
+ """
pass
- def test_test_echo_body_pet(self):
+ def test_test_echo_body_pet(self) -> None:
"""Test case for test_echo_body_pet
- Test body parameter(s) # noqa: E501
+ Test body parameter(s)
+ """
+ pass
+
+ def test_test_echo_body_pet_response_string(self) -> None:
+ """Test case for test_echo_body_pet_response_string
+
+ Test empty response body
+ """
+ pass
+
+ def test_test_echo_body_string_enum(self) -> None:
+ """Test case for test_echo_body_string_enum
+
+ Test string enum response body
+ """
+ pass
+
+ def test_test_echo_body_tag_response_string(self) -> None:
+ """Test case for test_echo_body_tag_response_string
+
+ Test empty json (request body)
"""
pass
diff --git a/samples/client/echo_api/python/test/test_category.py b/samples/client/echo_api/python/test/test_category.py
index b5771c572d33..12dfe19f63ac 100644
--- a/samples/client/echo_api/python/test/test_category.py
+++ b/samples/client/echo_api/python/test/test_category.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.category import Category # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.category import Category
class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Category:
"""Test Category
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Category`
"""
- model = openapi_client.models.category.Category() # noqa: E501
- if include_optional :
+ model = Category()
+ if include_optional:
return Category(
- id = 1,
+ id = 1,
name = 'Dogs'
)
- else :
+ else:
return Category(
)
"""
diff --git a/samples/client/echo_api/python/test/test_data_query.py b/samples/client/echo_api/python/test/test_data_query.py
index f33d8daabae1..fcd7c9566a37 100644
--- a/samples/client/echo_api/python/test/test_data_query.py
+++ b/samples/client/echo_api/python/test/test_data_query.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.data_query import DataQuery # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.data_query import DataQuery
class TestDataQuery(unittest.TestCase):
"""DataQuery unit test stubs"""
@@ -29,21 +26,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> DataQuery:
"""Test DataQuery
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DataQuery`
"""
- model = openapi_client.models.data_query.DataQuery() # noqa: E501
- if include_optional :
+ model = DataQuery()
+ if include_optional:
return DataQuery(
- suffix = '',
- text = 'Some text',
+ suffix = '',
+ text = 'Some text',
var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
)
- else :
+ else:
return DataQuery(
)
"""
diff --git a/samples/client/echo_api/python/test/test_default_value.py b/samples/client/echo_api/python/test/test_default_value.py
index 6e5f35fd2eff..4bdc49448868 100644
--- a/samples/client/echo_api/python/test/test_default_value.py
+++ b/samples/client/echo_api/python/test/test_default_value.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.default_value import DefaultValue # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.default_value import DefaultValue
class TestDefaultValue(unittest.TestCase):
"""DefaultValue unit test stubs"""
@@ -29,34 +26,40 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> DefaultValue:
"""Test DefaultValue
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DefaultValue`
"""
- model = openapi_client.models.default_value.DefaultValue() # noqa: E501
- if include_optional :
+ model = DefaultValue()
+ if include_optional:
return DefaultValue(
+ array_string_enum_ref_default = [
+ 'success'
+ ],
array_string_enum_default = [
'success'
- ],
+ ],
array_string_default = [
''
- ],
+ ],
array_integer_default = [
56
- ],
+ ],
array_string = [
''
- ],
+ ],
array_string_nullable = [
''
- ],
+ ],
+ array_string_extension_nullable = [
+ ''
+ ],
string_nullable = ''
)
- else :
+ else:
return DefaultValue(
)
"""
diff --git a/samples/client/echo_api/python/test/test_form_api.py b/samples/client/echo_api/python/test/test_form_api.py
index 6422432c79ba..fbd7ed641e6a 100644
--- a/samples/client/echo_api/python/test/test_form_api.py
+++ b/samples/client/echo_api/python/test/test_form_api.py
@@ -3,36 +3,48 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.form_api import FormApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.form_api import FormApi
class TestFormApi(unittest.TestCase):
"""FormApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.form_api.FormApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = FormApi()
- def tearDown(self):
+ def tearDown(self) -> None:
pass
- def test_test_form_integer_boolean_string(self):
+ def test_test_form_integer_boolean_string(self) -> None:
"""Test case for test_form_integer_boolean_string
- Test form parameter(s) # noqa: E501
+ Test form parameter(s)
+ """
+ pass
+
+ def test_test_form_object_multipart(self) -> None:
+ """Test case for test_form_object_multipart
+
+ Test form parameter(s) for multipart schema
+ """
+ pass
+
+ def test_test_form_oneof(self) -> None:
+ """Test case for test_form_oneof
+
+ Test form parameter(s) for oneOf schema
"""
pass
diff --git a/samples/client/echo_api/python/test/test_header_api.py b/samples/client/echo_api/python/test/test_header_api.py
index c1b7ed44e8f8..68670ebc567f 100644
--- a/samples/client/echo_api/python/test/test_header_api.py
+++ b/samples/client/echo_api/python/test/test_header_api.py
@@ -3,36 +3,34 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.header_api import HeaderApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.header_api import HeaderApi
class TestHeaderApi(unittest.TestCase):
"""HeaderApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.header_api.HeaderApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = HeaderApi()
- def tearDown(self):
+ def tearDown(self) -> None:
pass
- def test_test_header_integer_boolean_string(self):
- """Test case for test_header_integer_boolean_string
+ def test_test_header_integer_boolean_string_enums(self) -> None:
+ """Test case for test_header_integer_boolean_string_enums
- Test header parameter(s) # noqa: E501
+ Test header parameter(s)
"""
pass
diff --git a/samples/client/echo_api/python/test/test_number_properties_only.py b/samples/client/echo_api/python/test/test_number_properties_only.py
index 68aa757f9df9..682503a0cbf7 100644
--- a/samples/client/echo_api/python/test/test_number_properties_only.py
+++ b/samples/client/echo_api/python/test/test_number_properties_only.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
-"""
+""" # noqa: E501
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.number_properties_only import NumberPropertiesOnly # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.number_properties_only import NumberPropertiesOnly
class TestNumberPropertiesOnly(unittest.TestCase):
"""NumberPropertiesOnly unit test stubs"""
@@ -29,21 +26,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> NumberPropertiesOnly:
"""Test NumberPropertiesOnly
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NumberPropertiesOnly`
"""
- model = openapi_client.models.number_properties_only.NumberPropertiesOnly() # noqa: E501
- if include_optional :
+ model = NumberPropertiesOnly()
+ if include_optional:
return NumberPropertiesOnly(
- number = 1.337,
- float = 1.337,
- double = ''
+ number = 1.337,
+ var_float = 1.337,
+ double = 0.8
)
- else :
+ else:
return NumberPropertiesOnly(
)
"""
diff --git a/samples/client/echo_api/python/test/test_path_api.py b/samples/client/echo_api/python/test/test_path_api.py
index 4d8e71f7ce6a..faabe2102426 100644
--- a/samples/client/echo_api/python/test/test_path_api.py
+++ b/samples/client/echo_api/python/test/test_path_api.py
@@ -3,36 +3,34 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.path_api import PathApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.path_api import PathApi
class TestPathApi(unittest.TestCase):
"""PathApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.path_api.PathApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = PathApi()
- def tearDown(self):
+ def tearDown(self) -> None:
pass
- def test_tests_path_string_path_string_integer_path_integer(self):
- """Test case for tests_path_string_path_string_integer_path_integer
+ def test_tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(self) -> None:
+ """Test case for tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path
- Test path parameter(s) # noqa: E501
+ Test path parameter(s)
"""
pass
diff --git a/samples/client/echo_api/python/test/test_pet.py b/samples/client/echo_api/python/test/test_pet.py
index e02d8615bc08..21965554b265 100644
--- a/samples/client/echo_api/python/test/test_pet.py
+++ b/samples/client/echo_api/python/test/test_pet.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.pet import Pet # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.pet import Pet
class TestPet(unittest.TestCase):
"""Pet unit test stubs"""
@@ -29,32 +26,32 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Pet:
"""Test Pet
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pet`
"""
- model = openapi_client.models.pet.Pet() # noqa: E501
- if include_optional :
+ model = Pet()
+ if include_optional:
return Pet(
- id = 10,
- name = 'doggie',
+ id = 10,
+ name = 'doggie',
category = openapi_client.models.category.Category(
id = 1,
- name = 'Dogs', ),
+ name = 'Dogs', ),
photo_urls = [
''
- ],
+ ],
tags = [
openapi_client.models.tag.Tag(
id = 56,
name = '', )
- ],
+ ],
status = 'available'
)
- else :
+ else:
return Pet(
name = 'doggie',
photo_urls = [
diff --git a/samples/client/echo_api/python/test/test_query.py b/samples/client/echo_api/python/test/test_query.py
index a7652e1ae59c..c3d033ef0b51 100644
--- a/samples/client/echo_api/python/test/test_query.py
+++ b/samples/client/echo_api/python/test/test_query.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.query import Query # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.query import Query
class TestQuery(unittest.TestCase):
"""Query unit test stubs"""
@@ -29,22 +26,22 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Query:
"""Test Query
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Query`
"""
- model = openapi_client.models.query.Query() # noqa: E501
- if include_optional :
+ model = Query()
+ if include_optional:
return Query(
- id = 56,
+ id = 56,
outcomes = [
'SUCCESS'
]
)
- else :
+ else:
return Query(
)
"""
diff --git a/samples/client/echo_api/python/test/test_query_api.py b/samples/client/echo_api/python/test/test_query_api.py
index 829a635d99b9..e2e6c2dac461 100644
--- a/samples/client/echo_api/python/test/test_query_api.py
+++ b/samples/client/echo_api/python/test/test_query_api.py
@@ -3,50 +3,97 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import openapi_client
-from openapi_client.api.query_api import QueryApi # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.api.query_api import QueryApi
class TestQueryApi(unittest.TestCase):
"""QueryApi unit test stubs"""
- def setUp(self):
- self.api = openapi_client.api.query_api.QueryApi() # noqa: E501
+ def setUp(self) -> None:
+ self.api = QueryApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_test_enum_ref_string(self) -> None:
+ """Test case for test_enum_ref_string
- def tearDown(self):
+ Test query parameter(s)
+ """
pass
- def test_test_query_integer_boolean_string(self):
+ def test_test_query_datetime_date_string(self) -> None:
+ """Test case for test_query_datetime_date_string
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_integer_boolean_string(self) -> None:
"""Test case for test_query_integer_boolean_string
- Test query parameter(s) # noqa: E501
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_deep_object_explode_true_object(self) -> None:
+ """Test case for test_query_style_deep_object_explode_true_object
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_deep_object_explode_true_object_all_of(self) -> None:
+ """Test case for test_query_style_deep_object_explode_true_object_all_of
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_form_explode_false_array_integer(self) -> None:
+ """Test case for test_query_style_form_explode_false_array_integer
+
+ Test query parameter(s)
"""
pass
- def test_test_query_style_form_explode_true_array_string(self):
+ def test_test_query_style_form_explode_false_array_string(self) -> None:
+ """Test case for test_query_style_form_explode_false_array_string
+
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_form_explode_true_array_string(self) -> None:
"""Test case for test_query_style_form_explode_true_array_string
- Test query parameter(s) # noqa: E501
+ Test query parameter(s)
"""
pass
- def test_test_query_style_form_explode_true_object(self):
+ def test_test_query_style_form_explode_true_object(self) -> None:
"""Test case for test_query_style_form_explode_true_object
- Test query parameter(s) # noqa: E501
+ Test query parameter(s)
+ """
+ pass
+
+ def test_test_query_style_form_explode_true_object_all_of(self) -> None:
+ """Test case for test_query_style_form_explode_true_object_all_of
+
+ Test query parameter(s)
"""
pass
diff --git a/samples/client/echo_api/python/test/test_string_enum_ref.py b/samples/client/echo_api/python/test/test_string_enum_ref.py
index 60a3f0781b18..ece5b369cc22 100644
--- a/samples/client/echo_api/python/test/test_string_enum_ref.py
+++ b/samples/client/echo_api/python/test/test_string_enum_ref.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.string_enum_ref import StringEnumRef # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.string_enum_ref import StringEnumRef
class TestStringEnumRef(unittest.TestCase):
"""StringEnumRef unit test stubs"""
diff --git a/samples/client/echo_api/python/test/test_tag.py b/samples/client/echo_api/python/test/test_tag.py
index 8e48170ab6ae..7e235ac8b95b 100644
--- a/samples/client/echo_api/python/test/test_tag.py
+++ b/samples/client/echo_api/python/test/test_tag.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.tag import Tag # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.tag import Tag
class TestTag(unittest.TestCase):
"""Tag unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> Tag:
"""Test Tag
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Tag`
"""
- model = openapi_client.models.tag.Tag() # noqa: E501
- if include_optional :
+ model = Tag()
+ if include_optional:
return Tag(
- id = 56,
+ id = 56,
name = ''
)
- else :
+ else:
return Tag(
)
"""
diff --git a/samples/client/echo_api/python/test/test_test_form_object_multipart_request_marker.py b/samples/client/echo_api/python/test/test_test_form_object_multipart_request_marker.py
index d49974286060..97f5600a234d 100644
--- a/samples/client/echo_api/python/test/test_test_form_object_multipart_request_marker.py
+++ b/samples/client/echo_api/python/test/test_test_form_object_multipart_request_marker.py
@@ -28,7 +28,7 @@ def tearDown(self):
def make_instance(self, include_optional) -> TestFormObjectMultipartRequestMarker:
"""Test TestFormObjectMultipartRequestMarker
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestFormObjectMultipartRequestMarker`
diff --git a/samples/client/echo_api/python/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
index 395407345615..22731b578cc8 100644
--- a/samples/client/echo_api/python/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
+++ b/samples/client/echo_api/python/test/test_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter unit test stubs"""
@@ -29,22 +26,22 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter:
"""Test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`
"""
- model = openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() # noqa: E501
- if include_optional :
+ model = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter()
+ if include_optional:
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
- size = '',
- color = '',
- id = 1,
+ size = '',
+ color = '',
+ id = 1,
name = 'Dogs'
)
- else :
+ else:
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
)
"""
diff --git a/samples/client/echo_api/python/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py b/samples/client/echo_api/python/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py
deleted file mode 100644
index 2b35c46cb3f6..000000000000
--- a/samples/client/echo_api/python/test/test_test_query_style_form_explode_true_array_integer_query_object_parameter.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# coding: utf-8
-
-"""
- Echo Server API
-
- Echo Server API
-
- The version of the OpenAPI document: 0.1.0
- Contact: team@openapitools.org
- Generated by OpenAPI Generator (https://openapi-generator.tech)
-
- Do not edit the class manually.
-""" # noqa: E501
-
-
-import unittest
-
-from openapi_client.models.test_query_style_form_explode_true_array_integer_query_object_parameter import TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter
-
-class TestTestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(unittest.TestCase):
- """TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter:
- """Test TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter`
- """
- model = TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter()
- if include_optional:
- return TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(
- values = [
- 56
- ]
- )
- else:
- return TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(
- )
- """
-
- def testTestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter(self):
- """Test TestQueryStyleFormExplodeTrueArrayIntegerQueryObjectParameter"""
- # inst_req_only = self.make_instance(include_optional=False)
- # inst_req_and_optional = self.make_instance(include_optional=True)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/samples/client/echo_api/python/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
index 6366b5c23587..2656fbf8e027 100644
--- a/samples/client/echo_api/python/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
+++ b/samples/client/echo_api/python/test/test_test_query_style_form_explode_true_array_string_query_object_parameter.py
@@ -3,22 +3,19 @@
"""
Echo Server API
- Echo Server API # noqa: E501
+ Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+ Do not edit the class manually.
+""" # noqa: E501
-from __future__ import absolute_import
import unittest
-import datetime
-import openapi_client
-from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter # noqa: E501
-from openapi_client.rest import ApiException
+from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter unit test stubs"""
@@ -29,21 +26,21 @@ def setUp(self):
def tearDown(self):
pass
- def make_instance(self, include_optional):
+ def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter:
"""Test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
- include_option is a boolean, when False only required
+ include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`
"""
- model = openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() # noqa: E501
- if include_optional :
+ model = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
+ if include_optional:
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
values = [
''
]
)
- else :
+ else:
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
)
"""
diff --git a/samples/client/echo_api/r/R/api_client.R b/samples/client/echo_api/r/R/api_client.R
index 2f7bcc7a1710..ab9094f67dab 100644
--- a/samples/client/echo_api/r/R/api_client.R
+++ b/samples/client/echo_api/r/R/api_client.R
@@ -72,7 +72,7 @@ ApiClient <- R6::R6Class(
#' @param bearer_token Bearer token.
#' @param timeout Timeout.
#' @param retry_status_codes Status codes for retry.
- #' @param max_retry_attempts Maxmium number of retry.
+ #' @param max_retry_attempts Maximum number of retry.
#' @export
initialize = function(base_path = NULL, user_agent = NULL,
default_headers = NULL,
diff --git a/samples/client/others/c/bearerAuth/CMakeLists.txt b/samples/client/others/c/bearerAuth/CMakeLists.txt
index 2bfcf58899c0..e359d41c7789 100644
--- a/samples/client/others/c/bearerAuth/CMakeLists.txt
+++ b/samples/client/others/c/bearerAuth/CMakeLists.txt
@@ -6,6 +6,7 @@ cmake_policy(SET CMP0063 NEW)
set(CMAKE_C_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+set(CMAKE_C_FLAGS "-Werror=implicit-function-declaration -Werror=missing-declarations -Werror=int-conversion")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
@@ -14,7 +15,7 @@ find_package(OpenSSL)
if (OPENSSL_FOUND)
message (STATUS "OPENSSL found")
- set(CMAKE_C_FLAGS "-DOPENSSL")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL")
if(CMAKE_VERSION VERSION_LESS 3.4)
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${OPENSSL_INCLUDE_DIRS})
diff --git a/samples/client/others/c/bearerAuth/api/DefaultAPI.c b/samples/client/others/c/bearerAuth/api/DefaultAPI.c
index 03c4476fdf86..41f6047cb62f 100644
--- a/samples/client/others/c/bearerAuth/api/DefaultAPI.c
+++ b/samples/client/others/c/bearerAuth/api/DefaultAPI.c
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
// Returns private information.
diff --git a/samples/client/others/c/bearerAuth/src/apiClient.c b/samples/client/others/c/bearerAuth/src/apiClient.c
index 6614016d27ae..b9f52e2e1b7f 100644
--- a/samples/client/others/c/bearerAuth/src/apiClient.c
+++ b/samples/client/others/c/bearerAuth/src/apiClient.c
@@ -89,7 +89,7 @@ void sslConfig_free(sslConfig_t *sslConfig) {
free(sslConfig);
}
-void replaceSpaceWithPlus(char *stringToProcess) {
+static void replaceSpaceWithPlus(char *stringToProcess) {
for(int i = 0; i < strlen(stringToProcess); i++) {
if(stringToProcess[i] == ' ') {
stringToProcess[i] = '+';
@@ -97,9 +97,9 @@ void replaceSpaceWithPlus(char *stringToProcess) {
}
}
-char *assembleTargetUrl(const char *basePath,
- const char *operationParameter,
- list_t *queryParameters) {
+static char *assembleTargetUrl(const char *basePath,
+ const char *operationParameter,
+ list_t *queryParameters) {
int neededBufferSizeForQueryParameters = 0;
listEntry_t *listEntry;
@@ -150,7 +150,7 @@ char *assembleTargetUrl(const char *basePath,
return targetUrl;
}
-char *assembleHeaderField(char *key, char *value) {
+static char *assembleHeaderField(char *key, char *value) {
char *header = malloc(strlen(key) + strlen(value) + 3);
strcpy(header, key),
@@ -160,13 +160,13 @@ char *assembleHeaderField(char *key, char *value) {
return header;
}
-void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
+static void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters);
curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE,
(curl_off_t)bodyParametersLength);
}
-int lengthOfKeyPair(keyValuePair_t *keyPair) {
+static int lengthOfKeyPair(keyValuePair_t *keyPair) {
long length = 0;
if((keyPair->key != NULL) &&
(keyPair->value != NULL) )
diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs
index d5af0aa89c0b..955220dfbae6 100644
--- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs
+++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs
@@ -343,6 +343,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -497,6 +498,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
@@ -511,12 +513,12 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
localVarRequestOptions.FormParameters.Add("status", Org.OpenAPITools.Client.ClientUtils.ParameterToString(status)); // form parameter
if (marker != null)
{
- localVarRequestOptions.FormParameters.Add("marker", Org.OpenAPITools.Client.ClientUtils.Serialize(marker)); // form parameter
+ localVarRequestOptions.FormParameters.Add("marker", localVarMultipartFormData ? Org.OpenAPITools.Client.ClientUtils.ParameterToString(marker) : Org.OpenAPITools.Client.ClientUtils.Serialize(marker)); // form parameter
}
localVarRequestOptions.FileParameters.Add("file", file);
if (statusArray != null)
{
- localVarRequestOptions.FormParameters.Add("statusArray", Org.OpenAPITools.Client.ClientUtils.Serialize(statusArray)); // form parameter
+ localVarRequestOptions.FormParameters.Add("statusArray", localVarMultipartFormData ? Org.OpenAPITools.Client.ClientUtils.ParameterToString(statusArray) : Org.OpenAPITools.Client.ClientUtils.Serialize(statusArray)); // form parameter
}
localVarRequestOptions.Operation = "MultipartApi.MultipartMixed";
@@ -657,6 +659,7 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
+ var localVarMultipartFormData = localVarContentType == "multipart/form-data";
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs
index 91b7422b713e..c8d1224a3477 100644
--- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs
+++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs
@@ -384,6 +384,14 @@ private RestRequest NewRequest(
}
}
+ if (options.HeaderParameters != null)
+ {
+ if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data")))
+ {
+ request.AlwaysMultipartFormData = true;
+ }
+ }
+
return request;
}
diff --git a/samples/client/others/typescript/builds/array-of-lists/package.json b/samples/client/others/typescript/builds/array-of-lists/package.json
index ea853317fbd4..000e9c5844c4 100644
--- a/samples/client/others/typescript/builds/array-of-lists/package.json
+++ b/samples/client/others/typescript/builds/array-of-lists/package.json
@@ -32,11 +32,9 @@
},
"dependencies": {
"whatwg-fetch": "^3.0.0",
- "es6-promise": "^4.2.4",
- "url-parse": "^1.4.3"
+ "es6-promise": "^4.2.4"
},
"devDependencies": {
- "typescript": "^4.0",
- "@types/url-parse": "1.4.4"
+ "typescript": "^4.0"
}
}
diff --git a/samples/client/others/typescript/builds/enum-single-value/package.json b/samples/client/others/typescript/builds/enum-single-value/package.json
index ea853317fbd4..000e9c5844c4 100644
--- a/samples/client/others/typescript/builds/enum-single-value/package.json
+++ b/samples/client/others/typescript/builds/enum-single-value/package.json
@@ -32,11 +32,9 @@
},
"dependencies": {
"whatwg-fetch": "^3.0.0",
- "es6-promise": "^4.2.4",
- "url-parse": "^1.4.3"
+ "es6-promise": "^4.2.4"
},
"devDependencies": {
- "typescript": "^4.0",
- "@types/url-parse": "1.4.4"
+ "typescript": "^4.0"
}
}
diff --git a/samples/client/others/typescript/builds/null-types-simple/package.json b/samples/client/others/typescript/builds/null-types-simple/package.json
index ea853317fbd4..000e9c5844c4 100644
--- a/samples/client/others/typescript/builds/null-types-simple/package.json
+++ b/samples/client/others/typescript/builds/null-types-simple/package.json
@@ -32,11 +32,9 @@
},
"dependencies": {
"whatwg-fetch": "^3.0.0",
- "es6-promise": "^4.2.4",
- "url-parse": "^1.4.3"
+ "es6-promise": "^4.2.4"
},
"devDependencies": {
- "typescript": "^4.0",
- "@types/url-parse": "1.4.4"
+ "typescript": "^4.0"
}
}
diff --git a/samples/client/others/typescript/builds/with-unique-items/package.json b/samples/client/others/typescript/builds/with-unique-items/package.json
index ea853317fbd4..000e9c5844c4 100644
--- a/samples/client/others/typescript/builds/with-unique-items/package.json
+++ b/samples/client/others/typescript/builds/with-unique-items/package.json
@@ -32,11 +32,9 @@
},
"dependencies": {
"whatwg-fetch": "^3.0.0",
- "es6-promise": "^4.2.4",
- "url-parse": "^1.4.3"
+ "es6-promise": "^4.2.4"
},
"devDependencies": {
- "typescript": "^4.0",
- "@types/url-parse": "1.4.4"
+ "typescript": "^4.0"
}
}
diff --git a/samples/client/others/typescript/encode-decode/build/package.json b/samples/client/others/typescript/encode-decode/build/package.json
index 98e27af43f34..f7db8ae6bd7a 100644
--- a/samples/client/others/typescript/encode-decode/build/package.json
+++ b/samples/client/others/typescript/encode-decode/build/package.json
@@ -35,11 +35,9 @@
"@types/node-fetch": "^2.5.7",
"@types/node": "*",
"form-data": "^2.5.0",
- "es6-promise": "^4.2.4",
- "url-parse": "^1.4.3"
+ "es6-promise": "^4.2.4"
},
"devDependencies": {
- "typescript": "^4.0",
- "@types/url-parse": "1.4.4"
+ "typescript": "^4.0"
}
}
diff --git a/samples/client/petstore/R-httr2-wrapper/R/api_client.R b/samples/client/petstore/R-httr2-wrapper/R/api_client.R
index 9c5bba767310..f89465e25bbc 100644
--- a/samples/client/petstore/R-httr2-wrapper/R/api_client.R
+++ b/samples/client/petstore/R-httr2-wrapper/R/api_client.R
@@ -32,7 +32,7 @@
#' @field oauth_secret OAuth secret
#' @field oauth_refresh_token OAuth refresh token
#' @field oauth_flow_type OAuth flow type
-#' @field oauth_authorization_url Authoriziation URL
+#' @field oauth_authorization_url Authorization URL
#' @field oauth_token_url Token URL
#' @field oauth_pkce Boolean flag to enable PKCE
#' @field oauth_scopes OAuth scopes
@@ -68,7 +68,7 @@ ApiClient <- R6::R6Class(
# OAuth2
# Flow type
oauth_flow_type = "implicit",
- # Authoriziation URL
+ # Authorization URL
oauth_authorization_url = "http://petstore.swagger.io/api/oauth/dialog",
# Token URL
oauth_token_url = "",
@@ -99,7 +99,7 @@ ApiClient <- R6::R6Class(
#' @param bearer_token Bearer token.
#' @param timeout Timeout.
#' @param retry_status_codes Status codes for retry.
- #' @param max_retry_attempts Maxmium number of retry.
+ #' @param max_retry_attempts Maximum number of retry.
#' @export
initialize = function(base_path = NULL, user_agent = NULL,
default_headers = NULL,
@@ -296,7 +296,7 @@ ApiClient <- R6::R6Class(
req <- req %>% req_oauth_auth_code(client, scope = req_oauth_scopes,
pkce = self$oauth_pkce,
- auth_url = self$oauth_authoriziation_url)
+ auth_url = self$oauth_authorization_url)
}
# stream data
diff --git a/samples/client/petstore/R-httr2/R/api_client.R b/samples/client/petstore/R-httr2/R/api_client.R
index 9c5bba767310..f89465e25bbc 100644
--- a/samples/client/petstore/R-httr2/R/api_client.R
+++ b/samples/client/petstore/R-httr2/R/api_client.R
@@ -32,7 +32,7 @@
#' @field oauth_secret OAuth secret
#' @field oauth_refresh_token OAuth refresh token
#' @field oauth_flow_type OAuth flow type
-#' @field oauth_authorization_url Authoriziation URL
+#' @field oauth_authorization_url Authorization URL
#' @field oauth_token_url Token URL
#' @field oauth_pkce Boolean flag to enable PKCE
#' @field oauth_scopes OAuth scopes
@@ -68,7 +68,7 @@ ApiClient <- R6::R6Class(
# OAuth2
# Flow type
oauth_flow_type = "implicit",
- # Authoriziation URL
+ # Authorization URL
oauth_authorization_url = "http://petstore.swagger.io/api/oauth/dialog",
# Token URL
oauth_token_url = "",
@@ -99,7 +99,7 @@ ApiClient <- R6::R6Class(
#' @param bearer_token Bearer token.
#' @param timeout Timeout.
#' @param retry_status_codes Status codes for retry.
- #' @param max_retry_attempts Maxmium number of retry.
+ #' @param max_retry_attempts Maximum number of retry.
#' @export
initialize = function(base_path = NULL, user_agent = NULL,
default_headers = NULL,
@@ -296,7 +296,7 @@ ApiClient <- R6::R6Class(
req <- req %>% req_oauth_auth_code(client, scope = req_oauth_scopes,
pkce = self$oauth_pkce,
- auth_url = self$oauth_authoriziation_url)
+ auth_url = self$oauth_authorization_url)
}
# stream data
diff --git a/samples/client/petstore/R/R/api_client.R b/samples/client/petstore/R/R/api_client.R
index 638216216e37..c9e67c317410 100644
--- a/samples/client/petstore/R/R/api_client.R
+++ b/samples/client/petstore/R/R/api_client.R
@@ -32,7 +32,7 @@
#' @field oauth_secret OAuth secret
#' @field oauth_refresh_token OAuth refresh token
#' @field oauth_flow_type OAuth flow type
-#' @field oauth_authorization_url Authoriziation URL
+#' @field oauth_authorization_url Authorization URL
#' @field oauth_token_url Token URL
#' @field oauth_pkce Boolean flag to enable PKCE
#' @field bearer_token Bearer token
@@ -68,7 +68,7 @@ ApiClient <- R6::R6Class(
# OAuth2
# Flow type
oauth_flow_type = "implicit",
- # Authoriziation URL
+ # Authorization URL
oauth_authorization_url = "http://petstore.swagger.io/api/oauth/dialog",
# Token URL
oauth_token_url = "",
@@ -97,7 +97,7 @@ ApiClient <- R6::R6Class(
#' @param bearer_token Bearer token.
#' @param timeout Timeout.
#' @param retry_status_codes Status codes for retry.
- #' @param max_retry_attempts Maxmium number of retry.
+ #' @param max_retry_attempts Maximum number of retry.
#' @export
initialize = function(base_path = NULL, user_agent = NULL,
default_headers = NULL,
diff --git a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt
index c97fd637cdb9..cd72ab391660 100644
--- a/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt
+++ b/samples/client/petstore/c-useJsonUnformatted/CMakeLists.txt
@@ -6,6 +6,7 @@ cmake_policy(SET CMP0063 NEW)
set(CMAKE_C_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+set(CMAKE_C_FLAGS "-Werror=implicit-function-declaration -Werror=missing-declarations -Werror=int-conversion")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
@@ -14,7 +15,7 @@ find_package(OpenSSL)
if (OPENSSL_FOUND)
message (STATUS "OPENSSL found")
- set(CMAKE_C_FLAGS "-DOPENSSL")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL")
if(CMAKE_VERSION VERSION_LESS 3.4)
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${OPENSSL_INCLUDE_DIRS})
diff --git a/samples/client/petstore/c-useJsonUnformatted/README.md b/samples/client/petstore/c-useJsonUnformatted/README.md
index 239e0f4c8ff4..a7cf2d3100af 100644
--- a/samples/client/petstore/c-useJsonUnformatted/README.md
+++ b/samples/client/petstore/c-useJsonUnformatted/README.md
@@ -84,6 +84,7 @@ Category | Method | HTTP request | Description
*StoreAPI* | [**StoreAPI_placeOrder**](docs/StoreAPI.md#StoreAPI_placeOrder) | **POST** /store/order | Place an order for a pet
*StoreAPI* | [**StoreAPI_sendFeedback**](docs/StoreAPI.md#StoreAPI_sendFeedback) | **POST** /store/feedback | Send us a feedback message
*StoreAPI* | [**StoreAPI_sendRating**](docs/StoreAPI.md#StoreAPI_sendRating) | **POST** /store/rating/{rating} | How would you rate our service?
+*StoreAPI* | [**StoreAPI_sendRecommend**](docs/StoreAPI.md#StoreAPI_sendRecommend) | **POST** /store/recommend | Would you recommend our service to a friend?
*UserAPI* | [**UserAPI_createUser**](docs/UserAPI.md#UserAPI_createUser) | **POST** /user | Create user
*UserAPI* | [**UserAPI_createUsersWithArrayInput**](docs/UserAPI.md#UserAPI_createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserAPI* | [**UserAPI_createUsersWithListInput**](docs/UserAPI.md#UserAPI_createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
diff --git a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c
index 9380afee89c9..c0ac1aa49d3b 100644
--- a/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c
+++ b/samples/client/petstore/c-useJsonUnformatted/api/PetAPI.c
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
// Functions for enum STATUS for PetAPI_findPetsByStatus
@@ -159,7 +154,7 @@ PetAPI_deletePet(apiClient_t *apiClient, long petId, char *api_key)
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -501,7 +496,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId)
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -658,7 +653,7 @@ PetAPI_isPetAvailable(apiClient_t *apiClient, long petId)
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -965,7 +960,7 @@ PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char *name, char *s
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -1078,7 +1073,7 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId, char *additionalMetadata,
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
diff --git a/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.c b/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.c
index 11b7d9b4224a..2e13582de3bd 100644
--- a/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.c
+++ b/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.c
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
// Functions for enum RATING for StoreAPI_sendRating
@@ -245,7 +240,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId)
snprintf(localVarToReplace_orderId, sizeOfPathParams_orderId, "{%s}", "orderId");
char localVarBuff_orderId[256];
- intToStr(localVarBuff_orderId, orderId);
+ snprintf(localVarBuff_orderId, sizeof localVarBuff_orderId, "%ld", orderId);
localVarPath = strReplace(localVarPath, localVarToReplace_orderId, localVarBuff_orderId);
@@ -541,3 +536,85 @@ StoreAPI_sendRating(apiClient_t *apiClient, openapi_petstore_sendRating_rating_e
}
+// Would you recommend our service to a friend?
+//
+char*
+StoreAPI_sendRecommend(apiClient_t *apiClient, int *recommend)
+{
+ list_t *localVarQueryParameters = NULL;
+ list_t *localVarHeaderParameters = NULL;
+ list_t *localVarFormParameters = list_createList();
+ list_t *localVarHeaderType = list_createList();
+ list_t *localVarContentType = list_createList();
+ char *localVarBodyParameters = NULL;
+ size_t localVarBodyLength = 0;
+
+ // clear the error code from the previous api call
+ apiClient->response_code = 0;
+
+ // create the path
+ long sizeOfPath = strlen("/store/recommend")+1;
+ char *localVarPath = malloc(sizeOfPath);
+ snprintf(localVarPath, sizeOfPath, "/store/recommend");
+
+
+
+
+
+ // form parameters
+ char *keyForm_recommend = NULL;
+ char * valueForm_recommend = 0;
+ keyValuePair_t *keyPairForm_recommend = 0;
+ if (recommend != NULL)
+ {
+ keyForm_recommend = strdup("recommend");
+ valueForm_recommend = calloc(1,MAX_NUMBER_LENGTH);
+ snprintf(valueForm_recommend, MAX_NUMBER_LENGTH, "%d", *recommend);
+ keyPairForm_recommend = keyValuePair_create(keyForm_recommend,valueForm_recommend);
+ list_addElement(localVarFormParameters,keyPairForm_recommend);
+ }
+ list_addElement(localVarHeaderType,"*/*"); //produces
+ list_addElement(localVarContentType,"multipart/form-data"); //consumes
+ apiClient_invoke(apiClient,
+ localVarPath,
+ localVarQueryParameters,
+ localVarHeaderParameters,
+ localVarFormParameters,
+ localVarHeaderType,
+ localVarContentType,
+ localVarBodyParameters,
+ localVarBodyLength,
+ "POST");
+
+ // uncomment below to debug the error response
+ //if (apiClient->response_code == 200) {
+ // printf("%s\n","successful operation");
+ //}
+ //primitive return type simple string
+ char* elementToReturn = NULL;
+ if(apiClient->response_code >= 200 && apiClient->response_code < 300)
+ elementToReturn = strdup((char*)apiClient->dataReceived);
+
+ if (apiClient->dataReceived) {
+ free(apiClient->dataReceived);
+ apiClient->dataReceived = NULL;
+ apiClient->dataReceivedLen = 0;
+ }
+
+
+ list_freeList(localVarFormParameters);
+ list_freeList(localVarHeaderType);
+ list_freeList(localVarContentType);
+ free(localVarPath);
+ if (keyForm_recommend) {
+ free(keyForm_recommend);
+ keyForm_recommend = NULL;
+ }
+ free(keyPairForm_recommend);
+ return elementToReturn;
+end:
+ free(localVarPath);
+ return NULL;
+
+}
+
diff --git a/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.h b/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.h
index 1608e2b27d66..693d21b7dd64 100644
--- a/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.h
+++ b/samples/client/petstore/c-useJsonUnformatted/api/StoreAPI.h
@@ -53,3 +53,9 @@ char*
StoreAPI_sendRating(apiClient_t *apiClient, openapi_petstore_sendRating_rating_e rating);
+// Would you recommend our service to a friend?
+//
+char*
+StoreAPI_sendRecommend(apiClient_t *apiClient, int *recommend);
+
+
diff --git a/samples/client/petstore/c-useJsonUnformatted/api/UserAPI.c b/samples/client/petstore/c-useJsonUnformatted/api/UserAPI.c
index d629b614342a..d5af0312d650 100644
--- a/samples/client/petstore/c-useJsonUnformatted/api/UserAPI.c
+++ b/samples/client/petstore/c-useJsonUnformatted/api/UserAPI.c
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
// Create user
diff --git a/samples/client/petstore/c-useJsonUnformatted/docs/StoreAPI.md b/samples/client/petstore/c-useJsonUnformatted/docs/StoreAPI.md
index 11fab3fe58ad..8705a994803a 100644
--- a/samples/client/petstore/c-useJsonUnformatted/docs/StoreAPI.md
+++ b/samples/client/petstore/c-useJsonUnformatted/docs/StoreAPI.md
@@ -10,6 +10,7 @@ Method | HTTP request | Description
[**StoreAPI_placeOrder**](StoreAPI.md#StoreAPI_placeOrder) | **POST** /store/order | Place an order for a pet
[**StoreAPI_sendFeedback**](StoreAPI.md#StoreAPI_sendFeedback) | **POST** /store/feedback | Send us a feedback message
[**StoreAPI_sendRating**](StoreAPI.md#StoreAPI_sendRating) | **POST** /store/rating/{rating} | How would you rate our service?
+[**StoreAPI_sendRecommend**](StoreAPI.md#StoreAPI_sendRecommend) | **POST** /store/recommend | Would you recommend our service to a friend?
# **StoreAPI_deleteOrder**
@@ -195,3 +196,33 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+# **StoreAPI_sendRecommend**
+```c
+// Would you recommend our service to a friend?
+//
+char* StoreAPI_sendRecommend(apiClient_t *apiClient, int *recommend);
+```
+
+### Parameters
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+**apiClient** | **apiClient_t \*** | context containing the client configuration |
+**recommend** | **int \*** | Would you recommend us or not? | [optional]
+
+### Return type
+
+char*
+
+
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: */*
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/api_response.c b/samples/client/petstore/c-useJsonUnformatted/model/api_response.c
index ccae1f010102..d0169c84f5b2 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/api_response.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/api_response.c
@@ -5,7 +5,7 @@
-api_response_t *api_response_create(
+static api_response_t *api_response_create_internal(
int code,
char *type,
char *message
@@ -18,14 +18,30 @@ api_response_t *api_response_create(
api_response_local_var->type = type;
api_response_local_var->message = message;
+ api_response_local_var->_library_owned = 1;
return api_response_local_var;
}
+__attribute__((deprecated)) api_response_t *api_response_create(
+ int code,
+ char *type,
+ char *message
+ ) {
+ return api_response_create_internal (
+ code,
+ type,
+ message
+ );
+}
void api_response_free(api_response_t *api_response) {
if(NULL == api_response){
return ;
}
+ if(api_response->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "api_response_free");
+ return ;
+ }
listEntry_t *listEntry;
if (api_response->type) {
free(api_response->type);
@@ -113,7 +129,7 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){
}
- api_response_local_var = api_response_create (
+ api_response_local_var = api_response_create_internal (
code ? code->valuedouble : 0,
type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL,
message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/api_response.h b/samples/client/petstore/c-useJsonUnformatted/model/api_response.h
index d64dcbacedd9..3d9eb71ff5d5 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/api_response.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/api_response.h
@@ -23,9 +23,10 @@ typedef struct api_response_t {
char *type; // string
char *message; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} api_response_t;
-api_response_t *api_response_create(
+__attribute__((deprecated)) api_response_t *api_response_create(
int code,
char *type,
char *message
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/category.c b/samples/client/petstore/c-useJsonUnformatted/model/category.c
index a1ea1a5d5cee..2b060a568015 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/category.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/category.c
@@ -5,7 +5,7 @@
-category_t *category_create(
+static category_t *category_create_internal(
long id,
char *name
) {
@@ -16,14 +16,28 @@ category_t *category_create(
category_local_var->id = id;
category_local_var->name = name;
+ category_local_var->_library_owned = 1;
return category_local_var;
}
+__attribute__((deprecated)) category_t *category_create(
+ long id,
+ char *name
+ ) {
+ return category_create_internal (
+ id,
+ name
+ );
+}
void category_free(category_t *category) {
if(NULL == category){
return ;
}
+ if(category->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "category_free");
+ return ;
+ }
listEntry_t *listEntry;
if (category->name) {
free(category->name);
@@ -87,7 +101,7 @@ category_t *category_parseFromJSON(cJSON *categoryJSON){
}
- category_local_var = category_create (
+ category_local_var = category_create_internal (
id ? id->valuedouble : 0,
name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/category.h b/samples/client/petstore/c-useJsonUnformatted/model/category.h
index ec9efd6ccf60..bd27e27e35a3 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/category.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/category.h
@@ -22,9 +22,10 @@ typedef struct category_t {
long id; //numeric
char *name; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} category_t;
-category_t *category_create(
+__attribute__((deprecated)) category_t *category_create(
long id,
char *name
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c b/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c
index 7423e32eb338..3ab1e861c326 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.c
@@ -5,7 +5,7 @@
-MappedModel_t *MappedModel_create(
+static MappedModel_t *MappedModel_create_internal(
int another_property,
char *uuid_property
) {
@@ -16,14 +16,28 @@ MappedModel_t *MappedModel_create(
MappedModel_local_var->another_property = another_property;
MappedModel_local_var->uuid_property = uuid_property;
+ MappedModel_local_var->_library_owned = 1;
return MappedModel_local_var;
}
+__attribute__((deprecated)) MappedModel_t *MappedModel_create(
+ int another_property,
+ char *uuid_property
+ ) {
+ return MappedModel_create_internal (
+ another_property,
+ uuid_property
+ );
+}
void MappedModel_free(MappedModel_t *MappedModel) {
if(NULL == MappedModel){
return ;
}
+ if(MappedModel->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "MappedModel_free");
+ return ;
+ }
listEntry_t *listEntry;
if (MappedModel->uuid_property) {
free(MappedModel->uuid_property);
@@ -87,7 +101,7 @@ MappedModel_t *MappedModel_parseFromJSON(cJSON *MappedModelJSON){
}
- MappedModel_local_var = MappedModel_create (
+ MappedModel_local_var = MappedModel_create_internal (
another_property ? another_property->valuedouble : 0,
uuid_property && !cJSON_IsNull(uuid_property) ? strdup(uuid_property->valuestring) : NULL
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.h b/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.h
index 83b1d4581ba6..b962632d647d 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/mapped_model.h
@@ -22,9 +22,10 @@ typedef struct MappedModel_t {
int another_property; //numeric
char *uuid_property; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} MappedModel_t;
-MappedModel_t *MappedModel_create(
+__attribute__((deprecated)) MappedModel_t *MappedModel_create(
int another_property,
char *uuid_property
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c b/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c
index d29660fccfcd..0791d68f48a5 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.c
@@ -5,7 +5,7 @@
-model_with_set_propertes_t *model_with_set_propertes_create(
+static model_with_set_propertes_t *model_with_set_propertes_create_internal(
list_t *tag_set,
list_t *string_set
) {
@@ -16,14 +16,28 @@ model_with_set_propertes_t *model_with_set_propertes_create(
model_with_set_propertes_local_var->tag_set = tag_set;
model_with_set_propertes_local_var->string_set = string_set;
+ model_with_set_propertes_local_var->_library_owned = 1;
return model_with_set_propertes_local_var;
}
+__attribute__((deprecated)) model_with_set_propertes_t *model_with_set_propertes_create(
+ list_t *tag_set,
+ list_t *string_set
+ ) {
+ return model_with_set_propertes_create_internal (
+ tag_set,
+ string_set
+ );
+}
void model_with_set_propertes_free(model_with_set_propertes_t *model_with_set_propertes) {
if(NULL == model_with_set_propertes){
return ;
}
+ if(model_with_set_propertes->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "model_with_set_propertes_free");
+ return ;
+ }
listEntry_t *listEntry;
if (model_with_set_propertes->tag_set) {
list_ForEach(listEntry, model_with_set_propertes->tag_set) {
@@ -146,7 +160,7 @@ model_with_set_propertes_t *model_with_set_propertes_parseFromJSON(cJSON *model_
}
- model_with_set_propertes_local_var = model_with_set_propertes_create (
+ model_with_set_propertes_local_var = model_with_set_propertes_create_internal (
tag_set ? tag_setList : NULL,
string_set ? string_setList : NULL
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.h b/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.h
index 537271638b99..aa82893b94bb 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/model_with_set_propertes.h
@@ -23,9 +23,10 @@ typedef struct model_with_set_propertes_t {
list_t *tag_set; //nonprimitive container
list_t *string_set; //primitive container
+ int _library_owned; // Is the library responsible for freeing this object?
} model_with_set_propertes_t;
-model_with_set_propertes_t *model_with_set_propertes_create(
+__attribute__((deprecated)) model_with_set_propertes_t *model_with_set_propertes_create(
list_t *tag_set,
list_t *string_set
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/order.c b/samples/client/petstore/c-useJsonUnformatted/model/order.c
index bbbc50e1a316..d67d1d47c714 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/order.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/order.c
@@ -22,7 +22,7 @@ openapi_petstore_order_STATUS_e order_status_FromString(char* status){
return 0;
}
-order_t *order_create(
+static order_t *order_create_internal(
long id,
long pet_id,
int quantity,
@@ -41,14 +41,36 @@ order_t *order_create(
order_local_var->status = status;
order_local_var->complete = complete;
+ order_local_var->_library_owned = 1;
return order_local_var;
}
+__attribute__((deprecated)) order_t *order_create(
+ long id,
+ long pet_id,
+ int quantity,
+ char *ship_date,
+ openapi_petstore_order_STATUS_e status,
+ int complete
+ ) {
+ return order_create_internal (
+ id,
+ pet_id,
+ quantity,
+ ship_date,
+ status,
+ complete
+ );
+}
void order_free(order_t *order) {
if(NULL == order){
return ;
}
+ if(order->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "order_free");
+ return ;
+ }
listEntry_t *listEntry;
if (order->ship_date) {
free(order->ship_date);
@@ -94,7 +116,7 @@ cJSON *order_convertToJSON(order_t *order) {
// order->status
if(order->status != openapi_petstore_order_STATUS_NULL) {
- if(cJSON_AddStringToObject(item, "status", statusorder_ToString(order->status)) == NULL)
+ if(cJSON_AddStringToObject(item, "status", order_status_ToString(order->status)) == NULL)
{
goto fail; //Enum
}
@@ -195,7 +217,7 @@ order_t *order_parseFromJSON(cJSON *orderJSON){
}
- order_local_var = order_create (
+ order_local_var = order_create_internal (
id ? id->valuedouble : 0,
pet_id ? pet_id->valuedouble : 0,
quantity ? quantity->valuedouble : 0,
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/order.h b/samples/client/petstore/c-useJsonUnformatted/model/order.h
index 32914a227499..1b0a47b3028e 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/order.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/order.h
@@ -34,9 +34,10 @@ typedef struct order_t {
openapi_petstore_order_STATUS_e status; //enum
int complete; //boolean
+ int _library_owned; // Is the library responsible for freeing this object?
} order_t;
-order_t *order_create(
+__attribute__((deprecated)) order_t *order_create(
long id,
long pet_id,
int quantity,
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/pet.c b/samples/client/petstore/c-useJsonUnformatted/model/pet.c
index d95d672eda00..1393cc4275a6 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/pet.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/pet.c
@@ -22,7 +22,7 @@ openapi_petstore_pet_STATUS_e pet_status_FromString(char* status){
return 0;
}
-pet_t *pet_create(
+static pet_t *pet_create_internal(
long id,
category_t *category,
char *name,
@@ -41,14 +41,36 @@ pet_t *pet_create(
pet_local_var->tags = tags;
pet_local_var->status = status;
+ pet_local_var->_library_owned = 1;
return pet_local_var;
}
+__attribute__((deprecated)) pet_t *pet_create(
+ long id,
+ category_t *category,
+ char *name,
+ list_t *photo_urls,
+ list_t *tags,
+ openapi_petstore_pet_STATUS_e status
+ ) {
+ return pet_create_internal (
+ id,
+ category,
+ name,
+ photo_urls,
+ tags,
+ status
+ );
+}
void pet_free(pet_t *pet) {
if(NULL == pet){
return ;
}
+ if(pet->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "pet_free");
+ return ;
+ }
listEntry_t *listEntry;
if (pet->category) {
category_free(pet->category);
@@ -148,7 +170,7 @@ cJSON *pet_convertToJSON(pet_t *pet) {
// pet->status
if(pet->status != openapi_petstore_pet_STATUS_NULL) {
- if(cJSON_AddStringToObject(item, "status", statuspet_ToString(pet->status)) == NULL)
+ if(cJSON_AddStringToObject(item, "status", pet_status_ToString(pet->status)) == NULL)
{
goto fail; //Enum
}
@@ -275,7 +297,7 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){
}
- pet_local_var = pet_create (
+ pet_local_var = pet_create_internal (
id ? id->valuedouble : 0,
category ? category_local_nonprim : NULL,
strdup(name->valuestring),
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/pet.h b/samples/client/petstore/c-useJsonUnformatted/model/pet.h
index d74025510143..860197e63a53 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/pet.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/pet.h
@@ -36,9 +36,10 @@ typedef struct pet_t {
list_t *tags; //nonprimitive container
openapi_petstore_pet_STATUS_e status; //enum
+ int _library_owned; // Is the library responsible for freeing this object?
} pet_t;
-pet_t *pet_create(
+__attribute__((deprecated)) pet_t *pet_create(
long id,
category_t *category,
char *name,
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/tag.c b/samples/client/petstore/c-useJsonUnformatted/model/tag.c
index f79d34ef9acd..e4b4f94af53d 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/tag.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/tag.c
@@ -5,7 +5,7 @@
-tag_t *tag_create(
+static tag_t *tag_create_internal(
long id,
char *name
) {
@@ -16,14 +16,28 @@ tag_t *tag_create(
tag_local_var->id = id;
tag_local_var->name = name;
+ tag_local_var->_library_owned = 1;
return tag_local_var;
}
+__attribute__((deprecated)) tag_t *tag_create(
+ long id,
+ char *name
+ ) {
+ return tag_create_internal (
+ id,
+ name
+ );
+}
void tag_free(tag_t *tag) {
if(NULL == tag){
return ;
}
+ if(tag->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "tag_free");
+ return ;
+ }
listEntry_t *listEntry;
if (tag->name) {
free(tag->name);
@@ -87,7 +101,7 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON){
}
- tag_local_var = tag_create (
+ tag_local_var = tag_create_internal (
id ? id->valuedouble : 0,
name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/tag.h b/samples/client/petstore/c-useJsonUnformatted/model/tag.h
index 9e7b5d053a9d..d4b29e4d2e04 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/tag.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/tag.h
@@ -22,9 +22,10 @@ typedef struct tag_t {
long id; //numeric
char *name; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} tag_t;
-tag_t *tag_create(
+__attribute__((deprecated)) tag_t *tag_create(
long id,
char *name
);
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/user.c b/samples/client/petstore/c-useJsonUnformatted/model/user.c
index 111bafdc02ad..ce31e6ad17df 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/user.c
+++ b/samples/client/petstore/c-useJsonUnformatted/model/user.c
@@ -5,7 +5,7 @@
-user_t *user_create(
+static user_t *user_create_internal(
long id,
char *username,
char *first_name,
@@ -32,14 +32,44 @@ user_t *user_create(
user_local_var->extra = extra;
user_local_var->preference = preference;
+ user_local_var->_library_owned = 1;
return user_local_var;
}
+__attribute__((deprecated)) user_t *user_create(
+ long id,
+ char *username,
+ char *first_name,
+ char *last_name,
+ char *email,
+ char *password,
+ char *phone,
+ int user_status,
+ list_t* extra,
+ openapi_petstore_preference__e preference
+ ) {
+ return user_create_internal (
+ id,
+ username,
+ first_name,
+ last_name,
+ email,
+ password,
+ phone,
+ user_status,
+ extra,
+ preference
+ );
+}
void user_free(user_t *user) {
if(NULL == user){
return ;
}
+ if(user->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "user_free");
+ return ;
+ }
listEntry_t *listEntry;
if (user->username) {
free(user->username);
@@ -320,7 +350,7 @@ user_t *user_parseFromJSON(cJSON *userJSON){
}
- user_local_var = user_create (
+ user_local_var = user_create_internal (
id ? id->valuedouble : 0,
username && !cJSON_IsNull(username) ? strdup(username->valuestring) : NULL,
first_name && !cJSON_IsNull(first_name) ? strdup(first_name->valuestring) : NULL,
diff --git a/samples/client/petstore/c-useJsonUnformatted/model/user.h b/samples/client/petstore/c-useJsonUnformatted/model/user.h
index badbc747b308..4643e020a5fe 100644
--- a/samples/client/petstore/c-useJsonUnformatted/model/user.h
+++ b/samples/client/petstore/c-useJsonUnformatted/model/user.h
@@ -32,9 +32,10 @@ typedef struct user_t {
list_t* extra; //map
openapi_petstore_preference__e preference; //referenced enum
+ int _library_owned; // Is the library responsible for freeing this object?
} user_t;
-user_t *user_create(
+__attribute__((deprecated)) user_t *user_create(
long id,
char *username,
char *first_name,
diff --git a/samples/client/petstore/c-useJsonUnformatted/src/apiClient.c b/samples/client/petstore/c-useJsonUnformatted/src/apiClient.c
index 302cb8bff342..ad06a341a4bb 100644
--- a/samples/client/petstore/c-useJsonUnformatted/src/apiClient.c
+++ b/samples/client/petstore/c-useJsonUnformatted/src/apiClient.c
@@ -116,7 +116,7 @@ void sslConfig_free(sslConfig_t *sslConfig) {
free(sslConfig);
}
-void replaceSpaceWithPlus(char *stringToProcess) {
+static void replaceSpaceWithPlus(char *stringToProcess) {
for(int i = 0; i < strlen(stringToProcess); i++) {
if(stringToProcess[i] == ' ') {
stringToProcess[i] = '+';
@@ -124,9 +124,9 @@ void replaceSpaceWithPlus(char *stringToProcess) {
}
}
-char *assembleTargetUrl(const char *basePath,
- const char *operationParameter,
- list_t *queryParameters) {
+static char *assembleTargetUrl(const char *basePath,
+ const char *operationParameter,
+ list_t *queryParameters) {
int neededBufferSizeForQueryParameters = 0;
listEntry_t *listEntry;
@@ -177,7 +177,7 @@ char *assembleTargetUrl(const char *basePath,
return targetUrl;
}
-char *assembleHeaderField(char *key, char *value) {
+static char *assembleHeaderField(char *key, char *value) {
char *header = malloc(strlen(key) + strlen(value) + 3);
strcpy(header, key),
@@ -187,13 +187,13 @@ char *assembleHeaderField(char *key, char *value) {
return header;
}
-void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
+static void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters);
curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE,
(curl_off_t)bodyParametersLength);
}
-int lengthOfKeyPair(keyValuePair_t *keyPair) {
+static int lengthOfKeyPair(keyValuePair_t *keyPair) {
long length = 0;
if((keyPair->key != NULL) &&
(keyPair->value != NULL) )
diff --git a/samples/client/petstore/c/README.md b/samples/client/petstore/c/README.md
index 239e0f4c8ff4..a7cf2d3100af 100644
--- a/samples/client/petstore/c/README.md
+++ b/samples/client/petstore/c/README.md
@@ -84,6 +84,7 @@ Category | Method | HTTP request | Description
*StoreAPI* | [**StoreAPI_placeOrder**](docs/StoreAPI.md#StoreAPI_placeOrder) | **POST** /store/order | Place an order for a pet
*StoreAPI* | [**StoreAPI_sendFeedback**](docs/StoreAPI.md#StoreAPI_sendFeedback) | **POST** /store/feedback | Send us a feedback message
*StoreAPI* | [**StoreAPI_sendRating**](docs/StoreAPI.md#StoreAPI_sendRating) | **POST** /store/rating/{rating} | How would you rate our service?
+*StoreAPI* | [**StoreAPI_sendRecommend**](docs/StoreAPI.md#StoreAPI_sendRecommend) | **POST** /store/recommend | Would you recommend our service to a friend?
*UserAPI* | [**UserAPI_createUser**](docs/UserAPI.md#UserAPI_createUser) | **POST** /user | Create user
*UserAPI* | [**UserAPI_createUsersWithArrayInput**](docs/UserAPI.md#UserAPI_createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserAPI* | [**UserAPI_createUsersWithListInput**](docs/UserAPI.md#UserAPI_createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c
index 16bb7fddcab1..90e5c5312f69 100644
--- a/samples/client/petstore/c/api/PetAPI.c
+++ b/samples/client/petstore/c/api/PetAPI.c
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
// Functions for enum STATUS for PetAPI_findPetsByStatus
@@ -159,7 +154,7 @@ PetAPI_deletePet(apiClient_t *apiClient, long petId, char *api_key)
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -501,7 +496,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId)
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -658,7 +653,7 @@ PetAPI_isPetAvailable(apiClient_t *apiClient, long petId)
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -965,7 +960,7 @@ PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char *name, char *s
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
@@ -1078,7 +1073,7 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId, char *additionalMetadata,
snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId");
char localVarBuff_petId[256];
- intToStr(localVarBuff_petId, petId);
+ snprintf(localVarBuff_petId, sizeof localVarBuff_petId, "%ld", petId);
localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId);
diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c
index 6da10d3e0807..843c6bfc47e2 100644
--- a/samples/client/petstore/c/api/StoreAPI.c
+++ b/samples/client/petstore/c/api/StoreAPI.c
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
// Functions for enum RATING for StoreAPI_sendRating
@@ -245,7 +240,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId)
snprintf(localVarToReplace_orderId, sizeOfPathParams_orderId, "{%s}", "orderId");
char localVarBuff_orderId[256];
- intToStr(localVarBuff_orderId, orderId);
+ snprintf(localVarBuff_orderId, sizeof localVarBuff_orderId, "%ld", orderId);
localVarPath = strReplace(localVarPath, localVarToReplace_orderId, localVarBuff_orderId);
@@ -541,3 +536,85 @@ StoreAPI_sendRating(apiClient_t *apiClient, openapi_petstore_sendRating_rating_e
}
+// Would you recommend our service to a friend?
+//
+char*
+StoreAPI_sendRecommend(apiClient_t *apiClient, int *recommend)
+{
+ list_t *localVarQueryParameters = NULL;
+ list_t *localVarHeaderParameters = NULL;
+ list_t *localVarFormParameters = list_createList();
+ list_t *localVarHeaderType = list_createList();
+ list_t *localVarContentType = list_createList();
+ char *localVarBodyParameters = NULL;
+ size_t localVarBodyLength = 0;
+
+ // clear the error code from the previous api call
+ apiClient->response_code = 0;
+
+ // create the path
+ long sizeOfPath = strlen("/store/recommend")+1;
+ char *localVarPath = malloc(sizeOfPath);
+ snprintf(localVarPath, sizeOfPath, "/store/recommend");
+
+
+
+
+
+ // form parameters
+ char *keyForm_recommend = NULL;
+ char * valueForm_recommend = 0;
+ keyValuePair_t *keyPairForm_recommend = 0;
+ if (recommend != NULL)
+ {
+ keyForm_recommend = strdup("recommend");
+ valueForm_recommend = calloc(1,MAX_NUMBER_LENGTH);
+ snprintf(valueForm_recommend, MAX_NUMBER_LENGTH, "%d", *recommend);
+ keyPairForm_recommend = keyValuePair_create(keyForm_recommend,valueForm_recommend);
+ list_addElement(localVarFormParameters,keyPairForm_recommend);
+ }
+ list_addElement(localVarHeaderType,"*/*"); //produces
+ list_addElement(localVarContentType,"multipart/form-data"); //consumes
+ apiClient_invoke(apiClient,
+ localVarPath,
+ localVarQueryParameters,
+ localVarHeaderParameters,
+ localVarFormParameters,
+ localVarHeaderType,
+ localVarContentType,
+ localVarBodyParameters,
+ localVarBodyLength,
+ "POST");
+
+ // uncomment below to debug the error response
+ //if (apiClient->response_code == 200) {
+ // printf("%s\n","successful operation");
+ //}
+ //primitive return type simple string
+ char* elementToReturn = NULL;
+ if(apiClient->response_code >= 200 && apiClient->response_code < 300)
+ elementToReturn = strdup((char*)apiClient->dataReceived);
+
+ if (apiClient->dataReceived) {
+ free(apiClient->dataReceived);
+ apiClient->dataReceived = NULL;
+ apiClient->dataReceivedLen = 0;
+ }
+
+
+ list_freeList(localVarFormParameters);
+ list_freeList(localVarHeaderType);
+ list_freeList(localVarContentType);
+ free(localVarPath);
+ if (keyForm_recommend) {
+ free(keyForm_recommend);
+ keyForm_recommend = NULL;
+ }
+ free(keyPairForm_recommend);
+ return elementToReturn;
+end:
+ free(localVarPath);
+ return NULL;
+
+}
+
diff --git a/samples/client/petstore/c/api/StoreAPI.h b/samples/client/petstore/c/api/StoreAPI.h
index 1608e2b27d66..693d21b7dd64 100644
--- a/samples/client/petstore/c/api/StoreAPI.h
+++ b/samples/client/petstore/c/api/StoreAPI.h
@@ -53,3 +53,9 @@ char*
StoreAPI_sendRating(apiClient_t *apiClient, openapi_petstore_sendRating_rating_e rating);
+// Would you recommend our service to a friend?
+//
+char*
+StoreAPI_sendRecommend(apiClient_t *apiClient, int *recommend);
+
+
diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c
index 213220a3c1eb..d27ee87c4fde 100644
--- a/samples/client/petstore/c/api/UserAPI.c
+++ b/samples/client/petstore/c/api/UserAPI.c
@@ -5,11 +5,6 @@
#define MAX_NUMBER_LENGTH 16
#define MAX_BUFFER_LENGTH 4096
-#define intToStr(dst, src) \
- do {\
- char dst[256];\
- snprintf(dst, 256, "%ld", (long int)(src));\
-}while(0)
// Create user
diff --git a/samples/client/petstore/c/docs/StoreAPI.md b/samples/client/petstore/c/docs/StoreAPI.md
index 11fab3fe58ad..8705a994803a 100644
--- a/samples/client/petstore/c/docs/StoreAPI.md
+++ b/samples/client/petstore/c/docs/StoreAPI.md
@@ -10,6 +10,7 @@ Method | HTTP request | Description
[**StoreAPI_placeOrder**](StoreAPI.md#StoreAPI_placeOrder) | **POST** /store/order | Place an order for a pet
[**StoreAPI_sendFeedback**](StoreAPI.md#StoreAPI_sendFeedback) | **POST** /store/feedback | Send us a feedback message
[**StoreAPI_sendRating**](StoreAPI.md#StoreAPI_sendRating) | **POST** /store/rating/{rating} | How would you rate our service?
+[**StoreAPI_sendRecommend**](StoreAPI.md#StoreAPI_sendRecommend) | **POST** /store/recommend | Would you recommend our service to a friend?
# **StoreAPI_deleteOrder**
@@ -195,3 +196,33 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+# **StoreAPI_sendRecommend**
+```c
+// Would you recommend our service to a friend?
+//
+char* StoreAPI_sendRecommend(apiClient_t *apiClient, int *recommend);
+```
+
+### Parameters
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+**apiClient** | **apiClient_t \*** | context containing the client configuration |
+**recommend** | **int \*** | Would you recommend us or not? | [optional]
+
+### Return type
+
+char*
+
+
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: */*
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/petstore/c/model/api_response.c b/samples/client/petstore/c/model/api_response.c
index ccae1f010102..d0169c84f5b2 100644
--- a/samples/client/petstore/c/model/api_response.c
+++ b/samples/client/petstore/c/model/api_response.c
@@ -5,7 +5,7 @@
-api_response_t *api_response_create(
+static api_response_t *api_response_create_internal(
int code,
char *type,
char *message
@@ -18,14 +18,30 @@ api_response_t *api_response_create(
api_response_local_var->type = type;
api_response_local_var->message = message;
+ api_response_local_var->_library_owned = 1;
return api_response_local_var;
}
+__attribute__((deprecated)) api_response_t *api_response_create(
+ int code,
+ char *type,
+ char *message
+ ) {
+ return api_response_create_internal (
+ code,
+ type,
+ message
+ );
+}
void api_response_free(api_response_t *api_response) {
if(NULL == api_response){
return ;
}
+ if(api_response->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "api_response_free");
+ return ;
+ }
listEntry_t *listEntry;
if (api_response->type) {
free(api_response->type);
@@ -113,7 +129,7 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){
}
- api_response_local_var = api_response_create (
+ api_response_local_var = api_response_create_internal (
code ? code->valuedouble : 0,
type && !cJSON_IsNull(type) ? strdup(type->valuestring) : NULL,
message && !cJSON_IsNull(message) ? strdup(message->valuestring) : NULL
diff --git a/samples/client/petstore/c/model/api_response.h b/samples/client/petstore/c/model/api_response.h
index d64dcbacedd9..3d9eb71ff5d5 100644
--- a/samples/client/petstore/c/model/api_response.h
+++ b/samples/client/petstore/c/model/api_response.h
@@ -23,9 +23,10 @@ typedef struct api_response_t {
char *type; // string
char *message; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} api_response_t;
-api_response_t *api_response_create(
+__attribute__((deprecated)) api_response_t *api_response_create(
int code,
char *type,
char *message
diff --git a/samples/client/petstore/c/model/category.c b/samples/client/petstore/c/model/category.c
index a1ea1a5d5cee..2b060a568015 100644
--- a/samples/client/petstore/c/model/category.c
+++ b/samples/client/petstore/c/model/category.c
@@ -5,7 +5,7 @@
-category_t *category_create(
+static category_t *category_create_internal(
long id,
char *name
) {
@@ -16,14 +16,28 @@ category_t *category_create(
category_local_var->id = id;
category_local_var->name = name;
+ category_local_var->_library_owned = 1;
return category_local_var;
}
+__attribute__((deprecated)) category_t *category_create(
+ long id,
+ char *name
+ ) {
+ return category_create_internal (
+ id,
+ name
+ );
+}
void category_free(category_t *category) {
if(NULL == category){
return ;
}
+ if(category->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "category_free");
+ return ;
+ }
listEntry_t *listEntry;
if (category->name) {
free(category->name);
@@ -87,7 +101,7 @@ category_t *category_parseFromJSON(cJSON *categoryJSON){
}
- category_local_var = category_create (
+ category_local_var = category_create_internal (
id ? id->valuedouble : 0,
name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL
);
diff --git a/samples/client/petstore/c/model/category.h b/samples/client/petstore/c/model/category.h
index ec9efd6ccf60..bd27e27e35a3 100644
--- a/samples/client/petstore/c/model/category.h
+++ b/samples/client/petstore/c/model/category.h
@@ -22,9 +22,10 @@ typedef struct category_t {
long id; //numeric
char *name; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} category_t;
-category_t *category_create(
+__attribute__((deprecated)) category_t *category_create(
long id,
char *name
);
diff --git a/samples/client/petstore/c/model/mapped_model.c b/samples/client/petstore/c/model/mapped_model.c
index 7423e32eb338..3ab1e861c326 100644
--- a/samples/client/petstore/c/model/mapped_model.c
+++ b/samples/client/petstore/c/model/mapped_model.c
@@ -5,7 +5,7 @@
-MappedModel_t *MappedModel_create(
+static MappedModel_t *MappedModel_create_internal(
int another_property,
char *uuid_property
) {
@@ -16,14 +16,28 @@ MappedModel_t *MappedModel_create(
MappedModel_local_var->another_property = another_property;
MappedModel_local_var->uuid_property = uuid_property;
+ MappedModel_local_var->_library_owned = 1;
return MappedModel_local_var;
}
+__attribute__((deprecated)) MappedModel_t *MappedModel_create(
+ int another_property,
+ char *uuid_property
+ ) {
+ return MappedModel_create_internal (
+ another_property,
+ uuid_property
+ );
+}
void MappedModel_free(MappedModel_t *MappedModel) {
if(NULL == MappedModel){
return ;
}
+ if(MappedModel->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "MappedModel_free");
+ return ;
+ }
listEntry_t *listEntry;
if (MappedModel->uuid_property) {
free(MappedModel->uuid_property);
@@ -87,7 +101,7 @@ MappedModel_t *MappedModel_parseFromJSON(cJSON *MappedModelJSON){
}
- MappedModel_local_var = MappedModel_create (
+ MappedModel_local_var = MappedModel_create_internal (
another_property ? another_property->valuedouble : 0,
uuid_property && !cJSON_IsNull(uuid_property) ? strdup(uuid_property->valuestring) : NULL
);
diff --git a/samples/client/petstore/c/model/mapped_model.h b/samples/client/petstore/c/model/mapped_model.h
index 83b1d4581ba6..b962632d647d 100644
--- a/samples/client/petstore/c/model/mapped_model.h
+++ b/samples/client/petstore/c/model/mapped_model.h
@@ -22,9 +22,10 @@ typedef struct MappedModel_t {
int another_property; //numeric
char *uuid_property; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} MappedModel_t;
-MappedModel_t *MappedModel_create(
+__attribute__((deprecated)) MappedModel_t *MappedModel_create(
int another_property,
char *uuid_property
);
diff --git a/samples/client/petstore/c/model/model_with_set_propertes.c b/samples/client/petstore/c/model/model_with_set_propertes.c
index d29660fccfcd..0791d68f48a5 100644
--- a/samples/client/petstore/c/model/model_with_set_propertes.c
+++ b/samples/client/petstore/c/model/model_with_set_propertes.c
@@ -5,7 +5,7 @@
-model_with_set_propertes_t *model_with_set_propertes_create(
+static model_with_set_propertes_t *model_with_set_propertes_create_internal(
list_t *tag_set,
list_t *string_set
) {
@@ -16,14 +16,28 @@ model_with_set_propertes_t *model_with_set_propertes_create(
model_with_set_propertes_local_var->tag_set = tag_set;
model_with_set_propertes_local_var->string_set = string_set;
+ model_with_set_propertes_local_var->_library_owned = 1;
return model_with_set_propertes_local_var;
}
+__attribute__((deprecated)) model_with_set_propertes_t *model_with_set_propertes_create(
+ list_t *tag_set,
+ list_t *string_set
+ ) {
+ return model_with_set_propertes_create_internal (
+ tag_set,
+ string_set
+ );
+}
void model_with_set_propertes_free(model_with_set_propertes_t *model_with_set_propertes) {
if(NULL == model_with_set_propertes){
return ;
}
+ if(model_with_set_propertes->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "model_with_set_propertes_free");
+ return ;
+ }
listEntry_t *listEntry;
if (model_with_set_propertes->tag_set) {
list_ForEach(listEntry, model_with_set_propertes->tag_set) {
@@ -146,7 +160,7 @@ model_with_set_propertes_t *model_with_set_propertes_parseFromJSON(cJSON *model_
}
- model_with_set_propertes_local_var = model_with_set_propertes_create (
+ model_with_set_propertes_local_var = model_with_set_propertes_create_internal (
tag_set ? tag_setList : NULL,
string_set ? string_setList : NULL
);
diff --git a/samples/client/petstore/c/model/model_with_set_propertes.h b/samples/client/petstore/c/model/model_with_set_propertes.h
index 537271638b99..aa82893b94bb 100644
--- a/samples/client/petstore/c/model/model_with_set_propertes.h
+++ b/samples/client/petstore/c/model/model_with_set_propertes.h
@@ -23,9 +23,10 @@ typedef struct model_with_set_propertes_t {
list_t *tag_set; //nonprimitive container
list_t *string_set; //primitive container
+ int _library_owned; // Is the library responsible for freeing this object?
} model_with_set_propertes_t;
-model_with_set_propertes_t *model_with_set_propertes_create(
+__attribute__((deprecated)) model_with_set_propertes_t *model_with_set_propertes_create(
list_t *tag_set,
list_t *string_set
);
diff --git a/samples/client/petstore/c/model/order.c b/samples/client/petstore/c/model/order.c
index bbbc50e1a316..d67d1d47c714 100644
--- a/samples/client/petstore/c/model/order.c
+++ b/samples/client/petstore/c/model/order.c
@@ -22,7 +22,7 @@ openapi_petstore_order_STATUS_e order_status_FromString(char* status){
return 0;
}
-order_t *order_create(
+static order_t *order_create_internal(
long id,
long pet_id,
int quantity,
@@ -41,14 +41,36 @@ order_t *order_create(
order_local_var->status = status;
order_local_var->complete = complete;
+ order_local_var->_library_owned = 1;
return order_local_var;
}
+__attribute__((deprecated)) order_t *order_create(
+ long id,
+ long pet_id,
+ int quantity,
+ char *ship_date,
+ openapi_petstore_order_STATUS_e status,
+ int complete
+ ) {
+ return order_create_internal (
+ id,
+ pet_id,
+ quantity,
+ ship_date,
+ status,
+ complete
+ );
+}
void order_free(order_t *order) {
if(NULL == order){
return ;
}
+ if(order->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "order_free");
+ return ;
+ }
listEntry_t *listEntry;
if (order->ship_date) {
free(order->ship_date);
@@ -94,7 +116,7 @@ cJSON *order_convertToJSON(order_t *order) {
// order->status
if(order->status != openapi_petstore_order_STATUS_NULL) {
- if(cJSON_AddStringToObject(item, "status", statusorder_ToString(order->status)) == NULL)
+ if(cJSON_AddStringToObject(item, "status", order_status_ToString(order->status)) == NULL)
{
goto fail; //Enum
}
@@ -195,7 +217,7 @@ order_t *order_parseFromJSON(cJSON *orderJSON){
}
- order_local_var = order_create (
+ order_local_var = order_create_internal (
id ? id->valuedouble : 0,
pet_id ? pet_id->valuedouble : 0,
quantity ? quantity->valuedouble : 0,
diff --git a/samples/client/petstore/c/model/order.h b/samples/client/petstore/c/model/order.h
index 32914a227499..1b0a47b3028e 100644
--- a/samples/client/petstore/c/model/order.h
+++ b/samples/client/petstore/c/model/order.h
@@ -34,9 +34,10 @@ typedef struct order_t {
openapi_petstore_order_STATUS_e status; //enum
int complete; //boolean
+ int _library_owned; // Is the library responsible for freeing this object?
} order_t;
-order_t *order_create(
+__attribute__((deprecated)) order_t *order_create(
long id,
long pet_id,
int quantity,
diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c
index d95d672eda00..1393cc4275a6 100644
--- a/samples/client/petstore/c/model/pet.c
+++ b/samples/client/petstore/c/model/pet.c
@@ -22,7 +22,7 @@ openapi_petstore_pet_STATUS_e pet_status_FromString(char* status){
return 0;
}
-pet_t *pet_create(
+static pet_t *pet_create_internal(
long id,
category_t *category,
char *name,
@@ -41,14 +41,36 @@ pet_t *pet_create(
pet_local_var->tags = tags;
pet_local_var->status = status;
+ pet_local_var->_library_owned = 1;
return pet_local_var;
}
+__attribute__((deprecated)) pet_t *pet_create(
+ long id,
+ category_t *category,
+ char *name,
+ list_t *photo_urls,
+ list_t *tags,
+ openapi_petstore_pet_STATUS_e status
+ ) {
+ return pet_create_internal (
+ id,
+ category,
+ name,
+ photo_urls,
+ tags,
+ status
+ );
+}
void pet_free(pet_t *pet) {
if(NULL == pet){
return ;
}
+ if(pet->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "pet_free");
+ return ;
+ }
listEntry_t *listEntry;
if (pet->category) {
category_free(pet->category);
@@ -148,7 +170,7 @@ cJSON *pet_convertToJSON(pet_t *pet) {
// pet->status
if(pet->status != openapi_petstore_pet_STATUS_NULL) {
- if(cJSON_AddStringToObject(item, "status", statuspet_ToString(pet->status)) == NULL)
+ if(cJSON_AddStringToObject(item, "status", pet_status_ToString(pet->status)) == NULL)
{
goto fail; //Enum
}
@@ -275,7 +297,7 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){
}
- pet_local_var = pet_create (
+ pet_local_var = pet_create_internal (
id ? id->valuedouble : 0,
category ? category_local_nonprim : NULL,
strdup(name->valuestring),
diff --git a/samples/client/petstore/c/model/pet.h b/samples/client/petstore/c/model/pet.h
index d74025510143..860197e63a53 100644
--- a/samples/client/petstore/c/model/pet.h
+++ b/samples/client/petstore/c/model/pet.h
@@ -36,9 +36,10 @@ typedef struct pet_t {
list_t *tags; //nonprimitive container
openapi_petstore_pet_STATUS_e status; //enum
+ int _library_owned; // Is the library responsible for freeing this object?
} pet_t;
-pet_t *pet_create(
+__attribute__((deprecated)) pet_t *pet_create(
long id,
category_t *category,
char *name,
diff --git a/samples/client/petstore/c/model/tag.c b/samples/client/petstore/c/model/tag.c
index f79d34ef9acd..e4b4f94af53d 100644
--- a/samples/client/petstore/c/model/tag.c
+++ b/samples/client/petstore/c/model/tag.c
@@ -5,7 +5,7 @@
-tag_t *tag_create(
+static tag_t *tag_create_internal(
long id,
char *name
) {
@@ -16,14 +16,28 @@ tag_t *tag_create(
tag_local_var->id = id;
tag_local_var->name = name;
+ tag_local_var->_library_owned = 1;
return tag_local_var;
}
+__attribute__((deprecated)) tag_t *tag_create(
+ long id,
+ char *name
+ ) {
+ return tag_create_internal (
+ id,
+ name
+ );
+}
void tag_free(tag_t *tag) {
if(NULL == tag){
return ;
}
+ if(tag->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "tag_free");
+ return ;
+ }
listEntry_t *listEntry;
if (tag->name) {
free(tag->name);
@@ -87,7 +101,7 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON){
}
- tag_local_var = tag_create (
+ tag_local_var = tag_create_internal (
id ? id->valuedouble : 0,
name && !cJSON_IsNull(name) ? strdup(name->valuestring) : NULL
);
diff --git a/samples/client/petstore/c/model/tag.h b/samples/client/petstore/c/model/tag.h
index 9e7b5d053a9d..d4b29e4d2e04 100644
--- a/samples/client/petstore/c/model/tag.h
+++ b/samples/client/petstore/c/model/tag.h
@@ -22,9 +22,10 @@ typedef struct tag_t {
long id; //numeric
char *name; // string
+ int _library_owned; // Is the library responsible for freeing this object?
} tag_t;
-tag_t *tag_create(
+__attribute__((deprecated)) tag_t *tag_create(
long id,
char *name
);
diff --git a/samples/client/petstore/c/model/user.c b/samples/client/petstore/c/model/user.c
index 111bafdc02ad..ce31e6ad17df 100644
--- a/samples/client/petstore/c/model/user.c
+++ b/samples/client/petstore/c/model/user.c
@@ -5,7 +5,7 @@
-user_t *user_create(
+static user_t *user_create_internal(
long id,
char *username,
char *first_name,
@@ -32,14 +32,44 @@ user_t *user_create(
user_local_var->extra = extra;
user_local_var->preference = preference;
+ user_local_var->_library_owned = 1;
return user_local_var;
}
+__attribute__((deprecated)) user_t *user_create(
+ long id,
+ char *username,
+ char *first_name,
+ char *last_name,
+ char *email,
+ char *password,
+ char *phone,
+ int user_status,
+ list_t* extra,
+ openapi_petstore_preference__e preference
+ ) {
+ return user_create_internal (
+ id,
+ username,
+ first_name,
+ last_name,
+ email,
+ password,
+ phone,
+ user_status,
+ extra,
+ preference
+ );
+}
void user_free(user_t *user) {
if(NULL == user){
return ;
}
+ if(user->_library_owned != 1){
+ fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "user_free");
+ return ;
+ }
listEntry_t *listEntry;
if (user->username) {
free(user->username);
@@ -320,7 +350,7 @@ user_t *user_parseFromJSON(cJSON *userJSON){
}
- user_local_var = user_create (
+ user_local_var = user_create_internal (
id ? id->valuedouble : 0,
username && !cJSON_IsNull(username) ? strdup(username->valuestring) : NULL,
first_name && !cJSON_IsNull(first_name) ? strdup(first_name->valuestring) : NULL,
diff --git a/samples/client/petstore/c/model/user.h b/samples/client/petstore/c/model/user.h
index badbc747b308..4643e020a5fe 100644
--- a/samples/client/petstore/c/model/user.h
+++ b/samples/client/petstore/c/model/user.h
@@ -32,9 +32,10 @@ typedef struct user_t {
list_t* extra; //map
openapi_petstore_preference__e preference; //referenced enum
+ int _library_owned; // Is the library responsible for freeing this object?
} user_t;
-user_t *user_create(
+__attribute__((deprecated)) user_t *user_create(
long id,
char *username,
char *first_name,
diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c
index 302cb8bff342..ad06a341a4bb 100644
--- a/samples/client/petstore/c/src/apiClient.c
+++ b/samples/client/petstore/c/src/apiClient.c
@@ -116,7 +116,7 @@ void sslConfig_free(sslConfig_t *sslConfig) {
free(sslConfig);
}
-void replaceSpaceWithPlus(char *stringToProcess) {
+static void replaceSpaceWithPlus(char *stringToProcess) {
for(int i = 0; i < strlen(stringToProcess); i++) {
if(stringToProcess[i] == ' ') {
stringToProcess[i] = '+';
@@ -124,9 +124,9 @@ void replaceSpaceWithPlus(char *stringToProcess) {
}
}
-char *assembleTargetUrl(const char *basePath,
- const char *operationParameter,
- list_t *queryParameters) {
+static char *assembleTargetUrl(const char *basePath,
+ const char *operationParameter,
+ list_t *queryParameters) {
int neededBufferSizeForQueryParameters = 0;
listEntry_t *listEntry;
@@ -177,7 +177,7 @@ char *assembleTargetUrl(const char *basePath,
return targetUrl;
}
-char *assembleHeaderField(char *key, char *value) {
+static char *assembleHeaderField(char *key, char *value) {
char *header = malloc(strlen(key) + strlen(value) + 3);
strcpy(header, key),
@@ -187,13 +187,13 @@ char *assembleHeaderField(char *key, char *value) {
return header;
}
-void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
+static void postData(CURL *handle, const char *bodyParameters, size_t bodyParametersLength) {
curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters);
curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE,
(curl_off_t)bodyParametersLength);
}
-int lengthOfKeyPair(keyValuePair_t *keyPair) {
+static int lengthOfKeyPair(keyValuePair_t *keyPair) {
long length = 0;
if((keyPair->key != NULL) &&
(keyPair->value != NULL) )
diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h
index ed917a0bdafa..462670a50ad7 100644
--- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h
+++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h
@@ -240,7 +240,7 @@ web::json::value ModelBase::toJson( const std::vector& value )
template
web::json::value ModelBase::toJson( const std::set& value )
{
- // There's no protoype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array.
+ // There's no prototype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array.
std::vector ret;
for ( const auto& x : value )
{
diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
index 05ce7e5830d8..a4e283f2d333 100644
--- a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
+++ b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
@@ -3,14 +3,14 @@