forked from loafle/openapi-generator-original
[C++][Pistache] Add compatibility for nlohmann-json 3.5.0 (#3306)
* [C++][Pistache] Replace contains with find on json object This makes generator compatible with nlohmann-json 3.5.0 * [C++][Pistache] Update Petstore sample
This commit is contained in:
committed by
Stefan Krismann
parent
4843dfc244
commit
c1df082d65
@@ -51,17 +51,17 @@ void to_json(nlohmann::json& j, const ApiResponse& o)
|
||||
|
||||
void from_json(const nlohmann::json& j, ApiResponse& o)
|
||||
{
|
||||
if(j.contains("code"))
|
||||
if(j.find("code") != j.end())
|
||||
{
|
||||
j.at("code").get_to(o.m_Code);
|
||||
o.m_CodeIsSet = true;
|
||||
}
|
||||
if(j.contains("type"))
|
||||
if(j.find("type") != j.end())
|
||||
{
|
||||
j.at("type").get_to(o.m_Type);
|
||||
o.m_TypeIsSet = true;
|
||||
}
|
||||
if(j.contains("message"))
|
||||
if(j.find("message") != j.end())
|
||||
{
|
||||
j.at("message").get_to(o.m_Message);
|
||||
o.m_MessageIsSet = true;
|
||||
|
||||
Reference in New Issue
Block a user