mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 14:40:53 +00:00
add tests for cpp-restsdk client (#21305)
This commit is contained in:
parent
cdef985ca7
commit
5ec4e4c8f1
@ -865,4 +865,13 @@ components:
|
|||||||
perPage:
|
perPage:
|
||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
|
reference_test:
|
||||||
|
type: array
|
||||||
|
readOnly: true
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/UUID"
|
||||||
|
UUID:
|
||||||
|
format: "uuid"
|
||||||
|
pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
|
||||||
|
type: "string"
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "CppRestPetstoreClient/ModelBase.h"
|
#include "CppRestPetstoreClient/ModelBase.h"
|
||||||
|
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace org {
|
namespace org {
|
||||||
namespace openapitools {
|
namespace openapitools {
|
||||||
@ -62,6 +64,11 @@ public:
|
|||||||
void unsetPerPage();
|
void unsetPerPage();
|
||||||
void setPerPage(int32_t value);
|
void setPerPage(int32_t value);
|
||||||
|
|
||||||
|
std::vector<utility::string_t> getReferenceTest() const;
|
||||||
|
bool referenceTestIsSet() const;
|
||||||
|
void unsetReference_test();
|
||||||
|
void setReferenceTest(const std::vector<utility::string_t>& value);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int32_t m_Page;
|
int32_t m_Page;
|
||||||
@ -70,6 +77,9 @@ protected:
|
|||||||
int32_t m_PerPage;
|
int32_t m_PerPage;
|
||||||
bool m_PerPageIsSet;
|
bool m_PerPageIsSet;
|
||||||
|
|
||||||
|
std::vector<utility::string_t> m_Reference_test;
|
||||||
|
bool m_Reference_testIsSet;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ Page::Page()
|
|||||||
m_PageIsSet = false;
|
m_PageIsSet = false;
|
||||||
m_PerPage = 0;
|
m_PerPage = 0;
|
||||||
m_PerPageIsSet = false;
|
m_PerPageIsSet = false;
|
||||||
|
m_Reference_testIsSet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Page::~Page()
|
Page::~Page()
|
||||||
@ -48,6 +49,11 @@ web::json::value Page::toJson() const
|
|||||||
|
|
||||||
val[utility::conversions::to_string_t(_XPLATSTR("perPage"))] = ModelBase::toJson(m_PerPage);
|
val[utility::conversions::to_string_t(_XPLATSTR("perPage"))] = ModelBase::toJson(m_PerPage);
|
||||||
}
|
}
|
||||||
|
if(m_Reference_testIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(_XPLATSTR("reference_test"))] = ModelBase::toJson(m_Reference_test);
|
||||||
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@ -77,6 +83,17 @@ bool Page::fromJson(const web::json::value& val)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(val.has_field(utility::conversions::to_string_t(_XPLATSTR("reference_test"))))
|
||||||
|
{
|
||||||
|
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(_XPLATSTR("reference_test")));
|
||||||
|
if(!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::vector<utility::string_t> refVal_setReferenceTest;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setReferenceTest);
|
||||||
|
setReferenceTest(refVal_setReferenceTest);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +112,10 @@ void Page::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utili
|
|||||||
{
|
{
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(_XPLATSTR("perPage")), m_PerPage));
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(_XPLATSTR("perPage")), m_PerPage));
|
||||||
}
|
}
|
||||||
|
if(m_Reference_testIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(_XPLATSTR("reference_test")), m_Reference_test));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Page::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
bool Page::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
||||||
@ -118,6 +139,12 @@ bool Page::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const uti
|
|||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(_XPLATSTR("perPage"))), refVal_setPerPage );
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(_XPLATSTR("perPage"))), refVal_setPerPage );
|
||||||
setPerPage(refVal_setPerPage);
|
setPerPage(refVal_setPerPage);
|
||||||
}
|
}
|
||||||
|
if(multipart->hasContent(utility::conversions::to_string_t(_XPLATSTR("reference_test"))))
|
||||||
|
{
|
||||||
|
std::vector<utility::string_t> refVal_setReferenceTest;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(_XPLATSTR("reference_test"))), refVal_setReferenceTest );
|
||||||
|
setReferenceTest(refVal_setReferenceTest);
|
||||||
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,6 +189,27 @@ void Page::unsetPerPage()
|
|||||||
{
|
{
|
||||||
m_PerPageIsSet = false;
|
m_PerPageIsSet = false;
|
||||||
}
|
}
|
||||||
|
std::vector<utility::string_t> Page::getReferenceTest() const
|
||||||
|
{
|
||||||
|
return m_Reference_test;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Page::setReferenceTest(const std::vector<utility::string_t>& value)
|
||||||
|
{
|
||||||
|
m_Reference_test = value;
|
||||||
|
m_Reference_testIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Page::referenceTestIsSet() const
|
||||||
|
{
|
||||||
|
return m_Reference_testIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Page::unsetReference_test()
|
||||||
|
{
|
||||||
|
m_Reference_testIsSet = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user