fix string type in c++ generator

This commit is contained in:
wing328 2018-04-08 23:03:18 +08:00
parent 665f0bd811
commit f192613f11
58 changed files with 186 additions and 205 deletions

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/openapi-generator/src/main/resources/cpprest -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l cpprest -o samples/client/petstore/cpprest" ags="generate -t modules/openapi-generator/src/main/resources/cpprest -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l cpp-restsdk -o samples/client/petstore/cpprest $@"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -l pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/pistache-server" ags="$@ generate -l cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/pistache-server"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l cpprest -o samples\client\petstore\cpprest set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l cpp-restsdk -o samples\client\petstore\cpprest
java %JAVA_OPTS% -jar %executable% %ags% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l restbed -o samples\server\petstore\restbed\ set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l cpp-restbed-server -o samples\server\petstore\restbed\
java %JAVA_OPTS% -jar %executable% %ags% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -179,7 +179,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
op.bodyParam.vendorExtensions.put("x-codegen-pistache-isStringOrDate", op.bodyParam.isString || op.bodyParam.isDate); op.bodyParam.vendorExtensions.put("x-codegen-pistache-isStringOrDate", op.bodyParam.isString || op.bodyParam.isDate);
} }
if(op.consumes != null) { if (op.consumes != null) {
for (Map<String, String> consume : op.consumes) { for (Map<String, String> consume : op.consumes) {
if (consume.get("mediaType") != null && consume.get("mediaType").equals("application/json")) { if (consume.get("mediaType") != null && consume.get("mediaType").equals("application/json")) {
consumeJson = true; consumeJson = true;
@ -189,17 +189,17 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
op.httpMethod = op.httpMethod.substring(0, 1).toUpperCase() + op.httpMethod.substring(1).toLowerCase(); op.httpMethod = op.httpMethod.substring(0, 1).toUpperCase() + op.httpMethod.substring(1).toLowerCase();
for(CodegenParameter param : op.allParams){ for (CodegenParameter param : op.allParams) {
if (param.isFormParam) isParsingSupported=false; if (param.isFormParam) isParsingSupported = false;
if (param.isFile) isParsingSupported=false; if (param.isFile) isParsingSupported = false;
if (param.isCookieParam) isParsingSupported=false; if (param.isCookieParam) isParsingSupported = false;
//TODO: This changes the info about the real type but it is needed to parse the header params //TODO: This changes the info about the real type but it is needed to parse the header params
if (param.isHeaderParam) { if (param.isHeaderParam) {
param.dataType = "Optional<Net::Http::Header::Raw>"; param.dataType = "Optional<Net::Http::Header::Raw>";
param.baseType = "Optional<Net::Http::Header::Raw>"; param.baseType = "Optional<Net::Http::Header::Raw>";
} else if(param.isQueryParam){ } else if (param.isQueryParam) {
if(param.isPrimitiveType) { if (param.isPrimitiveType) {
param.dataType = "Optional<" + param.dataType + ">"; param.dataType = "Optional<" + param.dataType + ">";
} else { } else {
param.dataType = "Optional<" + param.baseType + ">"; param.dataType = "Optional<" + param.baseType + ">";
@ -227,15 +227,15 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
public String apiFilename(String templateName, String tag) { public String apiFilename(String templateName, String tag) {
String result = super.apiFilename(templateName, tag); String result = super.apiFilename(templateName, tag);
if ( templateName.endsWith("impl-header.mustache") ) { if (templateName.endsWith("impl-header.mustache")) {
int ix = result.lastIndexOf('/'); int ix = result.lastIndexOf('/');
result = result.substring(0, ix) + result.substring(ix, result.length() - 2) + "Impl.h"; result = result.substring(0, ix) + result.substring(ix, result.length() - 2) + "Impl.h";
result = result.replace(apiFileFolder(), implFileFolder()); result = result.replace(apiFileFolder(), implFileFolder());
} else if ( templateName.endsWith("impl-source.mustache") ) { } else if (templateName.endsWith("impl-source.mustache")) {
int ix = result.lastIndexOf('/'); int ix = result.lastIndexOf('/');
result = result.substring(0, ix) + result.substring(ix, result.length() - 4) + "Impl.cpp"; result = result.substring(0, ix) + result.substring(ix, result.length() - 4) + "Impl.cpp";
result = result.replace(apiFileFolder(), implFileFolder()); result = result.replace(apiFileFolder(), implFileFolder());
} else if ( templateName.endsWith("api-server.mustache") ) { } else if (templateName.endsWith("api-server.mustache")) {
int ix = result.lastIndexOf('/'); int ix = result.lastIndexOf('/');
result = result.substring(0, ix) + result.substring(ix, result.length() - 4) + "MainServer.cpp"; result = result.substring(0, ix) + result.substring(ix, result.length() - 4) + "MainServer.cpp";
result = result.replace(apiFileFolder(), outputFolder); result = result.replace(apiFileFolder(), outputFolder);
@ -254,11 +254,11 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
* for different property types * for different property types
* *
* @return a string value used as the `dataType` field for model templates, * @return a string value used as the `dataType` field for model templates,
* `returnType` for api templates * `returnType` for api templates
*/ */
@Override @Override
public String getTypeDeclaration(Schema p) { public String getTypeDeclaration(Schema p) {
String swaggerType = getSchemaType(p); String openAPIType = getSchemaType(p);
if (p instanceof ArraySchema) { if (p instanceof ArraySchema) {
ArraySchema ap = (ArraySchema) p; ArraySchema ap = (ArraySchema) p;
@ -269,13 +269,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
Schema inner = (Schema) p.getAdditionalProperties(); Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<std::string, " + getTypeDeclaration(inner) + ">"; return getSchemaType(p) + "<std::string, " + getTypeDeclaration(inner) + ">";
} }
if (p instanceof StringSchema || p instanceof DateSchema if (p instanceof StringSchema || SchemaTypeUtil.STRING_TYPE.equals(p.getType())
|| p instanceof DateSchema
|| p instanceof DateTimeSchema || p instanceof FileSchema || p instanceof DateTimeSchema || p instanceof FileSchema
|| languageSpecificPrimitives.contains(swaggerType)) { || languageSpecificPrimitives.contains(openAPIType)) {
return toModelName(swaggerType); return toModelName(openAPIType);
} }
return "std::shared_ptr<" + swaggerType + ">"; return "std::shared_ptr<" + openAPIType + ">";
} }
@Override @Override
@ -358,14 +359,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
*/ */
@Override @Override
public String getSchemaType(Schema p) { public String getSchemaType(Schema p) {
String swaggerType = super.getSchemaType(p); String openAPIType = super.getSchemaType(p);
String type = null; String type = null;
if (typeMapping.containsKey(swaggerType)) { if (typeMapping.containsKey(openAPIType)) {
type = typeMapping.get(swaggerType); type = typeMapping.get(openAPIType);
if (languageSpecificPrimitives.contains(type)) if (languageSpecificPrimitives.contains(type))
return toModelName(type); return toModelName(type);
} else } else
type = swaggerType; type = openAPIType;
return toModelName(type); return toModelName(type);
} }

View File

@ -279,13 +279,12 @@ public class CppRestClientCodegen extends AbstractCppCodegen {
ArraySchema ap = (ArraySchema) p; ArraySchema ap = (ArraySchema) p;
Schema inner = ap.getItems(); Schema inner = ap.getItems();
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
} } else if (isMapSchema(p)) {
if (isMapSchema(p)) {
Schema inner = (Schema) p.getAdditionalProperties(); Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "<utility::string_t, " + getTypeDeclaration(inner) + ">"; return getSchemaType(p) + "<utility::string_t, " + getTypeDeclaration(inner) + ">";
} } else if (p instanceof StringSchema || SchemaTypeUtil.STRING_TYPE.equals(p.getType())
if (p instanceof StringSchema || p instanceof DateSchema || p instanceof DateSchema || p instanceof DateTimeSchema
|| p instanceof DateTimeSchema || p instanceof FileSchema || p instanceof FileSchema
|| languageSpecificPrimitives.contains(openAPIType)) { || languageSpecificPrimitives.contains(openAPIType)) {
return toModelName(openAPIType); return toModelName(openAPIType);
} }

View File

@ -75,7 +75,8 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque
{{#bodyParam}} {{#bodyParam}}
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{paramName}}.fromJson(request_body); {{/isPrimitiveType}} {{paramName}}.fromJson(request_body);
{{/isPrimitiveType}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
// The conversion is done automatically by the json library // The conversion is done automatically by the json library
{{paramName}} = request_body; {{paramName}} = request_body;

View File

@ -1 +1 @@
2.4.0-SNAPSHOT 3.0.0-SNAPSHOT

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -36,13 +36,13 @@ PetApi::~PetApi()
{ {
} }
pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body) pplx::task<void> PetApi::addPet(Pet pet)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'pet' is set
if (body == nullptr) if (pet == nullptr)
{ {
throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->addPet")); throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'pet' when calling PetApi->addPet"));
} }
@ -55,8 +55,6 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -96,7 +94,7 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
requestHttpContentType = utility::conversions::to_string_t("application/json"); requestHttpContentType = utility::conversions::to_string_t("application/json");
web::json::value json; web::json::value json;
json = ModelBase::toJson(body); json = ModelBase::toJson(pet);
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) ); httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
@ -107,9 +105,9 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData); std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
if(body.get()) if(pet.get())
{ {
body->toMultipart(multipart, utility::conversions::to_string_t("body")); pet->toMultipart(multipart, utility::conversions::to_string_t("pet"));
} }
httpBody = multipart; httpBody = multipart;
@ -171,8 +169,6 @@ pplx::task<void> PetApi::deletePet(int64_t petId, boost::optional<utility::strin
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -635,13 +631,13 @@ pplx::task<std::shared_ptr<Pet>> PetApi::getPetById(int64_t petId)
return result; return result;
}); });
} }
pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body) pplx::task<void> PetApi::updatePet(Pet pet)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'pet' is set
if (body == nullptr) if (pet == nullptr)
{ {
throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->updatePet")); throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'pet' when calling PetApi->updatePet"));
} }
@ -654,8 +650,6 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -695,7 +689,7 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
requestHttpContentType = utility::conversions::to_string_t("application/json"); requestHttpContentType = utility::conversions::to_string_t("application/json");
web::json::value json; web::json::value json;
json = ModelBase::toJson(body); json = ModelBase::toJson(pet);
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) ); httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
@ -706,9 +700,9 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData); std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
if(body.get()) if(pet.get())
{ {
body->toMultipart(multipart, utility::conversions::to_string_t("body")); pet->toMultipart(multipart, utility::conversions::to_string_t("pet"));
} }
httpBody = multipart; httpBody = multipart;
@ -770,8 +764,6 @@ pplx::task<void> PetApi::updatePetWithForm(int64_t petId, boost::optional<utilit
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -864,7 +856,7 @@ pplx::task<void> PetApi::updatePetWithForm(int64_t petId, boost::optional<utilit
return void(); return void();
}); });
} }
pplx::task<std::shared_ptr<ApiResponse>> PetApi::uploadFile(int64_t petId, boost::optional<utility::string_t> additionalMetadata, boost::optional<std::shared_ptr<HttpContent>> file) pplx::task<std::shared_ptr<ApiResponse>> PetApi::uploadFile(int64_t petId, boost::optional<utility::string_t> additionalMetadata, boost::optional<HttpContent> file)
{ {
@ -911,7 +903,7 @@ pplx::task<std::shared_ptr<ApiResponse>> PetApi::uploadFile(int64_t petId, boost
{ {
formParams[ utility::conversions::to_string_t("additionalMetadata") ] = ApiClient::parameterToString(*additionalMetadata); formParams[ utility::conversions::to_string_t("additionalMetadata") ] = ApiClient::parameterToString(*additionalMetadata);
} }
if (file && *file != nullptr) if (file)
{ {
fileParams[ utility::conversions::to_string_t("file") ] = *file; fileParams[ utility::conversions::to_string_t("file") ] = *file;
} }

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -47,9 +47,9 @@ public:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
pplx::task<void> addPet( pplx::task<void> addPet(
std::shared_ptr<Pet> body Pet pet
); );
/// <summary> /// <summary>
/// Deletes a pet /// Deletes a pet
@ -99,9 +99,9 @@ public:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
pplx::task<void> updatePet( pplx::task<void> updatePet(
std::shared_ptr<Pet> body Pet pet
); );
/// <summary> /// <summary>
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
@ -129,7 +129,7 @@ public:
pplx::task<std::shared_ptr<ApiResponse>> uploadFile( pplx::task<std::shared_ptr<ApiResponse>> uploadFile(
int64_t petId, int64_t petId,
boost::optional<utility::string_t> additionalMetadata, boost::optional<utility::string_t> additionalMetadata,
boost::optional<std::shared_ptr<HttpContent>> file boost::optional<HttpContent> file
); );
protected: protected:

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -50,8 +50,6 @@ pplx::task<void> StoreApi::deleteOrder(utility::string_t orderId)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -374,13 +372,13 @@ pplx::task<std::shared_ptr<Order>> StoreApi::getOrderById(int64_t orderId)
return result; return result;
}); });
} }
pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> body) pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(Order order)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'order' is set
if (body == nullptr) if (order == nullptr)
{ {
throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling StoreApi->placeOrder")); throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'order' when calling StoreApi->placeOrder"));
} }
@ -421,6 +419,7 @@ pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> b
headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType;
std::unordered_set<utility::string_t> consumeHttpContentTypes; std::unordered_set<utility::string_t> consumeHttpContentTypes;
consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") );
std::shared_ptr<IHttpBody> httpBody; std::shared_ptr<IHttpBody> httpBody;
@ -432,7 +431,7 @@ pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> b
requestHttpContentType = utility::conversions::to_string_t("application/json"); requestHttpContentType = utility::conversions::to_string_t("application/json");
web::json::value json; web::json::value json;
json = ModelBase::toJson(body); json = ModelBase::toJson(order);
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) ); httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
@ -443,9 +442,9 @@ pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> b
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData); std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
if(body.get()) if(order.get())
{ {
body->toMultipart(multipart, utility::conversions::to_string_t("body")); order->toMultipart(multipart, utility::conversions::to_string_t("order"));
} }
httpBody = multipart; httpBody = multipart;

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -74,9 +74,9 @@ public:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">order placed for purchasing the pet</param> /// <param name="order">order placed for purchasing the pet</param>
pplx::task<std::shared_ptr<Order>> placeOrder( pplx::task<std::shared_ptr<Order>> placeOrder(
std::shared_ptr<Order> body Order order
); );
protected: protected:

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -36,13 +36,13 @@ UserApi::~UserApi()
{ {
} }
pplx::task<void> UserApi::createUser(std::shared_ptr<User> body) pplx::task<void> UserApi::createUser(User user)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'user' is set
if (body == nullptr) if (user == nullptr)
{ {
throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->createUser")); throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'user' when calling UserApi->createUser"));
} }
@ -55,8 +55,6 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -83,6 +81,7 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType;
std::unordered_set<utility::string_t> consumeHttpContentTypes; std::unordered_set<utility::string_t> consumeHttpContentTypes;
consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") );
std::shared_ptr<IHttpBody> httpBody; std::shared_ptr<IHttpBody> httpBody;
@ -94,7 +93,7 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
requestHttpContentType = utility::conversions::to_string_t("application/json"); requestHttpContentType = utility::conversions::to_string_t("application/json");
web::json::value json; web::json::value json;
json = ModelBase::toJson(body); json = ModelBase::toJson(user);
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) ); httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
@ -105,9 +104,9 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData); std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
if(body.get()) if(user.get())
{ {
body->toMultipart(multipart, utility::conversions::to_string_t("body")); user->toMultipart(multipart, utility::conversions::to_string_t("user"));
} }
httpBody = multipart; httpBody = multipart;
@ -153,7 +152,7 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
return void(); return void();
}); });
} }
pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<User>> body) pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<User>> user)
{ {
@ -166,8 +165,6 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -194,6 +191,7 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType;
std::unordered_set<utility::string_t> consumeHttpContentTypes; std::unordered_set<utility::string_t> consumeHttpContentTypes;
consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") );
std::shared_ptr<IHttpBody> httpBody; std::shared_ptr<IHttpBody> httpBody;
@ -207,7 +205,7 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
{ {
std::vector<web::json::value> jsonArray; std::vector<web::json::value> jsonArray;
for( auto& item : body ) for( auto& item : user )
{ {
jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() );
@ -224,12 +222,12 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData); std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
{ {
std::vector<web::json::value> jsonArray; std::vector<web::json::value> jsonArray;
for( auto& item : body ) for( auto& item : user )
{ {
jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() );
} }
multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("user"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json")));
} }
httpBody = multipart; httpBody = multipart;
@ -275,7 +273,7 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
return void(); return void();
}); });
} }
pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<User>> body) pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<User>> user)
{ {
@ -288,8 +286,6 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -316,6 +312,7 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType;
std::unordered_set<utility::string_t> consumeHttpContentTypes; std::unordered_set<utility::string_t> consumeHttpContentTypes;
consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") );
std::shared_ptr<IHttpBody> httpBody; std::shared_ptr<IHttpBody> httpBody;
@ -329,7 +326,7 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
{ {
std::vector<web::json::value> jsonArray; std::vector<web::json::value> jsonArray;
for( auto& item : body ) for( auto& item : user )
{ {
jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() );
@ -346,12 +343,12 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData); std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
{ {
std::vector<web::json::value> jsonArray; std::vector<web::json::value> jsonArray;
for( auto& item : body ) for( auto& item : user )
{ {
jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() ); jsonArray.push_back( item.get() ? item->toJson() : web::json::value::null() );
} }
multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("user"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json")));
} }
httpBody = multipart; httpBody = multipart;
@ -411,8 +408,6 @@ pplx::task<void> UserApi::deleteUser(utility::string_t username)
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -752,8 +747,6 @@ pplx::task<void> UserApi::logoutUser()
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -835,13 +828,13 @@ pplx::task<void> UserApi::logoutUser()
return void(); return void();
}); });
} }
pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr<User> body) pplx::task<void> UserApi::updateUser(utility::string_t username, User user)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'user' is set
if (body == nullptr) if (user == nullptr)
{ {
throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->updateUser")); throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'user' when calling UserApi->updateUser"));
} }
@ -855,8 +848,6 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams; std::map<utility::string_t, std::shared_ptr<HttpContent>> fileParams;
std::unordered_set<utility::string_t> responseHttpContentTypes; std::unordered_set<utility::string_t> responseHttpContentTypes;
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") );
responseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );
utility::string_t responseHttpContentType; utility::string_t responseHttpContentType;
@ -883,6 +874,7 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType; headerParams[utility::conversions::to_string_t("Accept")] = responseHttpContentType;
std::unordered_set<utility::string_t> consumeHttpContentTypes; std::unordered_set<utility::string_t> consumeHttpContentTypes;
consumeHttpContentTypes.insert( utility::conversions::to_string_t("*/*") );
std::shared_ptr<IHttpBody> httpBody; std::shared_ptr<IHttpBody> httpBody;
@ -894,7 +886,7 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
requestHttpContentType = utility::conversions::to_string_t("application/json"); requestHttpContentType = utility::conversions::to_string_t("application/json");
web::json::value json; web::json::value json;
json = ModelBase::toJson(body); json = ModelBase::toJson(user);
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) ); httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
@ -905,9 +897,9 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData); std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
if(body.get()) if(user.get())
{ {
body->toMultipart(multipart, utility::conversions::to_string_t("body")); user->toMultipart(multipart, utility::conversions::to_string_t("user"));
} }
httpBody = multipart; httpBody = multipart;

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */
@ -23,7 +23,6 @@
#include "../ApiClient.h" #include "../ApiClient.h"
#include "User.h" #include "User.h"
#include <vector>
#include <cpprest/details/basic_types.h> #include <cpprest/details/basic_types.h>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -46,9 +45,9 @@ public:
/// <remarks> /// <remarks>
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// </remarks> /// </remarks>
/// <param name="body">Created user object</param> /// <param name="user">Created user object</param>
pplx::task<void> createUser( pplx::task<void> createUser(
std::shared_ptr<User> body User user
); );
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
@ -56,9 +55,9 @@ public:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
pplx::task<void> createUsersWithArrayInput( pplx::task<void> createUsersWithArrayInput(
std::vector<std::shared_ptr<User>> body std::vector<std::shared_ptr<User>> user
); );
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
@ -66,9 +65,9 @@ public:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
pplx::task<void> createUsersWithListInput( pplx::task<void> createUsersWithListInput(
std::vector<std::shared_ptr<User>> body std::vector<std::shared_ptr<User>> user
); );
/// <summary> /// <summary>
/// Delete user /// Delete user
@ -86,7 +85,7 @@ public:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param> /// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
pplx::task<std::shared_ptr<User>> getUserByName( pplx::task<std::shared_ptr<User>> getUserByName(
utility::string_t username utility::string_t username
); );
@ -117,10 +116,10 @@ public:
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// </remarks> /// </remarks>
/// <param name="username">name that need to be deleted</param> /// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param> /// <param name="user">Updated user object</param>
pplx::task<void> updateUser( pplx::task<void> updateUser(
utility::string_t username, utility::string_t username,
std::shared_ptr<User> body User user
); );
protected: protected:

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -5,7 +5,7 @@
* OpenAPI spec version: 1.0.0 * OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io * Contact: apiteam@swagger.io
* *
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT. * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */

View File

@ -1 +1 @@
2.3.0-SNAPSHOT 3.0.0-SNAPSHOT

View File

@ -59,12 +59,12 @@ void PetApi::setupRoutes() {
void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param // Getting the body param
Pet body; Pet pet;
try { try {
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
body.fromJson(request_body); pet.fromJson(request_body);
this->add_pet(body, response); this->add_pet(pet, response);
} catch (std::runtime_error & e) { } catch (std::runtime_error & e) {
//send a 400 error //send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what()); response.send(Pistache::Http::Code::Bad_Request, e.what());
@ -132,12 +132,12 @@ void PetApi::get_pet_by_id_handler(const Pistache::Rest::Request &request, Pista
void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param // Getting the body param
Pet body; Pet pet;
try { try {
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
body.fromJson(request_body); pet.fromJson(request_body);
this->update_pet(body, response); this->update_pet(pet, response);
} catch (std::runtime_error & e) { } catch (std::runtime_error & e) {
//send a 400 error //send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what()); response.send(Pistache::Http::Code::Bad_Request, e.what());

View File

@ -68,8 +68,8 @@ private:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
virtual void add_pet(const Pet &body, Pistache::Http::ResponseWriter &response) = 0; virtual void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0;
/// <summary> /// <summary>
/// Deletes a pet /// Deletes a pet
@ -114,8 +114,8 @@ private:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
virtual void update_pet(const Pet &body, Pistache::Http::ResponseWriter &response) = 0; virtual void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0;
/// <summary> /// <summary>
/// Updates a pet in the store with form data /// Updates a pet in the store with form data

View File

@ -92,12 +92,12 @@ void StoreApi::get_order_by_id_handler(const Pistache::Rest::Request &request, P
void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param // Getting the body param
Order body; Order order;
try { try {
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
body.fromJson(request_body); order.fromJson(request_body);
this->place_order(body, response); this->place_order(order, response);
} catch (std::runtime_error & e) { } catch (std::runtime_error & e) {
//send a 400 error //send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what()); response.send(Pistache::Http::Code::Bad_Request, e.what());

View File

@ -90,8 +90,8 @@ private:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">order placed for purchasing the pet</param> /// <param name="order">order placed for purchasing the pet</param>
virtual void place_order(const Order &body, Pistache::Http::ResponseWriter &response) = 0; virtual void place_order(const Order &order, Pistache::Http::ResponseWriter &response) = 0;
}; };

View File

@ -59,12 +59,12 @@ void UserApi::setupRoutes() {
void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param // Getting the body param
User body; User user;
try { try {
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
body.fromJson(request_body); user.fromJson(request_body);
this->create_user(body, response); this->create_user(user, response);
} catch (std::runtime_error & e) { } catch (std::runtime_error & e) {
//send a 400 error //send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what()); response.send(Pistache::Http::Code::Bad_Request, e.what());
@ -75,12 +75,12 @@ void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistac
void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param // Getting the body param
User body; User user;
try { try {
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
body.fromJson(request_body); user.fromJson(request_body);
this->create_users_with_array_input(body, response); this->create_users_with_array_input(user, response);
} catch (std::runtime_error & e) { } catch (std::runtime_error & e) {
//send a 400 error //send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what()); response.send(Pistache::Http::Code::Bad_Request, e.what());
@ -91,12 +91,12 @@ void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Reques
void UserApi::create_users_with_list_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { void UserApi::create_users_with_list_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param // Getting the body param
User body; User user;
try { try {
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
body.fromJson(request_body); user.fromJson(request_body);
this->create_users_with_list_input(body, response); this->create_users_with_list_input(user, response);
} catch (std::runtime_error & e) { } catch (std::runtime_error & e) {
//send a 400 error //send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what()); response.send(Pistache::Http::Code::Bad_Request, e.what());
@ -161,12 +161,12 @@ void UserApi::update_user_handler(const Pistache::Rest::Request &request, Pistac
auto username = request.param(":username").as<std::string>(); auto username = request.param(":username").as<std::string>();
// Getting the body param // Getting the body param
User body; User user;
try { try {
nlohmann::json request_body = nlohmann::json::parse(request.body()); nlohmann::json request_body = nlohmann::json::parse(request.body());
body.fromJson(request_body); user.fromJson(request_body);
this->update_user(username, body, response); this->update_user(username, user, response);
} catch (std::runtime_error & e) { } catch (std::runtime_error & e) {
//send a 400 error //send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what()); response.send(Pistache::Http::Code::Bad_Request, e.what());

View File

@ -26,7 +26,6 @@
#include "User.h" #include "User.h"
#include <string> #include <string>
#include <vector>
namespace io { namespace io {
namespace swagger { namespace swagger {
@ -68,8 +67,8 @@ private:
/// <remarks> /// <remarks>
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// </remarks> /// </remarks>
/// <param name="body">Created user object</param> /// <param name="user">Created user object</param>
virtual void create_user(const User &body, Pistache::Http::ResponseWriter &response) = 0; virtual void create_user(const User &user, Pistache::Http::ResponseWriter &response) = 0;
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
@ -77,8 +76,8 @@ private:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
virtual void create_users_with_array_input(const User &body, Pistache::Http::ResponseWriter &response) = 0; virtual void create_users_with_array_input(const User &user, Pistache::Http::ResponseWriter &response) = 0;
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
@ -86,8 +85,8 @@ private:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
virtual void create_users_with_list_input(const User &body, Pistache::Http::ResponseWriter &response) = 0; virtual void create_users_with_list_input(const User &user, Pistache::Http::ResponseWriter &response) = 0;
/// <summary> /// <summary>
/// Delete user /// Delete user
@ -104,7 +103,7 @@ private:
/// <remarks> /// <remarks>
/// ///
/// </remarks> /// </remarks>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param> /// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
virtual void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response) = 0; virtual void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response) = 0;
/// <summary> /// <summary>
@ -132,8 +131,8 @@ private:
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
/// </remarks> /// </remarks>
/// <param name="username">name that need to be deleted</param> /// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param> /// <param name="user">Updated user object</param>
virtual void update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response) = 0; virtual void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) = 0;
}; };

View File

@ -23,7 +23,7 @@ PetApiImpl::PetApiImpl(Pistache::Address addr)
: PetApi(addr) : PetApi(addr)
{ } { }
void PetApiImpl::add_pet(const Pet &body, Pistache::Http::ResponseWriter &response) { void PetApiImpl::add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void PetApiImpl::delete_pet(const int64_t &petId, const Optional<Net::Http::Header::Raw> &apiKey, Pistache::Http::ResponseWriter &response) { void PetApiImpl::delete_pet(const int64_t &petId, const Optional<Net::Http::Header::Raw> &apiKey, Pistache::Http::ResponseWriter &response) {
@ -38,7 +38,7 @@ void PetApiImpl::find_pets_by_tags(const Optional<std::string> &tags, Pistache::
void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) { void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void PetApiImpl::update_pet(const Pet &body, Pistache::Http::ResponseWriter &response) { void PetApiImpl::update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void PetApiImpl::update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response){ void PetApiImpl::update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response){

View File

@ -43,12 +43,12 @@ public:
PetApiImpl(Pistache::Address addr); PetApiImpl(Pistache::Address addr);
~PetApiImpl() { }; ~PetApiImpl() { };
void add_pet(const Pet &body, Pistache::Http::ResponseWriter &response); void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response);
void delete_pet(const int64_t &petId, const Optional<Net::Http::Header::Raw> &apiKey, Pistache::Http::ResponseWriter &response); void delete_pet(const int64_t &petId, const Optional<Net::Http::Header::Raw> &apiKey, Pistache::Http::ResponseWriter &response);
void find_pets_by_status(const Optional<std::string> &status, Pistache::Http::ResponseWriter &response); void find_pets_by_status(const Optional<std::string> &status, Pistache::Http::ResponseWriter &response);
void find_pets_by_tags(const Optional<std::string> &tags, Pistache::Http::ResponseWriter &response); void find_pets_by_tags(const Optional<std::string> &tags, Pistache::Http::ResponseWriter &response);
void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response); void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response);
void update_pet(const Pet &body, Pistache::Http::ResponseWriter &response); void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response);
void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response);
void upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); void upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response);

View File

@ -32,7 +32,7 @@ void StoreApiImpl::get_inventory(Pistache::Http::ResponseWriter &response) {
void StoreApiImpl::get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response) { void StoreApiImpl::get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void StoreApiImpl::place_order(const Order &body, Pistache::Http::ResponseWriter &response) { void StoreApiImpl::place_order(const Order &order, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }

View File

@ -46,7 +46,7 @@ public:
void delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response); void delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response);
void get_inventory(Pistache::Http::ResponseWriter &response); void get_inventory(Pistache::Http::ResponseWriter &response);
void get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response); void get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response);
void place_order(const Order &body, Pistache::Http::ResponseWriter &response); void place_order(const Order &order, Pistache::Http::ResponseWriter &response);
}; };

View File

@ -23,13 +23,13 @@ UserApiImpl::UserApiImpl(Pistache::Address addr)
: UserApi(addr) : UserApi(addr)
{ } { }
void UserApiImpl::create_user(const User &body, Pistache::Http::ResponseWriter &response) { void UserApiImpl::create_user(const User &user, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void UserApiImpl::create_users_with_array_input(const User &body, Pistache::Http::ResponseWriter &response) { void UserApiImpl::create_users_with_array_input(const User &user, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void UserApiImpl::create_users_with_list_input(const User &body, Pistache::Http::ResponseWriter &response) { void UserApiImpl::create_users_with_list_input(const User &user, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void UserApiImpl::delete_user(const std::string &username, Pistache::Http::ResponseWriter &response) { void UserApiImpl::delete_user(const std::string &username, Pistache::Http::ResponseWriter &response) {
@ -44,7 +44,7 @@ void UserApiImpl::login_user(const Optional<std::string> &username, const Option
void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) { void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void UserApiImpl::update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response) { void UserApiImpl::update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }

View File

@ -29,7 +29,6 @@
#include "User.h" #include "User.h"
#include <string> #include <string>
#include <vector>
namespace io { namespace io {
namespace swagger { namespace swagger {
@ -43,14 +42,14 @@ public:
UserApiImpl(Pistache::Address addr); UserApiImpl(Pistache::Address addr);
~UserApiImpl() { }; ~UserApiImpl() { };
void create_user(const User &body, Pistache::Http::ResponseWriter &response); void create_user(const User &user, Pistache::Http::ResponseWriter &response);
void create_users_with_array_input(const User &body, Pistache::Http::ResponseWriter &response); void create_users_with_array_input(const User &user, Pistache::Http::ResponseWriter &response);
void create_users_with_list_input(const User &body, Pistache::Http::ResponseWriter &response); void create_users_with_list_input(const User &user, Pistache::Http::ResponseWriter &response);
void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response); void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response);
void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response); void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response);
void login_user(const Optional<std::string> &username, const Optional<std::string> &password, Pistache::Http::ResponseWriter &response); void login_user(const Optional<std::string> &username, const Optional<std::string> &password, Pistache::Http::ResponseWriter &response);
void logout_user(Pistache::Http::ResponseWriter &response); void logout_user(Pistache::Http::ResponseWriter &response);
void update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response); void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response);
}; };

View File

@ -194,7 +194,7 @@ void Order::unsetStatus()
{ {
m_StatusIsSet = false; m_StatusIsSet = false;
} }
bool Order::getComplete() const bool Order::isComplete() const
{ {
return m_Complete; return m_Complete;
} }

View File

@ -87,7 +87,7 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
bool getComplete() const; bool isComplete() const;
void setComplete(bool value); void setComplete(bool value);
bool completeIsSet() const; bool completeIsSet() const;
void unsetComplete(); void unsetComplete();