Marc Le Bihan 1fa2d474b4
[[BUG][C][cpp-restsdk] Missing Set.h when trying to generate from Twitter OpenAPI JSON #9969](https://github.com/OpenAPITools/openapi-generator/issues/9969) (#18631)
- Handling `std::set` in cpp-restdsk
    - Member variables using `std:set` added to `Pet` in cpp-restsdk 3.0 Petstore sample

[cpp-pistache-server] taking into account a remark on this issue about cpp-pistache-server and its set management

    - Switching `std::vector` to `std::set` for openapi set type in cpp-pistache-server
2024-05-15 14:51:59 +08:00

79 lines
2.1 KiB
C++

/**
* 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.
*/
/*
* Pet_vaccinationBook.h
*
* Vaccination book of the pet
*/
#ifndef Pet_vaccinationBook_H_
#define Pet_vaccinationBook_H_
#include "Vaccine.h"
#include <set>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Vaccination book of the pet
/// </summary>
class Pet_vaccinationBook
{
public:
Pet_vaccinationBook();
virtual ~Pet_vaccinationBook() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Pet_vaccinationBook& rhs) const;
bool operator!=(const Pet_vaccinationBook& rhs) const;
/////////////////////////////////////////////
/// Pet_vaccinationBook members
/// <summary>
///
/// </summary>
std::set<org::openapitools::server::model::Vaccine> getVaccines() const;
void setVaccines(std::set<org::openapitools::server::model::Vaccine> const& value);
friend void to_json(nlohmann::json& j, const Pet_vaccinationBook& o);
friend void from_json(const nlohmann::json& j, Pet_vaccinationBook& o);
protected:
std::set<org::openapitools::server::model::Vaccine> m_Vaccines;
};
} // namespace org::openapitools::server::model
#endif /* Pet_vaccinationBook_H_ */