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
@@ -47,12 +47,12 @@ void to_json(nlohmann::json& j, const Inline_object& o)
|
||||
|
||||
void from_json(const nlohmann::json& j, Inline_object& o)
|
||||
{
|
||||
if(j.contains("name"))
|
||||
if(j.find("name") != j.end())
|
||||
{
|
||||
j.at("name").get_to(o.m_Name);
|
||||
o.m_NameIsSet = true;
|
||||
}
|
||||
if(j.contains("status"))
|
||||
if(j.find("status") != j.end())
|
||||
{
|
||||
j.at("status").get_to(o.m_Status);
|
||||
o.m_StatusIsSet = true;
|
||||
|
||||
Reference in New Issue
Block a user