[cpp-restbed] Added "out-of-the-box" functionality (#4759)

* Added cpp-restbed "out-of-the-box" functionality
* handling class dependencies
* added method override to clean interfaces of ambiguity
* added default values for shared pointers
* fixed _name and name parameters generating the same getters and setters
* updated enum handling
* updated Petstore samples
* updated templates for automated object generation

* fix whitespace

* removed model initialisation

* added model brace initialisation
This commit is contained in:
AlexG
2020-01-02 13:36:22 +01:00
committed by William Cheng
parent 5cc5fbe76a
commit 1cb99e3497
24 changed files with 582 additions and 189 deletions

View File

@@ -5,7 +5,7 @@
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.2.0-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator unset.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -28,19 +28,19 @@ using namespace org::openapitools::server::model;
PetApi::PetApi() {
std::shared_ptr<PetApiPetResource> spPetApiPetResource = std::make_shared<PetApiPetResource>();
this->publish(spPetApiPetResource);
std::shared_ptr<PetApiPetPetIdResource> spPetApiPetPetIdResource = std::make_shared<PetApiPetPetIdResource>();
this->publish(spPetApiPetPetIdResource);
std::shared_ptr<PetApiPetFindByStatusResource> spPetApiPetFindByStatusResource = std::make_shared<PetApiPetFindByStatusResource>();
this->publish(spPetApiPetFindByStatusResource);
std::shared_ptr<PetApiPetFindByTagsResource> spPetApiPetFindByTagsResource = std::make_shared<PetApiPetFindByTagsResource>();
this->publish(spPetApiPetFindByTagsResource);
std::shared_ptr<PetApiPetPetIdUploadImageResource> spPetApiPetPetIdUploadImageResource = std::make_shared<PetApiPetPetIdUploadImageResource>();
this->publish(spPetApiPetPetIdUploadImageResource);
}
PetApi::~PetApi() {}
@@ -66,6 +66,9 @@ PetApiPetResource::PetApiPetResource()
this->set_method_handler("PUT",
std::bind(&PetApiPetResource::PUT_method_handler, this,
std::placeholders::_1));
body = std::make_shared<Pet>();
}
PetApiPetResource::~PetApiPetResource()
@@ -178,6 +181,10 @@ PetApiPetPetIdResource::PetApiPetPetIdResource()
this->set_method_handler("POST",
std::bind(&PetApiPetPetIdResource::POST_method_handler, this,
std::placeholders::_1));
petId = 0L;
apiKey = "";
}
PetApiPetPetIdResource::~PetApiPetPetIdResource()
@@ -302,6 +309,8 @@ PetApiPetFindByStatusResource::PetApiPetFindByStatusResource()
this->set_method_handler("GET",
std::bind(&PetApiPetFindByStatusResource::GET_method_handler, this,
std::placeholders::_1));
}
PetApiPetFindByStatusResource::~PetApiPetFindByStatusResource()
@@ -354,6 +363,8 @@ PetApiPetFindByTagsResource::PetApiPetFindByTagsResource()
this->set_method_handler("GET",
std::bind(&PetApiPetFindByTagsResource::GET_method_handler, this,
std::placeholders::_1));
}
PetApiPetFindByTagsResource::~PetApiPetFindByTagsResource()
@@ -406,6 +417,11 @@ PetApiPetPetIdUploadImageResource::PetApiPetPetIdUploadImageResource()
this->set_method_handler("POST",
std::bind(&PetApiPetPetIdUploadImageResource::POST_method_handler, this,
std::placeholders::_1));
petId = 0L;
additionalMetadata = "";
file = "";
}
PetApiPetPetIdUploadImageResource::~PetApiPetPetIdUploadImageResource()