Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public:
static utility::string_t parameterToString(utility::string_t value);
static utility::string_t parameterToString(int32_t value);
static utility::string_t parameterToString(int64_t value);
static utility::string_t parameterToString(const utility::datetime &value);

template<class T>
static utility::string_t parameterToArrayString(std::vector<T> value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ utility::string_t ApiClient::parameterToString(int32_t 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));
}

pplx::task<web::http::http_response> ApiClient::callApi(
const utility::string_t& path,
const utility::string_t& method,
Expand Down
5 changes: 5 additions & 0 deletions samples/client/petstore/cpprest/ApiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ utility::string_t ApiClient::parameterToString(int32_t 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));
}

pplx::task<web::http::http_response> ApiClient::callApi(
const utility::string_t& path,
const utility::string_t& method,
Expand Down
1 change: 1 addition & 0 deletions samples/client/petstore/cpprest/ApiClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ApiClient
static utility::string_t parameterToString(utility::string_t value);
static utility::string_t parameterToString(int32_t value);
static utility::string_t parameterToString(int64_t value);
static utility::string_t parameterToString(const utility::datetime &value);

template<class T>
static utility::string_t parameterToArrayString(std::vector<T> value)
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpprest/api/PetApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByTags(std::vector


{
queryParams[U("tags")] = ApiClient::parameterToArrayString<utility::string_t>(tags);
queryParams[U("tags")] = ApiClient::parameterToArrayString<>(tags);
}

std::shared_ptr<IHttpBody> httpBody;
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/api/PetApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

#include "ApiClient.h"

#include "ApiResponse.h"
#include "HttpContent.h"
#include "Pet.h"
#include <cpprest/details/basic_types.h>
#include "ApiResponse.h"
#include "HttpContent.h"

namespace io {
namespace swagger {
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/api/StoreApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

#include "ApiClient.h"

#include "Order.h"
#include <map>
#include <cpprest/details/basic_types.h>
#include <map>
#include "Order.h"

namespace io {
namespace swagger {
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpprest/model/Category.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace model {

Category::Category()
{
m_Id = 0;
m_Id = 0L;
m_IdIsSet = false;
m_Name = U("");
m_NameIsSet = false;
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/model/Order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ namespace model {

Order::Order()
{
m_Id = 0;
m_Id = 0L;
m_IdIsSet = false;
m_PetId = 0;
m_PetId = 0L;
m_PetIdIsSet = false;
m_Quantity = 0;
m_QuantityIsSet = false;
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpprest/model/Pet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace model {

Pet::Pet()
{
m_Id = 0;
m_Id = 0L;
m_IdIsSet = false;
m_CategoryIsSet = false;
m_Name = U("");
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/model/Pet.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

#include "ModelBase.h"

#include "Category.h"
#include "Tag.h"
#include <cpprest/details/basic_types.h>
#include "Category.h"
#include <vector>
#include "Tag.h"

namespace io {
namespace swagger {
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpprest/model/Tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace model {

Tag::Tag()
{
m_Id = 0;
m_Id = 0L;
m_IdIsSet = false;
m_Name = U("");
m_NameIsSet = false;
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpprest/model/User.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace model {

User::User()
{
m_Id = 0;
m_Id = 0L;
m_IdIsSet = false;
m_Username = U("");
m_UsernameIsSet = false;
Expand Down