diff --git a/bin/cpprest-petstore.sh b/bin/cpprest-petstore.sh index 73d4c491e76..1d4648f44d4 100755 --- a/bin/cpprest-petstore.sh +++ b/bin/cpprest-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/openapi-generator/src/main/resources/cpprest -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l cpprest -o samples/client/petstore/cpprest" +ags="generate -t modules/openapi-generator/src/main/resources/cpprest -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l cpp-restsdk -o samples/client/petstore/cpprest $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/pistache-server-petstore.sh b/bin/pistache-server-petstore.sh index 3a29261930a..3abb4a4286b 100755 --- a/bin/pistache-server-petstore.sh +++ b/bin/pistache-server-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -l pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/pistache-server" +ags="$@ generate -l cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/pistache-server" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/cpprest-petstore.bat b/bin/windows/cpprest-petstore.bat index 3402c7ec7b3..100c29a421b 100755 --- a/bin/windows/cpprest-petstore.bat +++ b/bin/windows/cpprest-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l cpprest -o samples\client\petstore\cpprest +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l cpp-restsdk -o samples\client\petstore\cpprest java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/restbed-petstore-server.bat b/bin/windows/restbed-petstore-server.bat index 864c6ae3f72..8c0e53d4c4e 100644 --- a/bin/windows/restbed-petstore-server.bat +++ b/bin/windows/restbed-petstore-server.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l restbed -o samples\server\petstore\restbed\ +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l cpp-restbed-server -o samples\server\petstore\restbed\ java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 70f2c27fcd8..923de645d6a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -179,7 +179,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { op.bodyParam.vendorExtensions.put("x-codegen-pistache-isStringOrDate", op.bodyParam.isString || op.bodyParam.isDate); } - if(op.consumes != null) { + if (op.consumes != null) { for (Map consume : op.consumes) { if (consume.get("mediaType") != null && consume.get("mediaType").equals("application/json")) { consumeJson = true; @@ -189,17 +189,17 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { op.httpMethod = op.httpMethod.substring(0, 1).toUpperCase() + op.httpMethod.substring(1).toLowerCase(); - for(CodegenParameter param : op.allParams){ - if (param.isFormParam) isParsingSupported=false; - if (param.isFile) isParsingSupported=false; - if (param.isCookieParam) isParsingSupported=false; + for (CodegenParameter param : op.allParams) { + if (param.isFormParam) isParsingSupported = false; + if (param.isFile) isParsingSupported = false; + if (param.isCookieParam) isParsingSupported = false; //TODO: This changes the info about the real type but it is needed to parse the header params if (param.isHeaderParam) { param.dataType = "Optional"; param.baseType = "Optional"; - } else if(param.isQueryParam){ - if(param.isPrimitiveType) { + } else if (param.isQueryParam) { + if (param.isPrimitiveType) { param.dataType = "Optional<" + param.dataType + ">"; } else { param.dataType = "Optional<" + param.baseType + ">"; @@ -227,15 +227,15 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { public String apiFilename(String templateName, String tag) { String result = super.apiFilename(templateName, tag); - if ( templateName.endsWith("impl-header.mustache") ) { + if (templateName.endsWith("impl-header.mustache")) { int ix = result.lastIndexOf('/'); result = result.substring(0, ix) + result.substring(ix, result.length() - 2) + "Impl.h"; result = result.replace(apiFileFolder(), implFileFolder()); - } else if ( templateName.endsWith("impl-source.mustache") ) { + } else if (templateName.endsWith("impl-source.mustache")) { int ix = result.lastIndexOf('/'); result = result.substring(0, ix) + result.substring(ix, result.length() - 4) + "Impl.cpp"; result = result.replace(apiFileFolder(), implFileFolder()); - } else if ( templateName.endsWith("api-server.mustache") ) { + } else if (templateName.endsWith("api-server.mustache")) { int ix = result.lastIndexOf('/'); result = result.substring(0, ix) + result.substring(ix, result.length() - 4) + "MainServer.cpp"; result = result.replace(apiFileFolder(), outputFolder); @@ -254,11 +254,11 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { * for different property types * * @return a string value used as the `dataType` field for model templates, - * `returnType` for api templates + * `returnType` for api templates */ @Override public String getTypeDeclaration(Schema p) { - String swaggerType = getSchemaType(p); + String openAPIType = getSchemaType(p); if (p instanceof ArraySchema) { ArraySchema ap = (ArraySchema) p; @@ -269,13 +269,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { Schema inner = (Schema) p.getAdditionalProperties(); return getSchemaType(p) + ""; } - if (p instanceof StringSchema || p instanceof DateSchema + if (p instanceof StringSchema || SchemaTypeUtil.STRING_TYPE.equals(p.getType()) + || p instanceof DateSchema || p instanceof DateTimeSchema || p instanceof FileSchema - || languageSpecificPrimitives.contains(swaggerType)) { - return toModelName(swaggerType); + || languageSpecificPrimitives.contains(openAPIType)) { + return toModelName(openAPIType); } - return "std::shared_ptr<" + swaggerType + ">"; + return "std::shared_ptr<" + openAPIType + ">"; } @Override @@ -358,14 +359,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { */ @Override public String getSchemaType(Schema p) { - String swaggerType = super.getSchemaType(p); + String openAPIType = super.getSchemaType(p); String type = null; - if (typeMapping.containsKey(swaggerType)) { - type = typeMapping.get(swaggerType); + if (typeMapping.containsKey(openAPIType)) { + type = typeMapping.get(openAPIType); if (languageSpecificPrimitives.contains(type)) return toModelName(type); } else - type = swaggerType; + type = openAPIType; return toModelName(type); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java index 8352400f7f5..5e4b271f238 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java @@ -279,13 +279,12 @@ public class CppRestClientCodegen extends AbstractCppCodegen { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; - } - if (isMapSchema(p)) { + } else if (isMapSchema(p)) { Schema inner = (Schema) p.getAdditionalProperties(); return getSchemaType(p) + ""; - } - if (p instanceof StringSchema || p instanceof DateSchema - || p instanceof DateTimeSchema || p instanceof FileSchema + } else if (p instanceof StringSchema || SchemaTypeUtil.STRING_TYPE.equals(p.getType()) + || p instanceof DateSchema || p instanceof DateTimeSchema + || p instanceof FileSchema || languageSpecificPrimitives.contains(openAPIType)) { return toModelName(openAPIType); } diff --git a/modules/openapi-generator/src/main/resources/pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/pistache-server/api-source.mustache index cfae1635b0a..2545aca76aa 100644 --- a/modules/openapi-generator/src/main/resources/pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/pistache-server/api-source.mustache @@ -75,7 +75,8 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque {{#bodyParam}} nlohmann::json request_body = nlohmann::json::parse(request.body()); {{^isPrimitiveType}} - {{paramName}}.fromJson(request_body); {{/isPrimitiveType}} + {{paramName}}.fromJson(request_body); + {{/isPrimitiveType}} {{#isPrimitiveType}} // The conversion is done automatically by the json library {{paramName}} = request_body; diff --git a/samples/client/petstore/cpprest/.swagger-codegen/VERSION b/samples/client/petstore/cpprest/.swagger-codegen/VERSION index 855ff9501eb..096bf47efe3 100644 --- a/samples/client/petstore/cpprest/.swagger-codegen/VERSION +++ b/samples/client/petstore/cpprest/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpprest/ApiClient.cpp b/samples/client/petstore/cpprest/ApiClient.cpp index 5de6a5dee77..d571a95f540 100644 --- a/samples/client/petstore/cpprest/ApiClient.cpp +++ b/samples/client/petstore/cpprest/ApiClient.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/ApiClient.h b/samples/client/petstore/cpprest/ApiClient.h index b4eaadbcf02..595b7047c5f 100644 --- a/samples/client/petstore/cpprest/ApiClient.h +++ b/samples/client/petstore/cpprest/ApiClient.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/ApiConfiguration.cpp b/samples/client/petstore/cpprest/ApiConfiguration.cpp index a0609f9fb38..8451113e125 100644 --- a/samples/client/petstore/cpprest/ApiConfiguration.cpp +++ b/samples/client/petstore/cpprest/ApiConfiguration.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/ApiConfiguration.h b/samples/client/petstore/cpprest/ApiConfiguration.h index eca76ad99fd..ae3c57f919b 100644 --- a/samples/client/petstore/cpprest/ApiConfiguration.h +++ b/samples/client/petstore/cpprest/ApiConfiguration.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/ApiException.cpp b/samples/client/petstore/cpprest/ApiException.cpp index 6626508f9b8..74be9f7916b 100644 --- a/samples/client/petstore/cpprest/ApiException.cpp +++ b/samples/client/petstore/cpprest/ApiException.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/ApiException.h b/samples/client/petstore/cpprest/ApiException.h index 83a727d9a27..5dfd6984680 100644 --- a/samples/client/petstore/cpprest/ApiException.h +++ b/samples/client/petstore/cpprest/ApiException.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/HttpContent.cpp b/samples/client/petstore/cpprest/HttpContent.cpp index ffe367a8500..99a84063a3a 100644 --- a/samples/client/petstore/cpprest/HttpContent.cpp +++ b/samples/client/petstore/cpprest/HttpContent.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/HttpContent.h b/samples/client/petstore/cpprest/HttpContent.h index b64a3a29f4b..97279dfdb6a 100644 --- a/samples/client/petstore/cpprest/HttpContent.h +++ b/samples/client/petstore/cpprest/HttpContent.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/IHttpBody.h b/samples/client/petstore/cpprest/IHttpBody.h index 846d6e1fd30..e01b2d4af14 100644 --- a/samples/client/petstore/cpprest/IHttpBody.h +++ b/samples/client/petstore/cpprest/IHttpBody.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/JsonBody.cpp b/samples/client/petstore/cpprest/JsonBody.cpp index 7f8f0a249f7..451fbf00cdb 100644 --- a/samples/client/petstore/cpprest/JsonBody.cpp +++ b/samples/client/petstore/cpprest/JsonBody.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/JsonBody.h b/samples/client/petstore/cpprest/JsonBody.h index 451faf59721..5364e9b395b 100644 --- a/samples/client/petstore/cpprest/JsonBody.h +++ b/samples/client/petstore/cpprest/JsonBody.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/ModelBase.cpp b/samples/client/petstore/cpprest/ModelBase.cpp index c48c9d53d6a..db9a66f25c5 100644 --- a/samples/client/petstore/cpprest/ModelBase.cpp +++ b/samples/client/petstore/cpprest/ModelBase.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/ModelBase.h b/samples/client/petstore/cpprest/ModelBase.h index df073ab99a8..1ed9027765e 100644 --- a/samples/client/petstore/cpprest/ModelBase.h +++ b/samples/client/petstore/cpprest/ModelBase.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/MultipartFormData.cpp b/samples/client/petstore/cpprest/MultipartFormData.cpp index 372f5bd73ef..94a5fb3164e 100644 --- a/samples/client/petstore/cpprest/MultipartFormData.cpp +++ b/samples/client/petstore/cpprest/MultipartFormData.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/MultipartFormData.h b/samples/client/petstore/cpprest/MultipartFormData.h index 9a44b7d0b0d..29896d3301c 100644 --- a/samples/client/petstore/cpprest/MultipartFormData.h +++ b/samples/client/petstore/cpprest/MultipartFormData.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/Object.cpp b/samples/client/petstore/cpprest/Object.cpp index 9745f0f36f4..80434226633 100644 --- a/samples/client/petstore/cpprest/Object.cpp +++ b/samples/client/petstore/cpprest/Object.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/Object.h b/samples/client/petstore/cpprest/Object.h index f3922f41e21..2bba167faff 100644 --- a/samples/client/petstore/cpprest/Object.h +++ b/samples/client/petstore/cpprest/Object.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/api/PetApi.cpp b/samples/client/petstore/cpprest/api/PetApi.cpp index 8e83fd6f3f0..387271eeb29 100644 --- a/samples/client/petstore/cpprest/api/PetApi.cpp +++ b/samples/client/petstore/cpprest/api/PetApi.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -36,13 +36,13 @@ PetApi::~PetApi() { } -pplx::task PetApi::addPet(std::shared_ptr body) +pplx::task PetApi::addPet(Pet pet) { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'pet' is set + if (pet == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->addPet")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'pet' when calling PetApi->addPet")); } @@ -55,8 +55,6 @@ pplx::task PetApi::addPet(std::shared_ptr body) std::map> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -96,7 +94,7 @@ pplx::task PetApi::addPet(std::shared_ptr body) requestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value json; - json = ModelBase::toJson(body); + json = ModelBase::toJson(pet); httpBody = std::shared_ptr( new JsonBody( json ) ); @@ -107,9 +105,9 @@ pplx::task PetApi::addPet(std::shared_ptr body) requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr multipart(new MultipartFormData); - if(body.get()) + if(pet.get()) { - body->toMultipart(multipart, utility::conversions::to_string_t("body")); + pet->toMultipart(multipart, utility::conversions::to_string_t("pet")); } httpBody = multipart; @@ -171,8 +169,6 @@ pplx::task PetApi::deletePet(int64_t petId, boost::optional> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -635,13 +631,13 @@ pplx::task> PetApi::getPetById(int64_t petId) return result; }); } -pplx::task PetApi::updatePet(std::shared_ptr body) +pplx::task PetApi::updatePet(Pet pet) { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'pet' is set + if (pet == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->updatePet")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'pet' when calling PetApi->updatePet")); } @@ -654,8 +650,6 @@ pplx::task PetApi::updatePet(std::shared_ptr body) std::map> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -695,7 +689,7 @@ pplx::task PetApi::updatePet(std::shared_ptr body) requestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value json; - json = ModelBase::toJson(body); + json = ModelBase::toJson(pet); httpBody = std::shared_ptr( new JsonBody( json ) ); @@ -706,9 +700,9 @@ pplx::task PetApi::updatePet(std::shared_ptr body) requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr multipart(new MultipartFormData); - if(body.get()) + if(pet.get()) { - body->toMultipart(multipart, utility::conversions::to_string_t("body")); + pet->toMultipart(multipart, utility::conversions::to_string_t("pet")); } httpBody = multipart; @@ -770,8 +764,6 @@ pplx::task PetApi::updatePetWithForm(int64_t petId, boost::optional> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -864,7 +856,7 @@ pplx::task PetApi::updatePetWithForm(int64_t petId, boost::optional> PetApi::uploadFile(int64_t petId, boost::optional additionalMetadata, boost::optional> file) +pplx::task> PetApi::uploadFile(int64_t petId, boost::optional additionalMetadata, boost::optional file) { @@ -911,7 +903,7 @@ pplx::task> PetApi::uploadFile(int64_t petId, boost { formParams[ utility::conversions::to_string_t("additionalMetadata") ] = ApiClient::parameterToString(*additionalMetadata); } - if (file && *file != nullptr) + if (file) { fileParams[ utility::conversions::to_string_t("file") ] = *file; } diff --git a/samples/client/petstore/cpprest/api/PetApi.h b/samples/client/petstore/cpprest/api/PetApi.h index caa23c3253d..cc3e598540d 100644 --- a/samples/client/petstore/cpprest/api/PetApi.h +++ b/samples/client/petstore/cpprest/api/PetApi.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -47,9 +47,9 @@ public: /// /// /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store pplx::task addPet( - std::shared_ptr body + Pet pet ); /// /// Deletes a pet @@ -99,9 +99,9 @@ public: /// /// /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store pplx::task updatePet( - std::shared_ptr body + Pet pet ); /// /// Updates a pet in the store with form data @@ -129,7 +129,7 @@ public: pplx::task> uploadFile( int64_t petId, boost::optional additionalMetadata, - boost::optional> file + boost::optional file ); protected: diff --git a/samples/client/petstore/cpprest/api/StoreApi.cpp b/samples/client/petstore/cpprest/api/StoreApi.cpp index 19699808b20..f9f3d3a3fcd 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.cpp +++ b/samples/client/petstore/cpprest/api/StoreApi.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -50,8 +50,6 @@ pplx::task StoreApi::deleteOrder(utility::string_t orderId) std::map> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -374,13 +372,13 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) return result; }); } -pplx::task> StoreApi::placeOrder(std::shared_ptr body) +pplx::task> StoreApi::placeOrder(Order order) { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'order' is set + if (order == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling StoreApi->placeOrder")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'order' when calling StoreApi->placeOrder")); } @@ -421,6 +419,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; std::unordered_set consumeHttpContentTypes; + consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") ); std::shared_ptr httpBody; @@ -432,7 +431,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b requestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value json; - json = ModelBase::toJson(body); + json = ModelBase::toJson(order); httpBody = std::shared_ptr( new JsonBody( json ) ); @@ -443,9 +442,9 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr multipart(new MultipartFormData); - if(body.get()) + if(order.get()) { - body->toMultipart(multipart, utility::conversions::to_string_t("body")); + order->toMultipart(multipart, utility::conversions::to_string_t("order")); } httpBody = multipart; diff --git a/samples/client/petstore/cpprest/api/StoreApi.h b/samples/client/petstore/cpprest/api/StoreApi.h index 9d1378d53b7..8c7401b4162 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.h +++ b/samples/client/petstore/cpprest/api/StoreApi.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -74,9 +74,9 @@ public: /// /// /// - /// order placed for purchasing the pet + /// order placed for purchasing the pet pplx::task> placeOrder( - std::shared_ptr body + Order order ); protected: diff --git a/samples/client/petstore/cpprest/api/UserApi.cpp b/samples/client/petstore/cpprest/api/UserApi.cpp index 0ce59b80a9f..8529c143dcd 100644 --- a/samples/client/petstore/cpprest/api/UserApi.cpp +++ b/samples/client/petstore/cpprest/api/UserApi.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -36,13 +36,13 @@ UserApi::~UserApi() { } -pplx::task UserApi::createUser(std::shared_ptr body) +pplx::task UserApi::createUser(User user) { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'user' is set + if (user == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->createUser")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'user' when calling UserApi->createUser")); } @@ -55,8 +55,6 @@ pplx::task UserApi::createUser(std::shared_ptr body) std::map> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -83,6 +81,7 @@ pplx::task UserApi::createUser(std::shared_ptr body) headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; std::unordered_set consumeHttpContentTypes; + consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") ); std::shared_ptr httpBody; @@ -94,7 +93,7 @@ pplx::task UserApi::createUser(std::shared_ptr body) requestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value json; - json = ModelBase::toJson(body); + json = ModelBase::toJson(user); httpBody = std::shared_ptr( new JsonBody( json ) ); @@ -105,9 +104,9 @@ pplx::task UserApi::createUser(std::shared_ptr body) requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr multipart(new MultipartFormData); - if(body.get()) + if(user.get()) { - body->toMultipart(multipart, utility::conversions::to_string_t("body")); + user->toMultipart(multipart, utility::conversions::to_string_t("user")); } httpBody = multipart; @@ -153,7 +152,7 @@ pplx::task UserApi::createUser(std::shared_ptr body) return void(); }); } -pplx::task UserApi::createUsersWithArrayInput(std::vector> body) +pplx::task UserApi::createUsersWithArrayInput(std::vector> user) { @@ -166,8 +165,6 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -194,6 +191,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector consumeHttpContentTypes; + consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") ); std::shared_ptr httpBody; @@ -207,7 +205,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector jsonArray; - for( auto& item : body ) + for( auto& item : user ) { jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); @@ -224,12 +222,12 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector multipart(new MultipartFormData); { std::vector jsonArray; - for( auto& item : body ) + for( auto& item : user ) { jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); } - multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); + multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("user"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); } httpBody = multipart; @@ -275,7 +273,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector UserApi::createUsersWithListInput(std::vector> body) +pplx::task UserApi::createUsersWithListInput(std::vector> user) { @@ -288,8 +286,6 @@ pplx::task UserApi::createUsersWithListInput(std::vector> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -316,6 +312,7 @@ pplx::task UserApi::createUsersWithListInput(std::vector consumeHttpContentTypes; + consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") ); std::shared_ptr httpBody; @@ -329,7 +326,7 @@ pplx::task UserApi::createUsersWithListInput(std::vector jsonArray; - for( auto& item : body ) + for( auto& item : user ) { jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); @@ -346,12 +343,12 @@ pplx::task UserApi::createUsersWithListInput(std::vector multipart(new MultipartFormData); { std::vector jsonArray; - for( auto& item : body ) + for( auto& item : user ) { jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); } - multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); + multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("user"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); } httpBody = multipart; @@ -411,8 +408,6 @@ pplx::task UserApi::deleteUser(utility::string_t username) std::map> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -752,8 +747,6 @@ pplx::task UserApi::logoutUser() std::map> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -835,13 +828,13 @@ pplx::task UserApi::logoutUser() return void(); }); } -pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr body) +pplx::task UserApi::updateUser(utility::string_t username, User user) { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'user' is set + if (user == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->updateUser")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'user' when calling UserApi->updateUser")); } @@ -855,8 +848,6 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr std::map> fileParams; std::unordered_set responseHttpContentTypes; - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t responseHttpContentType; @@ -883,6 +874,7 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; std::unordered_set consumeHttpContentTypes; + consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") ); std::shared_ptr httpBody; @@ -894,7 +886,7 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr requestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value json; - json = ModelBase::toJson(body); + json = ModelBase::toJson(user); httpBody = std::shared_ptr( new JsonBody( json ) ); @@ -905,9 +897,9 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr multipart(new MultipartFormData); - if(body.get()) + if(user.get()) { - body->toMultipart(multipart, utility::conversions::to_string_t("body")); + user->toMultipart(multipart, utility::conversions::to_string_t("user")); } httpBody = multipart; diff --git a/samples/client/petstore/cpprest/api/UserApi.h b/samples/client/petstore/cpprest/api/UserApi.h index 204718f71de..b4441505428 100644 --- a/samples/client/petstore/cpprest/api/UserApi.h +++ b/samples/client/petstore/cpprest/api/UserApi.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -23,7 +23,6 @@ #include "../ApiClient.h" #include "User.h" -#include #include #include @@ -46,9 +45,9 @@ public: /// /// This can only be done by the logged in user. /// - /// Created user object + /// Created user object pplx::task createUser( - std::shared_ptr body + User user ); /// /// Creates list of users with given input array @@ -56,9 +55,9 @@ public: /// /// /// - /// List of user object + /// List of user object pplx::task createUsersWithArrayInput( - std::vector> body + std::vector> user ); /// /// Creates list of users with given input array @@ -66,9 +65,9 @@ public: /// /// /// - /// List of user object + /// List of user object pplx::task createUsersWithListInput( - std::vector> body + std::vector> user ); /// /// Delete user @@ -86,7 +85,7 @@ public: /// /// /// - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. pplx::task> getUserByName( utility::string_t username ); @@ -117,10 +116,10 @@ public: /// This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object + /// Updated user object pplx::task updateUser( utility::string_t username, - std::shared_ptr body + User user ); protected: diff --git a/samples/client/petstore/cpprest/model/ApiResponse.cpp b/samples/client/petstore/cpprest/model/ApiResponse.cpp index 9ccd6d5919a..a0dd5de2672 100644 --- a/samples/client/petstore/cpprest/model/ApiResponse.cpp +++ b/samples/client/petstore/cpprest/model/ApiResponse.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/ApiResponse.h b/samples/client/petstore/cpprest/model/ApiResponse.h index 44966baf868..cac05161df7 100644 --- a/samples/client/petstore/cpprest/model/ApiResponse.h +++ b/samples/client/petstore/cpprest/model/ApiResponse.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Category.cpp b/samples/client/petstore/cpprest/model/Category.cpp index 21a2dc52e74..e1fe35f5e66 100644 --- a/samples/client/petstore/cpprest/model/Category.cpp +++ b/samples/client/petstore/cpprest/model/Category.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Category.h b/samples/client/petstore/cpprest/model/Category.h index 02e19700126..b6ba0b6c3da 100644 --- a/samples/client/petstore/cpprest/model/Category.h +++ b/samples/client/petstore/cpprest/model/Category.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Order.cpp b/samples/client/petstore/cpprest/model/Order.cpp index 3a8326ae27b..5276e43c314 100644 --- a/samples/client/petstore/cpprest/model/Order.cpp +++ b/samples/client/petstore/cpprest/model/Order.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Order.h b/samples/client/petstore/cpprest/model/Order.h index 69c4d0c4af5..bc62a7b465b 100644 --- a/samples/client/petstore/cpprest/model/Order.h +++ b/samples/client/petstore/cpprest/model/Order.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Pet.cpp b/samples/client/petstore/cpprest/model/Pet.cpp index 91fda09b52b..580787516ef 100644 --- a/samples/client/petstore/cpprest/model/Pet.cpp +++ b/samples/client/petstore/cpprest/model/Pet.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Pet.h b/samples/client/petstore/cpprest/model/Pet.h index 20925af7471..89dea97787f 100644 --- a/samples/client/petstore/cpprest/model/Pet.h +++ b/samples/client/petstore/cpprest/model/Pet.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Tag.cpp b/samples/client/petstore/cpprest/model/Tag.cpp index be77d315d13..00850d62c35 100644 --- a/samples/client/petstore/cpprest/model/Tag.cpp +++ b/samples/client/petstore/cpprest/model/Tag.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/Tag.h b/samples/client/petstore/cpprest/model/Tag.h index b08bb1e3039..143b329932d 100644 --- a/samples/client/petstore/cpprest/model/Tag.h +++ b/samples/client/petstore/cpprest/model/Tag.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/User.cpp b/samples/client/petstore/cpprest/model/User.cpp index 26447b3bd03..ed8402b555b 100644 --- a/samples/client/petstore/cpprest/model/User.cpp +++ b/samples/client/petstore/cpprest/model/User.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/model/User.h b/samples/client/petstore/cpprest/model/User.h index fed0ff17978..3c0280353ad 100644 --- a/samples/client/petstore/cpprest/model/User.h +++ b/samples/client/petstore/cpprest/model/User.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/pistache-server/.swagger-codegen/VERSION b/samples/server/petstore/pistache-server/.swagger-codegen/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/server/petstore/pistache-server/.swagger-codegen/VERSION +++ b/samples/server/petstore/pistache-server/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/pistache-server/api/PetApi.cpp b/samples/server/petstore/pistache-server/api/PetApi.cpp index edcdc694951..5bebe0bc7d9 100644 --- a/samples/server/petstore/pistache-server/api/PetApi.cpp +++ b/samples/server/petstore/pistache-server/api/PetApi.cpp @@ -59,12 +59,12 @@ void PetApi::setupRoutes() { void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - Pet body; + Pet pet; try { nlohmann::json request_body = nlohmann::json::parse(request.body()); - body.fromJson(request_body); - this->add_pet(body, response); + pet.fromJson(request_body); + this->add_pet(pet, response); } catch (std::runtime_error & e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -132,12 +132,12 @@ void PetApi::get_pet_by_id_handler(const Pistache::Rest::Request &request, Pista void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - Pet body; + Pet pet; try { nlohmann::json request_body = nlohmann::json::parse(request.body()); - body.fromJson(request_body); - this->update_pet(body, response); + pet.fromJson(request_body); + this->update_pet(pet, response); } catch (std::runtime_error & e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); diff --git a/samples/server/petstore/pistache-server/api/PetApi.h b/samples/server/petstore/pistache-server/api/PetApi.h index f6326e7ac48..fa99be22237 100644 --- a/samples/server/petstore/pistache-server/api/PetApi.h +++ b/samples/server/petstore/pistache-server/api/PetApi.h @@ -68,8 +68,8 @@ private: /// /// /// - /// Pet object that needs to be added to the store - virtual void add_pet(const Pet &body, Pistache::Http::ResponseWriter &response) = 0; + /// Pet object that needs to be added to the store + virtual void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0; /// /// Deletes a pet @@ -114,8 +114,8 @@ private: /// /// /// - /// Pet object that needs to be added to the store - virtual void update_pet(const Pet &body, Pistache::Http::ResponseWriter &response) = 0; + /// Pet object that needs to be added to the store + virtual void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0; /// /// Updates a pet in the store with form data diff --git a/samples/server/petstore/pistache-server/api/StoreApi.cpp b/samples/server/petstore/pistache-server/api/StoreApi.cpp index 3b3a969ddb4..e005a3b5c6d 100644 --- a/samples/server/petstore/pistache-server/api/StoreApi.cpp +++ b/samples/server/petstore/pistache-server/api/StoreApi.cpp @@ -92,12 +92,12 @@ void StoreApi::get_order_by_id_handler(const Pistache::Rest::Request &request, P void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - Order body; + Order order; try { nlohmann::json request_body = nlohmann::json::parse(request.body()); - body.fromJson(request_body); - this->place_order(body, response); + order.fromJson(request_body); + this->place_order(order, response); } catch (std::runtime_error & e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); diff --git a/samples/server/petstore/pistache-server/api/StoreApi.h b/samples/server/petstore/pistache-server/api/StoreApi.h index 7cf9d69b7ab..91f1c34391c 100644 --- a/samples/server/petstore/pistache-server/api/StoreApi.h +++ b/samples/server/petstore/pistache-server/api/StoreApi.h @@ -90,8 +90,8 @@ private: /// /// /// - /// order placed for purchasing the pet - virtual void place_order(const Order &body, Pistache::Http::ResponseWriter &response) = 0; + /// order placed for purchasing the pet + virtual void place_order(const Order &order, Pistache::Http::ResponseWriter &response) = 0; }; diff --git a/samples/server/petstore/pistache-server/api/UserApi.cpp b/samples/server/petstore/pistache-server/api/UserApi.cpp index 6648a72d404..a74ee1e9b9a 100644 --- a/samples/server/petstore/pistache-server/api/UserApi.cpp +++ b/samples/server/petstore/pistache-server/api/UserApi.cpp @@ -59,12 +59,12 @@ void UserApi::setupRoutes() { void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - User body; + User user; try { nlohmann::json request_body = nlohmann::json::parse(request.body()); - body.fromJson(request_body); - this->create_user(body, response); + user.fromJson(request_body); + this->create_user(user, response); } catch (std::runtime_error & e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -75,12 +75,12 @@ void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistac void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - User body; + User user; try { nlohmann::json request_body = nlohmann::json::parse(request.body()); - body.fromJson(request_body); - this->create_users_with_array_input(body, response); + user.fromJson(request_body); + this->create_users_with_array_input(user, response); } catch (std::runtime_error & e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -91,12 +91,12 @@ void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Reques void UserApi::create_users_with_list_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - User body; + User user; try { nlohmann::json request_body = nlohmann::json::parse(request.body()); - body.fromJson(request_body); - this->create_users_with_list_input(body, response); + user.fromJson(request_body); + this->create_users_with_list_input(user, response); } catch (std::runtime_error & e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -161,12 +161,12 @@ void UserApi::update_user_handler(const Pistache::Rest::Request &request, Pistac auto username = request.param(":username").as(); // Getting the body param - User body; + User user; try { nlohmann::json request_body = nlohmann::json::parse(request.body()); - body.fromJson(request_body); - this->update_user(username, body, response); + user.fromJson(request_body); + this->update_user(username, user, response); } catch (std::runtime_error & e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); diff --git a/samples/server/petstore/pistache-server/api/UserApi.h b/samples/server/petstore/pistache-server/api/UserApi.h index 9d6aa3bf2e1..ad700fb52d4 100644 --- a/samples/server/petstore/pistache-server/api/UserApi.h +++ b/samples/server/petstore/pistache-server/api/UserApi.h @@ -26,7 +26,6 @@ #include "User.h" #include -#include namespace io { namespace swagger { @@ -68,8 +67,8 @@ private: /// /// This can only be done by the logged in user. /// - /// Created user object - virtual void create_user(const User &body, Pistache::Http::ResponseWriter &response) = 0; + /// Created user object + virtual void create_user(const User &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Creates list of users with given input array @@ -77,8 +76,8 @@ private: /// /// /// - /// List of user object - virtual void create_users_with_array_input(const User &body, Pistache::Http::ResponseWriter &response) = 0; + /// List of user object + virtual void create_users_with_array_input(const User &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Creates list of users with given input array @@ -86,8 +85,8 @@ private: /// /// /// - /// List of user object - virtual void create_users_with_list_input(const User &body, Pistache::Http::ResponseWriter &response) = 0; + /// List of user object + virtual void create_users_with_list_input(const User &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Delete user @@ -104,7 +103,7 @@ private: /// /// /// - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. virtual void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response) = 0; /// @@ -132,8 +131,8 @@ private: /// This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object - virtual void update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response) = 0; + /// Updated user object + virtual void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) = 0; }; diff --git a/samples/server/petstore/pistache-server/impl/PetApiImpl.cpp b/samples/server/petstore/pistache-server/impl/PetApiImpl.cpp index 69848e0fdc6..2d35c04b3cc 100644 --- a/samples/server/petstore/pistache-server/impl/PetApiImpl.cpp +++ b/samples/server/petstore/pistache-server/impl/PetApiImpl.cpp @@ -23,7 +23,7 @@ PetApiImpl::PetApiImpl(Pistache::Address addr) : PetApi(addr) { } -void PetApiImpl::add_pet(const Pet &body, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void PetApiImpl::delete_pet(const int64_t &petId, const Optional &apiKey, Pistache::Http::ResponseWriter &response) { @@ -38,7 +38,7 @@ void PetApiImpl::find_pets_by_tags(const Optional &tags, Pistache:: void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::update_pet(const Pet &body, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void PetApiImpl::update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response){ diff --git a/samples/server/petstore/pistache-server/impl/PetApiImpl.h b/samples/server/petstore/pistache-server/impl/PetApiImpl.h index 1d05897194e..511864a7c1b 100644 --- a/samples/server/petstore/pistache-server/impl/PetApiImpl.h +++ b/samples/server/petstore/pistache-server/impl/PetApiImpl.h @@ -43,12 +43,12 @@ public: PetApiImpl(Pistache::Address addr); ~PetApiImpl() { }; - void add_pet(const Pet &body, Pistache::Http::ResponseWriter &response); + void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response); void delete_pet(const int64_t &petId, const Optional &apiKey, Pistache::Http::ResponseWriter &response); void find_pets_by_status(const Optional &status, Pistache::Http::ResponseWriter &response); void find_pets_by_tags(const Optional &tags, Pistache::Http::ResponseWriter &response); void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response); - void update_pet(const Pet &body, Pistache::Http::ResponseWriter &response); + void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response); void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); void upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); diff --git a/samples/server/petstore/pistache-server/impl/StoreApiImpl.cpp b/samples/server/petstore/pistache-server/impl/StoreApiImpl.cpp index 1c03bda85f3..4d5bdde872c 100644 --- a/samples/server/petstore/pistache-server/impl/StoreApiImpl.cpp +++ b/samples/server/petstore/pistache-server/impl/StoreApiImpl.cpp @@ -32,7 +32,7 @@ void StoreApiImpl::get_inventory(Pistache::Http::ResponseWriter &response) { void StoreApiImpl::get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void StoreApiImpl::place_order(const Order &body, Pistache::Http::ResponseWriter &response) { +void StoreApiImpl::place_order(const Order &order, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } diff --git a/samples/server/petstore/pistache-server/impl/StoreApiImpl.h b/samples/server/petstore/pistache-server/impl/StoreApiImpl.h index 6daed72be20..49834cdc755 100644 --- a/samples/server/petstore/pistache-server/impl/StoreApiImpl.h +++ b/samples/server/petstore/pistache-server/impl/StoreApiImpl.h @@ -46,7 +46,7 @@ public: void delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response); void get_inventory(Pistache::Http::ResponseWriter &response); void get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response); - void place_order(const Order &body, Pistache::Http::ResponseWriter &response); + void place_order(const Order &order, Pistache::Http::ResponseWriter &response); }; diff --git a/samples/server/petstore/pistache-server/impl/UserApiImpl.cpp b/samples/server/petstore/pistache-server/impl/UserApiImpl.cpp index 4fbd93f49d6..a0922aef9b2 100644 --- a/samples/server/petstore/pistache-server/impl/UserApiImpl.cpp +++ b/samples/server/petstore/pistache-server/impl/UserApiImpl.cpp @@ -23,13 +23,13 @@ UserApiImpl::UserApiImpl(Pistache::Address addr) : UserApi(addr) { } -void UserApiImpl::create_user(const User &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_user(const User &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::create_users_with_array_input(const User &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_users_with_array_input(const User &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::create_users_with_list_input(const User &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_users_with_list_input(const User &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void UserApiImpl::delete_user(const std::string &username, Pistache::Http::ResponseWriter &response) { @@ -44,7 +44,7 @@ void UserApiImpl::login_user(const Optional &username, const Option void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } diff --git a/samples/server/petstore/pistache-server/impl/UserApiImpl.h b/samples/server/petstore/pistache-server/impl/UserApiImpl.h index d5f928ccafa..c10294fe97e 100644 --- a/samples/server/petstore/pistache-server/impl/UserApiImpl.h +++ b/samples/server/petstore/pistache-server/impl/UserApiImpl.h @@ -29,7 +29,6 @@ #include "User.h" #include -#include namespace io { namespace swagger { @@ -43,14 +42,14 @@ public: UserApiImpl(Pistache::Address addr); ~UserApiImpl() { }; - void create_user(const User &body, Pistache::Http::ResponseWriter &response); - void create_users_with_array_input(const User &body, Pistache::Http::ResponseWriter &response); - void create_users_with_list_input(const User &body, Pistache::Http::ResponseWriter &response); + void create_user(const User &user, Pistache::Http::ResponseWriter &response); + void create_users_with_array_input(const User &user, Pistache::Http::ResponseWriter &response); + void create_users_with_list_input(const User &user, Pistache::Http::ResponseWriter &response); void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response); void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response); void login_user(const Optional &username, const Optional &password, Pistache::Http::ResponseWriter &response); void logout_user(Pistache::Http::ResponseWriter &response); - void update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response); + void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response); }; diff --git a/samples/server/petstore/pistache-server/model/Order.cpp b/samples/server/petstore/pistache-server/model/Order.cpp index d1a94778deb..bbd9c5383c7 100644 --- a/samples/server/petstore/pistache-server/model/Order.cpp +++ b/samples/server/petstore/pistache-server/model/Order.cpp @@ -194,7 +194,7 @@ void Order::unsetStatus() { m_StatusIsSet = false; } -bool Order::getComplete() const +bool Order::isComplete() const { return m_Complete; } diff --git a/samples/server/petstore/pistache-server/model/Order.h b/samples/server/petstore/pistache-server/model/Order.h index 3872543e459..d2512dd8f8f 100644 --- a/samples/server/petstore/pistache-server/model/Order.h +++ b/samples/server/petstore/pistache-server/model/Order.h @@ -87,7 +87,7 @@ public: /// /// /// - bool getComplete() const; + bool isComplete() const; void setComplete(bool value); bool completeIsSet() const; void unsetComplete();