[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:
Mateusz Szychowski (Muttley)
2019-07-13 13:31:14 +02:00
committed by Stefan Krismann
parent 4843dfc244
commit c1df082d65
9 changed files with 30 additions and 30 deletions

View File

@@ -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;