diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-header.mustache index caa67d3509b..09f02a21873 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-header.mustache @@ -49,6 +49,8 @@ public: static utility::string_t parameterToString(const utility::datetime &value); template static utility::string_t parameterToString(const std::vector& value); + template + static utility::string_t parameterToString(const std::shared_ptr& value); pplx::task callApi( const utility::string_t& path, @@ -81,6 +83,13 @@ utility::string_t ApiClient::parameterToString(const std::vector& value) return ss.str(); } +template +utility::string_t ApiClient::parameterToString(const std::shared_ptr& value) +{ + return parameterToString(*value.get()); +} + + {{#apiNamespaceDeclarations}} } {{/apiNamespaceDeclarations}} diff --git a/samples/client/petstore/cpp-restsdk/ApiClient.h b/samples/client/petstore/cpp-restsdk/ApiClient.h index 2802a7a81c6..28f7ce974f0 100644 --- a/samples/client/petstore/cpp-restsdk/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/ApiClient.h @@ -60,6 +60,8 @@ public: static utility::string_t parameterToString(const utility::datetime &value); template static utility::string_t parameterToString(const std::vector& value); + template + static utility::string_t parameterToString(const std::shared_ptr& value); pplx::task callApi( const utility::string_t& path, @@ -92,6 +94,13 @@ utility::string_t ApiClient::parameterToString(const std::vector& value) return ss.str(); } +template +utility::string_t ApiClient::parameterToString(const std::shared_ptr& value) +{ + return parameterToString(*value.get()); +} + + } } }