[C++][Client][C++ Rest SDK] Fix path parameters with format (#1987)

* Create parameterToString for shared_ptr<T>

* Update cpp-restsdk sample petstore client
This commit is contained in:
Daniel Miller 2019-01-30 18:47:00 -08:00 committed by William Cheng
parent f946492e7e
commit cbda3fad98
2 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,8 @@ public:
static utility::string_t parameterToString(const utility::datetime &value);
template<class T>
static utility::string_t parameterToString(const std::vector<T>& value);
template<class T>
static utility::string_t parameterToString(const std::shared_ptr<T>& value);
pplx::task<web::http::http_response> callApi(
const utility::string_t& path,
@ -81,6 +83,13 @@ utility::string_t ApiClient::parameterToString(const std::vector<T>& value)
return ss.str();
}
template<class T>
utility::string_t ApiClient::parameterToString(const std::shared_ptr<T>& value)
{
return parameterToString(*value.get());
}
{{#apiNamespaceDeclarations}}
}
{{/apiNamespaceDeclarations}}

View File

@ -60,6 +60,8 @@ public:
static utility::string_t parameterToString(const utility::datetime &value);
template<class T>
static utility::string_t parameterToString(const std::vector<T>& value);
template<class T>
static utility::string_t parameterToString(const std::shared_ptr<T>& value);
pplx::task<web::http::http_response> callApi(
const utility::string_t& path,
@ -92,6 +94,13 @@ utility::string_t ApiClient::parameterToString(const std::vector<T>& value)
return ss.str();
}
template<class T>
utility::string_t ApiClient::parameterToString(const std::shared_ptr<T>& value)
{
return parameterToString(*value.get());
}
}
}
}