forked from loafle/openapi-generator-original
Fix compilation on Windows (#6608)
This commit is contained in:
parent
9fdcbec64b
commit
31d05f3f48
@ -222,10 +222,9 @@ bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr<HttpCo
|
||||
{
|
||||
outVal = std::shared_ptr<HttpContent>(new HttpContent());
|
||||
}
|
||||
std::shared_ptr<utility::stringstream_t> ssptr = std::make_shared<utility::stringstream_t>(val);
|
||||
if(outVal != nullptr)
|
||||
{
|
||||
outVal->setData(ssptr);
|
||||
outVal->setData(std::shared_ptr<std::istream>(new std::stringstream(utility::conversions::to_utf8string(val))));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4,10 +4,10 @@
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
|
||||
OAIPetApiTests::OAIPetApiTests(std::string host, std::string basePath){
|
||||
OAIPetApiTests::OAIPetApiTests(utility::string_t host, utility::string_t basePath){
|
||||
apiconfiguration = std::make_shared<ApiConfiguration>();
|
||||
apiconfiguration->setBaseUrl(host + basePath);
|
||||
apiconfiguration->setUserAgent(U("OpenAPI Client"));
|
||||
apiconfiguration->setUserAgent(utility::conversions::to_string_t("OpenAPI Client"));
|
||||
apiclient = std::make_shared<ApiClient>(apiconfiguration);
|
||||
api = std::make_shared<PetApi>(apiclient);
|
||||
}
|
||||
@ -25,8 +25,8 @@ void OAIPetApiTests::runTests(){
|
||||
void OAIPetApiTests::testAddPet(){
|
||||
auto req = std::make_shared<Pet>();
|
||||
req->setId(12345);
|
||||
req->setName("cpprest-pet");
|
||||
req->setStatus(U("123"));
|
||||
req->setName(utility::conversions::to_string_t("cpprest-pet"));
|
||||
req->setStatus(utility::conversions::to_string_t("123"));
|
||||
|
||||
std::function<void()> responseCallback = []()
|
||||
{
|
||||
@ -49,7 +49,7 @@ void OAIPetApiTests::testAddPet(){
|
||||
|
||||
void OAIPetApiTests::testFindPetsByStatus(){
|
||||
auto req = std::vector<utility::string_t>();
|
||||
req.push_back(U("123"));
|
||||
req.push_back(utility::conversions::to_string_t("123"));
|
||||
auto reqTask = api->findPetsByStatus(req)
|
||||
.then([=](std::vector<std::shared_ptr<Pet>> pets)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ using namespace org::openapitools::client::api;
|
||||
class OAIPetApiTests
|
||||
{
|
||||
public:
|
||||
explicit OAIPetApiTests(std::string host = U("http://petstore.swagger.io"), std::string basePath = U("/v2"));
|
||||
explicit OAIPetApiTests(utility::string_t host = utility::conversions::to_string_t("http://petstore.swagger.io"), utility::string_t basePath = utility::conversions::to_string_t("/v2"));
|
||||
|
||||
virtual ~OAIPetApiTests();
|
||||
public:
|
||||
|
@ -233,10 +233,9 @@ bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr<HttpCo
|
||||
{
|
||||
outVal = std::shared_ptr<HttpContent>(new HttpContent());
|
||||
}
|
||||
std::shared_ptr<utility::stringstream_t> ssptr = std::make_shared<utility::stringstream_t>(val);
|
||||
if(outVal != nullptr)
|
||||
{
|
||||
outVal->setData(ssptr);
|
||||
outVal->setData(std::shared_ptr<std::istream>(new std::stringstream(utility::conversions::to_utf8string(val))));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user