forked from loafle/openapi-generator-original
[cpprest] Add support for nested vectors (#7820)
* Small fixes to prevent crash when empty json body is provided. * cpprest : Add toJson and toHttpContent array support. * petstore : Run script. * cpprest : Fix toHttpContent function header. * petstore : Run script. * cpprest : Add support for primitive response without enclosing item. * cpprest : Fix spaces. * cpprest : Fix build if bodyParam is optional. * cpprest : Fix vector of vector param. * Small updates to use utf encoding Add * operator for ^required
This commit is contained in:
committed by
William Cheng
parent
3b7230b170
commit
73bd24db7d
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -97,6 +97,7 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
|
||||
web::json::value json;
|
||||
|
||||
json = ModelBase::toJson(body);
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
@@ -105,7 +106,8 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
|
||||
{
|
||||
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
|
||||
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
|
||||
if(body.get())
|
||||
|
||||
if(body.get())
|
||||
{
|
||||
body->toMultipart(multipart, utility::conversions::to_string_t("body"));
|
||||
}
|
||||
@@ -301,7 +303,7 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByStatus(std::vect
|
||||
std::unordered_set<utility::string_t> consumeHttpContentTypes;
|
||||
|
||||
{
|
||||
queryParams[utility::conversions::to_string_t("status")] = ApiClient::parameterToArrayString<utility::string_t>(status);
|
||||
queryParams[utility::conversions::to_string_t("status")] = ApiClient::parameterToString(status);
|
||||
}
|
||||
|
||||
std::shared_ptr<IHttpBody> httpBody;
|
||||
@@ -427,7 +429,7 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByTags(std::vector
|
||||
std::unordered_set<utility::string_t> consumeHttpContentTypes;
|
||||
|
||||
{
|
||||
queryParams[utility::conversions::to_string_t("tags")] = ApiClient::parameterToArrayString<utility::string_t>(tags);
|
||||
queryParams[utility::conversions::to_string_t("tags")] = ApiClient::parameterToString(tags);
|
||||
}
|
||||
|
||||
std::shared_ptr<IHttpBody> httpBody;
|
||||
@@ -694,6 +696,7 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
|
||||
web::json::value json;
|
||||
|
||||
json = ModelBase::toJson(body);
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
@@ -702,7 +705,8 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
|
||||
{
|
||||
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
|
||||
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
|
||||
if(body.get())
|
||||
|
||||
if(body.get())
|
||||
{
|
||||
body->toMultipart(multipart, utility::conversions::to_string_t("body"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user