From bad1885b4724f39a4c7946b0f90ab028b8085753 Mon Sep 17 00:00:00 2001 From: murzic4 Date: Mon, 2 Apr 2018 11:44:09 +0300 Subject: [PATCH] fix #7906 [cpprest] add parameterToString for number type with unspecified format (double) (#7929) --- .../src/main/resources/cpprest/apiclient-header.mustache | 1 + .../src/main/resources/cpprest/apiclient-source.mustache | 5 +++++ samples/client/petstore/cpprest/ApiClient.cpp | 5 +++++ samples/client/petstore/cpprest/ApiClient.h | 1 + 4 files changed, 12 insertions(+) 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 3ab4f8eced2..23bc7633171 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-header.mustache @@ -39,6 +39,7 @@ public: static utility::string_t parameterToString(int32_t value); static utility::string_t parameterToString(int64_t value); static utility::string_t parameterToString(float value); + static utility::string_t parameterToString(double value); static utility::string_t parameterToString(const utility::datetime &value); template static utility::string_t parameterToString(const std::vector& value); diff --git a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache index fae8c4c70b3..e5a1500c8d5 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache @@ -49,6 +49,11 @@ utility::string_t ApiClient::parameterToString(float value) return utility::conversions::to_string_t(std::to_string(value)); } +utility::string_t ApiClient::parameterToString(double value) +{ + return utility::conversions::to_string_t(std::to_string(value)); +} + utility::string_t ApiClient::parameterToString(const utility::datetime &value) { return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601)); diff --git a/samples/client/petstore/cpprest/ApiClient.cpp b/samples/client/petstore/cpprest/ApiClient.cpp index 346479cc1b8..5de6a5dee77 100644 --- a/samples/client/petstore/cpprest/ApiClient.cpp +++ b/samples/client/petstore/cpprest/ApiClient.cpp @@ -61,6 +61,11 @@ utility::string_t ApiClient::parameterToString(float value) return utility::conversions::to_string_t(std::to_string(value)); } +utility::string_t ApiClient::parameterToString(double value) +{ + return utility::conversions::to_string_t(std::to_string(value)); +} + utility::string_t ApiClient::parameterToString(const utility::datetime &value) { return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601)); diff --git a/samples/client/petstore/cpprest/ApiClient.h b/samples/client/petstore/cpprest/ApiClient.h index 1dba60fc591..b4eaadbcf02 100644 --- a/samples/client/petstore/cpprest/ApiClient.h +++ b/samples/client/petstore/cpprest/ApiClient.h @@ -51,6 +51,7 @@ public: static utility::string_t parameterToString(int32_t value); static utility::string_t parameterToString(int64_t value); static utility::string_t parameterToString(float value); + static utility::string_t parameterToString(double value); static utility::string_t parameterToString(const utility::datetime &value); template static utility::string_t parameterToString(const std::vector& value);