-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong include path in api-header template (#3062)
Change local json.hpp include path to correct value. Update samples.
- Loading branch information
Showing
6 changed files
with
349 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/server/petstore/cpp-pistache/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.0.1-SNAPSHOT | ||
4.0.2-SNAPSHOT |
101 changes: 101 additions & 0 deletions
101
samples/server/petstore/cpp-pistache/model/Inline_object.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
73 changes: 73 additions & 0 deletions
73
samples/server/petstore/cpp-pistache/model/Inline_object.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* 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. | ||
*/ | ||
/* | ||
* Inline_object.h | ||
* | ||
* | ||
*/ | ||
|
||
#ifndef Inline_object_H_ | ||
#define Inline_object_H_ | ||
|
||
|
||
#include <string> | ||
#include <nlohmann/json.hpp> | ||
|
||
namespace org { | ||
namespace openapitools { | ||
namespace server { | ||
namespace model { | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
class Inline_object | ||
{ | ||
public: | ||
Inline_object(); | ||
virtual ~Inline_object(); | ||
|
||
void validate(); | ||
|
||
///////////////////////////////////////////// | ||
/// Inline_object members | ||
|
||
/// <summary> | ||
/// Updated name of the pet | ||
/// </summary> | ||
std::string getName() const; | ||
void setName(std::string const& value); | ||
bool nameIsSet() const; | ||
void unsetName(); | ||
/// <summary> | ||
/// Updated status of the pet | ||
/// </summary> | ||
std::string getStatus() const; | ||
void setStatus(std::string const& value); | ||
bool statusIsSet() const; | ||
void unsetStatus(); | ||
|
||
friend void to_json(nlohmann::json& j, const Inline_object& o); | ||
friend void from_json(const nlohmann::json& j, Inline_object& o); | ||
protected: | ||
std::string m_Name; | ||
bool m_NameIsSet; | ||
std::string m_Status; | ||
bool m_StatusIsSet; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
#endif /* Inline_object_H_ */ |
100 changes: 100 additions & 0 deletions
100
samples/server/petstore/cpp-pistache/model/Inline_object_1.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/** | ||
* 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_1.h" | ||
|
||
namespace org { | ||
namespace openapitools { | ||
namespace server { | ||
namespace model { | ||
|
||
Inline_object_1::Inline_object_1() | ||
{ | ||
m_AdditionalMetadata = ""; | ||
m_AdditionalMetadataIsSet = false; | ||
m_fileIsSet = false; | ||
|
||
} | ||
|
||
Inline_object_1::~Inline_object_1() | ||
{ | ||
} | ||
|
||
void Inline_object_1::validate() | ||
{ | ||
// TODO: implement validation | ||
} | ||
|
||
void to_json(nlohmann::json& j, const Inline_object_1& o) | ||
{ | ||
j = nlohmann::json(); | ||
if(o.additionalMetadataIsSet()) | ||
j["additionalMetadata"] = o.m_AdditionalMetadata; | ||
if(o.fileIsSet()) | ||
j["file"] = o.m_file; | ||
} | ||
|
||
void from_json(const nlohmann::json& j, Inline_object_1& o) | ||
{ | ||
if(j.contains("additionalMetadata")) | ||
{ | ||
j.at("additionalMetadata").get_to(o.m_AdditionalMetadata); | ||
o.m_AdditionalMetadataIsSet = true; | ||
} | ||
if(j.contains("file")) | ||
{ | ||
j.at("file").get_to(o.m_file); | ||
o.m_fileIsSet = true; | ||
} | ||
} | ||
|
||
std::string Inline_object_1::getAdditionalMetadata() const | ||
{ | ||
return m_AdditionalMetadata; | ||
} | ||
void Inline_object_1::setAdditionalMetadata(std::string const& value) | ||
{ | ||
m_AdditionalMetadata = value; | ||
m_AdditionalMetadataIsSet = true; | ||
} | ||
bool Inline_object_1::additionalMetadataIsSet() const | ||
{ | ||
return m_AdditionalMetadataIsSet; | ||
} | ||
void Inline_object_1::unsetAdditionalMetadata() | ||
{ | ||
m_AdditionalMetadataIsSet = false; | ||
} | ||
std::string Inline_object_1::getFile() const | ||
{ | ||
return m_file; | ||
} | ||
void Inline_object_1::setFile(std::string const& value) | ||
{ | ||
m_file = value; | ||
m_fileIsSet = true; | ||
} | ||
bool Inline_object_1::fileIsSet() const | ||
{ | ||
return m_fileIsSet; | ||
} | ||
void Inline_object_1::unsetfile() | ||
{ | ||
m_fileIsSet = false; | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
73 changes: 73 additions & 0 deletions
73
samples/server/petstore/cpp-pistache/model/Inline_object_1.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* 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. | ||
*/ | ||
/* | ||
* Inline_object_1.h | ||
* | ||
* | ||
*/ | ||
|
||
#ifndef Inline_object_1_H_ | ||
#define Inline_object_1_H_ | ||
|
||
|
||
#include <string> | ||
#include <nlohmann/json.hpp> | ||
|
||
namespace org { | ||
namespace openapitools { | ||
namespace server { | ||
namespace model { | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
class Inline_object_1 | ||
{ | ||
public: | ||
Inline_object_1(); | ||
virtual ~Inline_object_1(); | ||
|
||
void validate(); | ||
|
||
///////////////////////////////////////////// | ||
/// Inline_object_1 members | ||
|
||
/// <summary> | ||
/// Additional data to pass to server | ||
/// </summary> | ||
std::string getAdditionalMetadata() const; | ||
void setAdditionalMetadata(std::string const& value); | ||
bool additionalMetadataIsSet() const; | ||
void unsetAdditionalMetadata(); | ||
/// <summary> | ||
/// file to upload | ||
/// </summary> | ||
std::string getFile() const; | ||
void setFile(std::string const& value); | ||
bool fileIsSet() const; | ||
void unsetfile(); | ||
|
||
friend void to_json(nlohmann::json& j, const Inline_object_1& o); | ||
friend void from_json(const nlohmann::json& j, Inline_object_1& o); | ||
protected: | ||
std::string m_AdditionalMetadata; | ||
bool m_AdditionalMetadataIsSet; | ||
std::string m_file; | ||
bool m_fileIsSet; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
#endif /* Inline_object_1_H_ */ |