Skip to content

Commit

Permalink
fix object type declaration in cpprest
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Apr 8, 2018
1 parent 6d88edb commit 070b5c0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/api/PetApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/api/PetApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PetApi
/// </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
Expand Down Expand Up @@ -101,7 +101,7 @@ class PetApi
/// </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
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpprest/api/StoreApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpprest/api/StoreApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class StoreApi
/// </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:
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/api/UserApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpprest/api/UserApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class UserApi
/// </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
Expand Down Expand Up @@ -119,7 +119,7 @@ class UserApi
/// <param name="user">Updated user object</param>
pplx::task<void> updateUser(
utility::string_t username,
User user
std::shared_ptr<User> user
);

protected:
Expand Down

0 comments on commit 070b5c0

Please sign in to comment.