fix object type declaration in cpprest

This commit is contained in:
wing328 2018-04-09 00:01:27 +08:00
parent 6d88edb336
commit 070b5c00b8
7 changed files with 15 additions and 10 deletions

View File

@ -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) {

View File

@ -36,7 +36,7 @@ PetApi::~PetApi()
{
}
pplx::task<void> PetApi::addPet(Pet pet)
pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> pet)
{
// verify the required parameter 'pet' is set
@ -631,7 +631,7 @@ pplx::task<std::shared_ptr<Pet>> PetApi::getPetById(int64_t petId)
return result;
});
}
pplx::task<void> PetApi::updatePet(Pet pet)
pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> pet)
{
// verify the required parameter 'pet' is set

View File

@ -49,7 +49,7 @@ public:
/// </remarks>
/// <param name="pet">Pet object that needs to be added to the store</param>
pplx::task<void> addPet(
Pet pet
std::shared_ptr<Pet> pet
);
/// <summary>
/// Deletes a pet
@ -101,7 +101,7 @@ public:
/// </remarks>
/// <param name="pet">Pet object that needs to be added to the store</param>
pplx::task<void> updatePet(
Pet pet
std::shared_ptr<Pet> pet
);
/// <summary>
/// Updates a pet in the store with form data

View File

@ -372,7 +372,7 @@ pplx::task<std::shared_ptr<Order>> StoreApi::getOrderById(int64_t orderId)
return result;
});
}
pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(Order order)
pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> order)
{
// verify the required parameter 'order' is set

View File

@ -76,7 +76,7 @@ public:
/// </remarks>
/// <param name="order">order placed for purchasing the pet</param>
pplx::task<std::shared_ptr<Order>> placeOrder(
Order order
std::shared_ptr<Order> order
);
protected:

View File

@ -36,7 +36,7 @@ UserApi::~UserApi()
{
}
pplx::task<void> UserApi::createUser(User user)
pplx::task<void> UserApi::createUser(std::shared_ptr<User> user)
{
// verify the required parameter 'user' is set
@ -828,7 +828,7 @@ pplx::task<void> UserApi::logoutUser()
return void();
});
}
pplx::task<void> UserApi::updateUser(utility::string_t username, User user)
pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr<User> user)
{
// verify the required parameter 'user' is set

View File

@ -47,7 +47,7 @@ public:
/// </remarks>
/// <param name="user">Created user object</param>
pplx::task<void> createUser(
User user
std::shared_ptr<User> user
);
/// <summary>
/// Creates list of users with given input array
@ -119,7 +119,7 @@ public:
/// <param name="user">Updated user object</param>
pplx::task<void> updateUser(
utility::string_t username,
User user
std::shared_ptr<User> user
);
protected: