File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/cpp-rest-sdk-client
samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424#include <cpprest /http_client.h >
2525
2626#include <memory >
27+ #include <map >
2728#include <vector >
2829#include <functional >
2930
Original file line number Diff line number Diff line change 3232#include < cpprest/http_client.h>
3333
3434#include < memory>
35+ #include < map>
3536#include < vector>
3637#include < functional>
3738
@@ -66,6 +67,8 @@ class ApiClient
6667 static utility::string_t parameterToString (const ModelBase& value);
6768 template <class T >
6869 static utility::string_t parameterToString (const std::vector<T>& value);
70+ template <class T , class U >
71+ static utility::string_t parameterToString (const std::map<T, U>& value);
6972 template <class T >
7073 static utility::string_t parameterToString (const std::shared_ptr<T>& value);
7174
@@ -100,6 +103,19 @@ utility::string_t ApiClient::parameterToString(const std::vector<T>& value)
100103 return ss.str ();
101104}
102105
106+ template <class T , class U >
107+ utility::string_t ApiClient::parameterToString (const std::map<T, U>& value)
108+ {
109+ utility::stringstream_t ss;
110+ ss << " {" ;
111+ for (const auto & pair : value)
112+ {
113+ ss << ApiClient::parameterToString (pair.first ) << " : " << ApiClient::parameterToString (pair.second ) << " , " ;
114+ }
115+ ss << " }" ;
116+ return ss.str ();
117+ }
118+
103119template <class T >
104120utility::string_t ApiClient::parameterToString (const std::shared_ptr<T>& value)
105121{
You can’t perform that action at this time.
0 commit comments