stkrwork 23ab5177b3 [C++][Pistache] Fix optional error and wrong function signatures (#264)
* Added missing includes for optional

* Removed shared pointer from pistache generator

* Changed Net namespace to Pistache Namespace

* Clean up code and removed unnecessary lines in mustache files

* Removed remaining shared pointer syntax

* Code review fixes + updated samples

* Added const to all model setter functions, and reference to all params in setters that are not primitives

* Refactored modelbase

* Removed const

* Updated samples
2018-06-22 09:12:35 +08:00

58 lines
1.2 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.
*
* OpenAPI spec version: 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.
*/
/*
* ModelBase.h
*
* This is the base class for all model classes
*/
#ifndef ModelBase_H_
#define ModelBase_H_
#include "json.hpp"
#include <ctime>
#include <string>
namespace org {
namespace openapitools {
namespace server {
namespace model {
class ModelBase
{
public:
ModelBase();
virtual ~ModelBase();
virtual void validate() = 0;
virtual nlohmann::json toJson() const = 0;
virtual void fromJson(nlohmann::json& json) = 0;
static std::string toJson( std::string const& value );
static std::string toJson( std::time_t const& value );
static int32_t toJson( int32_t const value );
static int64_t toJson( int64_t const value );
static double toJson( double const value );
static bool toJson( bool const value );
static nlohmann::json toJson(ModelBase const& content );
};
}
}
}
}
#endif /* ModelBase_H_ */