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 5e4b271f238b..2c7e77d6f371 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 String getTypeDeclaration(Schema p) { 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 387271eeb29e..27130805d89a 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 cc3e598540dd..44656672f494 100644 --- a/samples/client/petstore/cpprest/api/PetApi.h +++ b/samples/client/petstore/cpprest/api/PetApi.h @@ -49,7 +49,7 @@ class PetApi /// /// 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 @@ class PetApi /// /// 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 f9f3d3a3fcd8..6357690d2168 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 8c7401b4162d..c9fd9202bd00 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.h +++ b/samples/client/petstore/cpprest/api/StoreApi.h @@ -76,7 +76,7 @@ class StoreApi /// /// 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 8529c143dcdd..920131cfeb91 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 b4441505428b..aa86f728eca6 100644 --- a/samples/client/petstore/cpprest/api/UserApi.h +++ b/samples/client/petstore/cpprest/api/UserApi.h @@ -47,7 +47,7 @@ class UserApi /// /// Created user object pplx::task createUser( - User user + std::shared_ptr user ); /// /// Creates list of users with given input array @@ -119,7 +119,7 @@ class UserApi /// Updated user object pplx::task updateUser( utility::string_t username, - User user + std::shared_ptr user ); protected: