forked from loafle/openapi-generator-original
Fix wrong include path in api-header template (#3062)
Change local json.hpp include path to correct value. Update samples.
This commit is contained in:
committed by
William Cheng
parent
8d9eb5ba54
commit
1eca97f738
101
samples/server/petstore/cpp-pistache/model/Inline_object.cpp
Normal file
101
samples/server/petstore/cpp-pistache/model/Inline_object.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Inline_object.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
Inline_object::Inline_object()
|
||||
{
|
||||
m_Name = "";
|
||||
m_NameIsSet = false;
|
||||
m_Status = "";
|
||||
m_StatusIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
Inline_object::~Inline_object()
|
||||
{
|
||||
}
|
||||
|
||||
void Inline_object::validate()
|
||||
{
|
||||
// TODO: implement validation
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Inline_object& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
if(o.nameIsSet())
|
||||
j["name"] = o.m_Name;
|
||||
if(o.statusIsSet())
|
||||
j["status"] = o.m_Status;
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Inline_object& o)
|
||||
{
|
||||
if(j.contains("name"))
|
||||
{
|
||||
j.at("name").get_to(o.m_Name);
|
||||
o.m_NameIsSet = true;
|
||||
}
|
||||
if(j.contains("status"))
|
||||
{
|
||||
j.at("status").get_to(o.m_Status);
|
||||
o.m_StatusIsSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Inline_object::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
void Inline_object::setName(std::string const& value)
|
||||
{
|
||||
m_Name = value;
|
||||
m_NameIsSet = true;
|
||||
}
|
||||
bool Inline_object::nameIsSet() const
|
||||
{
|
||||
return m_NameIsSet;
|
||||
}
|
||||
void Inline_object::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
std::string Inline_object::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
void Inline_object::setStatus(std::string const& value)
|
||||
{
|
||||
m_Status = value;
|
||||
m_StatusIsSet = true;
|
||||
}
|
||||
bool Inline_object::statusIsSet() const
|
||||
{
|
||||
return m_StatusIsSet;
|
||||
}
|
||||
void Inline_object::unsetStatus()
|
||||
{
|
||||
m_StatusIsSet = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user