From 6ede532f1314a1db3b67f1695494b18b56f9b120 Mon Sep 17 00:00:00 2001 From: "Mateusz Szychowski (Muttley)" Date: Thu, 5 Sep 2019 14:34:17 +0200 Subject: [PATCH] [C++][Pistache] Update Petstore sample --- .../petstore/cpp-pistache/.openapi-generator/VERSION | 2 +- samples/server/petstore/cpp-pistache/model/Pet.cpp | 12 ++++++++++-- samples/server/petstore/cpp-pistache/model/Pet.h | 6 ++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 83a328a9227e..d1a8f58b3884 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/model/Pet.cpp b/samples/server/petstore/cpp-pistache/model/Pet.cpp index 1bceb861ad48..0ff016b545f0 100644 --- a/samples/server/petstore/cpp-pistache/model/Pet.cpp +++ b/samples/server/petstore/cpp-pistache/model/Pet.cpp @@ -48,7 +48,7 @@ void to_json(nlohmann::json& j, const Pet& o) j["category"] = o.m_Category; j["name"] = o.m_Name; j["photoUrls"] = o.m_PhotoUrls; - if(o.tagsIsSet()) + if(o.tagsIsSet() || !o.m_Tags.empty()) j["tags"] = o.m_Tags; if(o.statusIsSet()) j["status"] = o.m_Status; @@ -121,16 +121,24 @@ std::string Pet::getName() const void Pet::setName(std::string const& value) { m_Name = value; - } std::vector& Pet::getPhotoUrls() { return m_PhotoUrls; } +void Pet::setPhotoUrls(std::vector const& value) +{ + m_PhotoUrls = value; +} std::vector& Pet::getTags() { return m_Tags; } +void Pet::setTags(std::vector const& value) +{ + m_Tags = value; + m_TagsIsSet = true; +} bool Pet::tagsIsSet() const { return m_TagsIsSet; diff --git a/samples/server/petstore/cpp-pistache/model/Pet.h b/samples/server/petstore/cpp-pistache/model/Pet.h index f23ef47832d2..eddf475f6ee3 100644 --- a/samples/server/petstore/cpp-pistache/model/Pet.h +++ b/samples/server/petstore/cpp-pistache/model/Pet.h @@ -63,14 +63,16 @@ class Pet /// std::string getName() const; void setName(std::string const& value); - /// + /// /// /// std::vector& getPhotoUrls(); - /// + void setPhotoUrls(std::vector const& value); + /// /// /// std::vector& getTags(); + void setTags(std::vector const& value); bool tagsIsSet() const; void unsetTags(); ///