diff --git a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache index d55a7ef020f..9ed43b62dc5 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache @@ -125,20 +125,6 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r {{/isContainer}} {{/required}} { - {{#isContainer}} - {{#isQueryParam}} - queryParams[utility::conversions::to_string_t("{{baseName}}")] = ApiClient::parameterToArrayString<{{items.datatype}}>({{^required}}*{{/required}}{{paramName}}); - {{/isQueryParam}} - {{#isHeaderParam}} - headerParams[utility::conversions::to_string_t("{{baseName}}")] = ApiClient::parameterToArrayString<{{items.datatype}}>({{^required}}*{{/required}}{{paramName}}); - {{/isHeaderParam}} - {{#isFormParam}} - {{^isFile}} - formParams[ utility::conversions::to_string_t("{{baseName}}") ] = ApiClient::parameterToArrayString<{{items.datatype}}>({{^required}}*{{/required}}{{paramName}}); - {{/isFile}} - {{/isFormParam}} - {{/isContainer}} - {{^isContainer}} {{#isQueryParam}} queryParams[utility::conversions::to_string_t("{{baseName}}")] = ApiClient::parameterToString({{^required}}*{{/required}}{{paramName}}); {{/isQueryParam}} @@ -153,7 +139,6 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r formParams[ utility::conversions::to_string_t("{{baseName}}") ] = ApiClient::parameterToString({{^required}}*{{/required}}{{paramName}}); {{/isFile}} {{/isFormParam}} - {{/isContainer}} } {{/isPathParam}} {{/isBodyParam}} @@ -187,8 +172,9 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r json = web::json::value::array(jsonArray); } {{/isListContainer}} - {{^isListContainer}} - json = ModelBase::toJson({{paramName}}); + {{^isListContainer}}{{#required}}json = ModelBase::toJson({{paramName}}); + {{/required}}{{^required}}if ({{paramName}}) + json = ModelBase::toJson(*{{paramName}});{{/required}} {{/isListContainer}} {{/isPrimitiveType}} @@ -217,15 +203,11 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r {{/items.isDateTime}}{{/items.isString}}{{/items.isPrimitiveType}} } multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("{{paramName}}"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); - } - {{/isListContainer}} - {{^isListContainer}} - {{#isString}}multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("{{paramName}}"), {{paramName}})); - {{/isString}} - {{^isString}} - if({{paramName}}.get()) + }{{/isListContainer}} + {{^isListContainer}}{{#isString}}multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("{{paramName}}"), {{paramName}})); + {{/isString}}{{^isString}}if({{^required}}{{paramName}} && (*{{paramName}}){{/required}}{{#required}}{{paramName}}{{/required}}.get()) { - {{paramName}}->toMultipart(multipart, utility::conversions::to_string_t("{{paramName}}")); + {{^required}}(*{{/required}}{{paramName}}{{^required}}){{/required}}->toMultipart(multipart, utility::conversions::to_string_t("{{paramName}}")); } {{/isString}} {{/isListContainer}} @@ -345,8 +327,9 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r result[item.first] = itemObj; {{/vendorExtensions.x-codegen-response.items.isString}}{{/vendorExtensions.x-codegen-response.items.isPrimitiveType}} } - {{/isMapContainer}}{{^isMapContainer}}{{#vendorExtensions.x-codegen-response.isPrimitiveType}}result = ModelBase::{{vendorExtensions.x-codegen-response.items.datatype}}FromJson(json); - {{/vendorExtensions.x-codegen-response.isPrimitiveType}}{{^vendorExtensions.x-codegen-response.isPrimitiveType}}{{#vendorExtensions.x-codegen-response.isString}}result = ModelBase::stringFromJson(json); + {{/isMapContainer}}{{^isMapContainer}}{{#vendorExtensions.x-codegen-response.isPrimitiveType}}{{#vendorExtensions.x-codegen-response.items.datatype}}result = ModelBase::{{vendorExtensions.x-codegen-response.items.datatype}}FromJson(json); + {{/vendorExtensions.x-codegen-response.items.datatype}}{{^vendorExtensions.x-codegen-response.items.datatype}}result = ModelBase::{{vendorExtensions.x-codegen-response.datatype}}FromJson(json); + {{/vendorExtensions.x-codegen-response.items.datatype}}{{/vendorExtensions.x-codegen-response.isPrimitiveType}}{{^vendorExtensions.x-codegen-response.isPrimitiveType}}{{#vendorExtensions.x-codegen-response.isString}}result = ModelBase::stringFromJson(json); {{/vendorExtensions.x-codegen-response.isString}}{{^vendorExtensions.x-codegen-response.isString}}result->fromJson(json);{{/vendorExtensions.x-codegen-response.isString}}{{/vendorExtensions.x-codegen-response.isPrimitiveType}}{{/isMapContainer}}{{/isListContainer}} }{{#vendorExtensions.x-codegen-response.isString}} else if(responseHttpContentType == utility::conversions::to_string_t("text/plain")) diff --git a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-header.mustache b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-header.mustache index 72b2c53671b..3ab4f8eced2 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-header.mustache @@ -40,20 +40,8 @@ public: static utility::string_t parameterToString(int64_t value); static utility::string_t parameterToString(float value); static utility::string_t parameterToString(const utility::datetime &value); - template - static utility::string_t parameterToArrayString(std::vector value) - { - utility::stringstream_t ss; - - for( size_t i = 0; i < value.size(); i++) - { - if( i > 0) ss << utility::conversions::to_string_t(", "); - ss << ApiClient::parameterToString(value[i]); - } - - return ss.str(); - } + static utility::string_t parameterToString(const std::vector& value); pplx::task callApi( const utility::string_t& path, @@ -71,6 +59,20 @@ protected: std::shared_ptr m_Configuration; }; +template +utility::string_t ApiClient::parameterToString(const std::vector& value) +{ + utility::stringstream_t ss; + + for( size_t i = 0; i < value.size(); i++) + { + if( i > 0) ss << utility::conversions::to_string_t(", "); + ss << ApiClient::parameterToString(value[i]); + } + + return ss.str(); +} + {{#apiNamespaceDeclarations}} } {{/apiNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/cpprest/modelbase-header.mustache b/modules/swagger-codegen/src/main/resources/cpprest/modelbase-header.mustache index a68bc0cc227..83271bf79d9 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/modelbase-header.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/modelbase-header.mustache @@ -15,6 +15,8 @@ #include #include +#include + {{#modelNamespaceDeclarations}} namespace {{this}} { {{/modelNamespaceDeclarations}} @@ -41,6 +43,8 @@ public: static web::json::value toJson( int64_t value ); static web::json::value toJson( double value ); static web::json::value toJson( bool value ); + template + static web::json::value toJson(const std::vector& value); static int64_t int64_tFromJson(web::json::value& val); static int32_t int32_tFromJson(web::json::value& val); @@ -58,6 +62,8 @@ public: static std::shared_ptr toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static std::shared_ptr toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static std::shared_ptr toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static int64_t int64_tFromHttpContent(std::shared_ptr val); static int32_t int32_tFromHttpContent(std::shared_ptr val); @@ -74,6 +80,27 @@ public: static std::shared_ptr fromBase64( const utility::string_t& encoded ); }; +template +web::json::value ModelBase::toJson(const std::vector& value) { + std::vector ret; + for (auto& x : value) { + ret.push_back(toJson(x)); + } + + return web::json::value::array(ret); +} + +template +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType ) { + web::json::value json_array = ModelBase::toJson(value); + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(json_array.serialize()) ) ) ); + return content; +} + {{#modelNamespaceDeclarations}} } {{/modelNamespaceDeclarations}} diff --git a/samples/client/petstore/cpprest/.swagger-codegen/VERSION b/samples/client/petstore/cpprest/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 100644 --- a/samples/client/petstore/cpprest/.swagger-codegen/VERSION +++ b/samples/client/petstore/cpprest/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.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 868b78c8521..346479cc1b8 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 4b6877e04b3..1dba60fc591 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -52,20 +52,8 @@ public: static utility::string_t parameterToString(int64_t value); static utility::string_t parameterToString(float value); static utility::string_t parameterToString(const utility::datetime &value); - template - static utility::string_t parameterToArrayString(std::vector value) - { - utility::stringstream_t ss; - - for( size_t i = 0; i < value.size(); i++) - { - if( i > 0) ss << utility::conversions::to_string_t(", "); - ss << ApiClient::parameterToString(value[i]); - } - - return ss.str(); - } + static utility::string_t parameterToString(const std::vector& value); pplx::task callApi( const utility::string_t& path, @@ -83,6 +71,20 @@ protected: std::shared_ptr m_Configuration; }; +template +utility::string_t ApiClient::parameterToString(const std::vector& value) +{ + utility::stringstream_t ss; + + for( size_t i = 0; i < value.size(); i++) + { + if( i > 0) ss << utility::conversions::to_string_t(", "); + ss << ApiClient::parameterToString(value[i]); + } + + return ss.str(); +} + } } } diff --git a/samples/client/petstore/cpprest/ApiConfiguration.cpp b/samples/client/petstore/cpprest/ApiConfiguration.cpp index 5baa1e79483..a0609f9fb38 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 d5d22d8fb66..eca76ad99fd 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 92b13730ce9..6626508f9b8 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 b5dcdadb87c..83a727d9a27 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 5904c0371a6..ffe367a8500 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 dcbd4868e84..b64a3a29f4b 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 6d2a61bae3a..846d6e1fd30 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 5cde61314cd..7f8f0a249f7 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 a8960d94ad8..451faf59721 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 984e9f6e0a6..c48c9d53d6a 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 b68b7898ad0..df073ab99a8 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -26,6 +26,8 @@ #include #include +#include + namespace io { namespace swagger { namespace client { @@ -53,6 +55,8 @@ public: static web::json::value toJson( int64_t value ); static web::json::value toJson( double value ); static web::json::value toJson( bool value ); + template + static web::json::value toJson(const std::vector& value); static int64_t int64_tFromJson(web::json::value& val); static int32_t int32_tFromJson(web::json::value& val); @@ -70,6 +74,8 @@ public: static std::shared_ptr toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static std::shared_ptr toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static std::shared_ptr toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static int64_t int64_tFromHttpContent(std::shared_ptr val); static int32_t int32_tFromHttpContent(std::shared_ptr val); @@ -86,6 +92,27 @@ public: static std::shared_ptr fromBase64( const utility::string_t& encoded ); }; +template +web::json::value ModelBase::toJson(const std::vector& value) { + std::vector ret; + for (auto& x : value) { + ret.push_back(toJson(x)); + } + + return web::json::value::array(ret); +} + +template +std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType ) { + web::json::value json_array = ModelBase::toJson(value); + std::shared_ptr content( new HttpContent ); + content->setName( name ); + content->setContentDisposition( utility::conversions::to_string_t("form-data") ); + content->setContentType( contentType ); + content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(json_array.serialize()) ) ) ); + return content; +} + } } } diff --git a/samples/client/petstore/cpprest/MultipartFormData.cpp b/samples/client/petstore/cpprest/MultipartFormData.cpp index df86ee8d454..372f5bd73ef 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 6a259f43cbc..9a44b7d0b0d 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 985b229d8d1..9745f0f36f4 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 7b661929fb1..f3922f41e21 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -16,8 +16,8 @@ * This is the implementation of a JSON object. */ -#ifndef _Object_H_ -#define _Object_H_ +#ifndef IO_SWAGGER_CLIENT_MODEL_Object_H_ +#define IO_SWAGGER_CLIENT_MODEL_Object_H_ #include "ModelBase.h" @@ -60,4 +60,4 @@ private: } } -#endif /* _Object_H_ */ +#endif /* IO_SWAGGER_CLIENT_MODEL_Object_H_ */ diff --git a/samples/client/petstore/cpprest/api/PetApi.cpp b/samples/client/petstore/cpprest/api/PetApi.cpp index 966907bb680..8e83fd6f3f0 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -97,6 +97,7 @@ pplx::task PetApi::addPet(std::shared_ptr body) web::json::value json; json = ModelBase::toJson(body); + httpBody = std::shared_ptr( new JsonBody( json ) ); } @@ -105,7 +106,8 @@ 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(body.get()) { body->toMultipart(multipart, utility::conversions::to_string_t("body")); } @@ -301,7 +303,7 @@ pplx::task>> PetApi::findPetsByStatus(std::vect std::unordered_set consumeHttpContentTypes; { - queryParams[utility::conversions::to_string_t("status")] = ApiClient::parameterToArrayString(status); + queryParams[utility::conversions::to_string_t("status")] = ApiClient::parameterToString(status); } std::shared_ptr httpBody; @@ -427,7 +429,7 @@ pplx::task>> PetApi::findPetsByTags(std::vector std::unordered_set consumeHttpContentTypes; { - queryParams[utility::conversions::to_string_t("tags")] = ApiClient::parameterToArrayString(tags); + queryParams[utility::conversions::to_string_t("tags")] = ApiClient::parameterToString(tags); } std::shared_ptr httpBody; @@ -694,6 +696,7 @@ pplx::task PetApi::updatePet(std::shared_ptr body) web::json::value json; json = ModelBase::toJson(body); + httpBody = std::shared_ptr( new JsonBody( json ) ); } @@ -702,7 +705,8 @@ 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(body.get()) { body->toMultipart(multipart, utility::conversions::to_string_t("body")); } diff --git a/samples/client/petstore/cpprest/api/PetApi.h b/samples/client/petstore/cpprest/api/PetApi.h index 99b335bca77..caa23c3253d 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/api/StoreApi.cpp b/samples/client/petstore/cpprest/api/StoreApi.cpp index 03a10677b85..19699808b20 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -433,6 +433,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b web::json::value json; json = ModelBase::toJson(body); + httpBody = std::shared_ptr( new JsonBody( json ) ); } @@ -441,7 +442,8 @@ 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(body.get()) { body->toMultipart(multipart, utility::conversions::to_string_t("body")); } diff --git a/samples/client/petstore/cpprest/api/StoreApi.h b/samples/client/petstore/cpprest/api/StoreApi.h index 740d0673d62..9d1378d53b7 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/api/UserApi.cpp b/samples/client/petstore/cpprest/api/UserApi.cpp index 681d2ad2a16..0ce59b80a9f 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ @@ -95,6 +95,7 @@ pplx::task UserApi::createUser(std::shared_ptr body) web::json::value json; json = ModelBase::toJson(body); + httpBody = std::shared_ptr( new JsonBody( json ) ); } @@ -103,7 +104,8 @@ 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(body.get()) { body->toMultipart(multipart, utility::conversions::to_string_t("body")); } @@ -212,7 +214,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector( new JsonBody( json ) ); } // multipart formdata @@ -229,7 +231,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vectoradd(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); } - + httpBody = multipart; requestHttpContentType += utility::conversions::to_string_t("; boundary=") + multipart->getBoundary(); } @@ -334,7 +336,7 @@ pplx::task UserApi::createUsersWithListInput(std::vector( new JsonBody( json ) ); } // multipart formdata @@ -351,7 +353,7 @@ pplx::task UserApi::createUsersWithListInput(std::vectoradd(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); } - + httpBody = multipart; requestHttpContentType += utility::conversions::to_string_t("; boundary=") + multipart->getBoundary(); } @@ -893,6 +895,7 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr web::json::value json; json = ModelBase::toJson(body); + httpBody = std::shared_ptr( new JsonBody( json ) ); } @@ -901,7 +904,8 @@ 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(body.get()) { body->toMultipart(multipart, utility::conversions::to_string_t("body")); } diff --git a/samples/client/petstore/cpprest/api/UserApi.h b/samples/client/petstore/cpprest/api/UserApi.h index 83d80dfedc9..204718f71de 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpprest/git_push.sh b/samples/client/petstore/cpprest/git_push.sh index 35d20f1851d..bd57362e9ca 100644 --- a/samples/client/petstore/cpprest/git_push.sh +++ b/samples/client/petstore/cpprest/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/cpprest/model/ApiResponse.cpp b/samples/client/petstore/cpprest/model/ApiResponse.cpp index 7b51c7b94d5..9ccd6d5919a 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 5b78aa749ad..44966baf868 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 4362719cb9c..21a2dc52e74 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 eac7f30e718..02e19700126 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 60b30a9a46d..3a8326ae27b 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 d43f15994f0..69c4d0c4af5 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 f2e23fb8ea7..91fda09b52b 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 fd5b4040701..20925af7471 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 2594f8553d3..be77d315d13 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 27cc5958cf4..b08bb1e3039 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 53fe5e3fd87..26447b3bd03 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.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 d2272b03a20..fed0ff17978 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.3.0-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */