diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java index 5e4b271f238..2c7e77d6f37 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestClientCodegen.java @@ -292,6 +292,11 @@ public class CppRestClientCodegen extends AbstractCppCodegen { return "std::shared_ptr<" + openAPIType + ">"; } + @Override + public String getTypeDeclaration(String str) { + return "std::shared_ptr<" + toModelName(str) + ">"; + } + @Override public String toDefaultValue(Schema p) { if (p instanceof StringSchema) { diff --git a/samples/client/petstore/cpprest/api/PetApi.cpp b/samples/client/petstore/cpprest/api/PetApi.cpp index 387271eeb29..27130805d89 100644 --- a/samples/client/petstore/cpprest/api/PetApi.cpp +++ b/samples/client/petstore/cpprest/api/PetApi.cpp @@ -36,7 +36,7 @@ PetApi::~PetApi() { } -pplx::task PetApi::addPet(Pet pet) +pplx::task PetApi::addPet(std::shared_ptr pet) { // verify the required parameter 'pet' is set @@ -631,7 +631,7 @@ pplx::task> PetApi::getPetById(int64_t petId) return result; }); } -pplx::task PetApi::updatePet(Pet pet) +pplx::task PetApi::updatePet(std::shared_ptr pet) { // verify the required parameter 'pet' is set diff --git a/samples/client/petstore/cpprest/api/PetApi.h b/samples/client/petstore/cpprest/api/PetApi.h index cc3e598540d..44656672f49 100644 --- a/samples/client/petstore/cpprest/api/PetApi.h +++ b/samples/client/petstore/cpprest/api/PetApi.h @@ -49,7 +49,7 @@ public: /// /// Pet object that needs to be added to the store pplx::task addPet( - Pet pet + std::shared_ptr pet ); /// /// Deletes a pet @@ -101,7 +101,7 @@ public: /// /// Pet object that needs to be added to the store pplx::task updatePet( - Pet pet + std::shared_ptr pet ); /// /// Updates a pet in the store with form data diff --git a/samples/client/petstore/cpprest/api/StoreApi.cpp b/samples/client/petstore/cpprest/api/StoreApi.cpp index f9f3d3a3fcd..6357690d216 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.cpp +++ b/samples/client/petstore/cpprest/api/StoreApi.cpp @@ -372,7 +372,7 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) return result; }); } -pplx::task> StoreApi::placeOrder(Order order) +pplx::task> StoreApi::placeOrder(std::shared_ptr order) { // verify the required parameter 'order' is set diff --git a/samples/client/petstore/cpprest/api/StoreApi.h b/samples/client/petstore/cpprest/api/StoreApi.h index 8c7401b4162..c9fd9202bd0 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.h +++ b/samples/client/petstore/cpprest/api/StoreApi.h @@ -76,7 +76,7 @@ public: /// /// order placed for purchasing the pet pplx::task> placeOrder( - Order order + std::shared_ptr order ); protected: diff --git a/samples/client/petstore/cpprest/api/UserApi.cpp b/samples/client/petstore/cpprest/api/UserApi.cpp index 8529c143dcd..920131cfeb9 100644 --- a/samples/client/petstore/cpprest/api/UserApi.cpp +++ b/samples/client/petstore/cpprest/api/UserApi.cpp @@ -36,7 +36,7 @@ UserApi::~UserApi() { } -pplx::task UserApi::createUser(User user) +pplx::task UserApi::createUser(std::shared_ptr user) { // verify the required parameter 'user' is set @@ -828,7 +828,7 @@ pplx::task UserApi::logoutUser() return void(); }); } -pplx::task UserApi::updateUser(utility::string_t username, User user) +pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr user) { // verify the required parameter 'user' is set diff --git a/samples/client/petstore/cpprest/api/UserApi.h b/samples/client/petstore/cpprest/api/UserApi.h index b4441505428..aa86f728eca 100644 --- a/samples/client/petstore/cpprest/api/UserApi.h +++ b/samples/client/petstore/cpprest/api/UserApi.h @@ -47,7 +47,7 @@ public: /// /// Created user object pplx::task createUser( - User user + std::shared_ptr user ); /// /// Creates list of users with given input array @@ -119,7 +119,7 @@ public: /// Updated user object pplx::task updateUser( utility::string_t username, - User user + std::shared_ptr user ); protected: