diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java index dffc475fb76d..65105e467a86 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java @@ -19,6 +19,8 @@ package org.openapitools.codegen.languages; import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache; + +import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; @@ -26,10 +28,12 @@ import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.templating.mustache.IndentedLambda; +import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; +import java.net.URL; import java.util.Arrays; import java.util.Map; @@ -300,4 +304,17 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg } } } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + URL url = URLPathUtils.getServerURL(openAPI); + String port = URLPathUtils.getPort(url, ""); + String host = url.getHost(); + if(!port.isEmpty()) { + this.additionalProperties.put("serverPort", port); + } + if(!host.isEmpty()) { + this.additionalProperties.put("serverHost", host); + } + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 01e7cb19506f..d49d4f4962ce 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -404,14 +404,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { public String getTypeDeclaration(String str) { return toModelName(str); } - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - URL url = URLPathUtils.getServerURL(openAPI); - String port = URLPathUtils.getPort(url, "8080"); - this.additionalProperties.put("serverPort", port); - } - + /** * Specify whether external libraries will be added during the generation * @param value the value to be set diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java index cafd2ca1c853..393fafc8be6c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java @@ -194,13 +194,6 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem return result; } - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - URL url = URLPathUtils.getServerURL(openAPI); - String port = URLPathUtils.getPort(url, "8080"); - this.additionalProperties.put("serverPort", port); - } - @Override public String toApiFilename(String name) { return modelNamePrefix + sanitizeName(camelize(name)) + "ApiHandler"; diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache index 69b33f661d55..239c88e4473e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache @@ -53,7 +53,7 @@ int main() { std::vector sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP}; setUpUnixSignals(sigs); #endif - Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port({{serverPort}})); + Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port({{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}})); httpEndpoint = new Pistache::Http::Endpoint((addr)); auto router = std::make_shared(); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache index ff8137cc23dd..c2355916bfa1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache @@ -9,7 +9,8 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} -{{classname}}::{{classname}}() { +{{classname}}::{{classname}}() : basePath("{{{basePathWithoutHost}}}"), + host("{{#serverHost}}{{#scheme}}{{scheme}}://{{/scheme}}{{serverHost}}{{#serverPort}}:{{serverPort}}{{/serverPort}}{{/serverHost}}") { } @@ -17,11 +18,24 @@ namespace {{this}} { } -{{classname}}::{{classname}}(QString host, QString basePath) { +{{classname}}::{{classname}}(const QString& host, const QString& basePath) { this->host = host; this->basePath = basePath; } +void {{classname}}::setBasePath(const QString& basePath){ + this->basePath = basePath; +} + +void {{classname}}::setHost(const QString& host){ + this->host = host; +} + +void {{classname}}::addHeaders(const QString& key, const QString& value){ + defaultHeaders.insert(key, value); +} + + {{#operations}} {{#operation}} void diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache index 5c33c1b72105..a5fc0432b526 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache @@ -18,16 +18,19 @@ class {{classname}}: public QObject { public: {{classname}}(); - {{classname}}(QString host, QString basePath); + {{classname}}(const QString& host, const QString& basePath); ~{{classname}}(); - QString host; - QString basePath; - QMap defaultHeaders; - + void setBasePath(const QString& basePath); + void setHost(const QString& host); + void addHeaders(const QString& key, const QString& value); + {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}const {{{dataType}}}& {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}}{{/operations}} private: + QString basePath; + QString host; + QMap defaultHeaders; {{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker); {{/operation}}{{/operations}} signals: diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache index e864d562d606..5b4954ae4ff8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/main.cpp.mustache @@ -58,7 +58,7 @@ int main(int argc, char * argv[]) QStringList() << "p" << "port", "port to listen on", "port", - "{{serverPort}}" + "{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}" ); parser.addOption(portOption); parser.addHelpOption(); diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index ad121e8340e0..06b5019af3f4 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp index 5908f26b1846..83eefa491b7d 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp +++ b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp @@ -13,8 +13,7 @@ PetApiTests::~PetApiTests () { OAIPetApi* PetApiTests::getApi() { auto api = new OAIPetApi(); - api->host = "http://petstore.swagger.io"; - api->basePath = "/v2"; + api->setHost("http://petstore.swagger.io"); return api; } diff --git a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp index 37624048322c..1a09beef7f74 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp +++ b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp @@ -13,8 +13,7 @@ StoreApiTests::~StoreApiTests () { OAIStoreApi* StoreApiTests::getApi() { auto api = new OAIStoreApi(); - api->host = "http://petstore.swagger.io"; - api->basePath = "/v2"; + api->setHost("http://petstore.swagger.io"); return api; } @@ -43,6 +42,7 @@ void StoreApiTests::placeOrderTest() { }; connect(this, &StoreApiTests::quit, finalizer); connect(api, &OAIStoreApi::placeOrderSignal, this, validator); + connect(api, &OAIStoreApi::placeOrderSignalE, this, finalizer); connect(&timer, &QTimer::timeout, &loop, finalizer); OAIOrder order; diff --git a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp index daeaf22dcf76..9dc641b8592b 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp +++ b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp @@ -13,8 +13,7 @@ UserApiTests::~UserApiTests () { OAIUserApi* UserApiTests::getApi() { auto api = new OAIUserApi(); - api->host = "http://petstore.swagger.io"; - api->basePath = "/v2"; + api->setHost("http://petstore.swagger.io"); return api; } diff --git a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.cpp b/samples/client/petstore/cpp-qt5/client/OAIApiResponse.cpp index d96a6781d46e..9d4dd1eb8174 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIApiResponse.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.h b/samples/client/petstore/cpp-qt5/client/OAIApiResponse.h index 5100522643fe..b28590dd38ae 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIApiResponse.h +++ b/samples/client/petstore/cpp-qt5/client/OAIApiResponse.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAICategory.cpp b/samples/client/petstore/cpp-qt5/client/OAICategory.cpp index 70ba538ba5c5..752f6bdbba95 100644 --- a/samples/client/petstore/cpp-qt5/client/OAICategory.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAICategory.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAICategory.h b/samples/client/petstore/cpp-qt5/client/OAICategory.h index eabad53107f3..0586cb3d4e15 100644 --- a/samples/client/petstore/cpp-qt5/client/OAICategory.h +++ b/samples/client/petstore/cpp-qt5/client/OAICategory.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIEnum.h b/samples/client/petstore/cpp-qt5/client/OAIEnum.h index cc146c83cf7f..42daef17ac16 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIEnum.h +++ b/samples/client/petstore/cpp-qt5/client/OAIEnum.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIHelpers.cpp b/samples/client/petstore/cpp-qt5/client/OAIHelpers.cpp index 7dcfccf3268a..bbe372ea8563 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHelpers.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIHelpers.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIHelpers.h b/samples/client/petstore/cpp-qt5/client/OAIHelpers.h index dbec1d68f25c..ce7cec3fc710 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHelpers.h +++ b/samples/client/petstore/cpp-qt5/client/OAIHelpers.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.cpp b/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.cpp index 0e5cc36ea38c..01e8797795d2 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.h b/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.h index d1f434c370b4..5e58caf449be 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.h +++ b/samples/client/petstore/cpp-qt5/client/OAIHttpRequest.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIObject.h b/samples/client/petstore/cpp-qt5/client/OAIObject.h index ce51fbf04932..9cc379894cae 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIObject.h +++ b/samples/client/petstore/cpp-qt5/client/OAIObject.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIOrder.cpp b/samples/client/petstore/cpp-qt5/client/OAIOrder.cpp index fbea7e3fa1c5..1ea3fba155de 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIOrder.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIOrder.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIOrder.h b/samples/client/petstore/cpp-qt5/client/OAIOrder.h index 757d8058430e..eb9edd329e3a 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIOrder.h +++ b/samples/client/petstore/cpp-qt5/client/OAIOrder.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIPet.cpp b/samples/client/petstore/cpp-qt5/client/OAIPet.cpp index cbf83dea22ba..c611d2d82ab2 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPet.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIPet.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIPet.h b/samples/client/petstore/cpp-qt5/client/OAIPet.h index dd48a29d9ccf..ffeb4ba5ad77 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPet.h +++ b/samples/client/petstore/cpp-qt5/client/OAIPet.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp b/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp index 1dff3cae748d..46108a18fd7c 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,7 +18,8 @@ namespace OpenAPI { -OAIPetApi::OAIPetApi() { +OAIPetApi::OAIPetApi() : basePath("/v2"), + host("petstore.swagger.io") { } @@ -26,11 +27,24 @@ OAIPetApi::~OAIPetApi() { } -OAIPetApi::OAIPetApi(QString host, QString basePath) { +OAIPetApi::OAIPetApi(const QString& host, const QString& basePath) { this->host = host; this->basePath = basePath; } +void OAIPetApi::setBasePath(const QString& basePath){ + this->basePath = basePath; +} + +void OAIPetApi::setHost(const QString& host){ + this->host = host; +} + +void OAIPetApi::addHeaders(const QString& key, const QString& value){ + defaultHeaders.insert(key, value); +} + + void OAIPetApi::addPet(const OAIPet& body) { QString fullPath; @@ -91,7 +105,7 @@ OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) { OAIHttpRequestInput input(fullPath, "DELETE"); if (api_key != nullptr) { - input.headers.insert("api_key", "api_key"); + input.headers.insert("api_key", api_key); } foreach(QString key, this->defaultHeaders.keys()) { diff --git a/samples/client/petstore/cpp-qt5/client/OAIPetApi.h b/samples/client/petstore/cpp-qt5/client/OAIPetApi.h index bb6986ced327..336b973bdb6c 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPetApi.h +++ b/samples/client/petstore/cpp-qt5/client/OAIPetApi.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,13 +29,13 @@ class OAIPetApi: public QObject { public: OAIPetApi(); - OAIPetApi(QString host, QString basePath); + OAIPetApi(const QString& host, const QString& basePath); ~OAIPetApi(); - QString host; - QString basePath; - QMap defaultHeaders; - + void setBasePath(const QString& basePath); + void setHost(const QString& host); + void addHeaders(const QString& key, const QString& value); + void addPet(const OAIPet& body); void deletePet(const qint64& pet_id, const QString& api_key); void findPetsByStatus(const QList& status); @@ -46,6 +46,9 @@ public: void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file); private: + QString basePath; + QString host; + QMap defaultHeaders; void addPetCallback (OAIHttpRequestWorker * worker); void deletePetCallback (OAIHttpRequestWorker * worker); void findPetsByStatusCallback (OAIHttpRequestWorker * worker); diff --git a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp index 39fbf71fd54d..e83f7f5139ea 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,7 +18,8 @@ namespace OpenAPI { -OAIStoreApi::OAIStoreApi() { +OAIStoreApi::OAIStoreApi() : basePath("/v2"), + host("petstore.swagger.io") { } @@ -26,11 +27,24 @@ OAIStoreApi::~OAIStoreApi() { } -OAIStoreApi::OAIStoreApi(QString host, QString basePath) { +OAIStoreApi::OAIStoreApi(const QString& host, const QString& basePath) { this->host = host; this->basePath = basePath; } +void OAIStoreApi::setBasePath(const QString& basePath){ + this->basePath = basePath; +} + +void OAIStoreApi::setHost(const QString& host){ + this->host = host; +} + +void OAIStoreApi::addHeaders(const QString& key, const QString& value){ + defaultHeaders.insert(key, value); +} + + void OAIStoreApi::deleteOrder(const QString& order_id) { QString fullPath; diff --git a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h index 3c181cbf643e..62bba015a368 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h +++ b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,19 +28,22 @@ class OAIStoreApi: public QObject { public: OAIStoreApi(); - OAIStoreApi(QString host, QString basePath); + OAIStoreApi(const QString& host, const QString& basePath); ~OAIStoreApi(); - QString host; - QString basePath; - QMap defaultHeaders; - + void setBasePath(const QString& basePath); + void setHost(const QString& host); + void addHeaders(const QString& key, const QString& value); + void deleteOrder(const QString& order_id); void getInventory(); void getOrderById(const qint64& order_id); void placeOrder(const OAIOrder& body); private: + QString basePath; + QString host; + QMap defaultHeaders; void deleteOrderCallback (OAIHttpRequestWorker * worker); void getInventoryCallback (OAIHttpRequestWorker * worker); void getOrderByIdCallback (OAIHttpRequestWorker * worker); diff --git a/samples/client/petstore/cpp-qt5/client/OAITag.cpp b/samples/client/petstore/cpp-qt5/client/OAITag.cpp index 2cc32c190b2a..4cf8d349b452 100644 --- a/samples/client/petstore/cpp-qt5/client/OAITag.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAITag.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAITag.h b/samples/client/petstore/cpp-qt5/client/OAITag.h index 5ab66aeb0b53..2a497cf1bd71 100644 --- a/samples/client/petstore/cpp-qt5/client/OAITag.h +++ b/samples/client/petstore/cpp-qt5/client/OAITag.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIUser.cpp b/samples/client/petstore/cpp-qt5/client/OAIUser.cpp index d260cf9f0789..52431c0367bb 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUser.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIUser.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIUser.h b/samples/client/petstore/cpp-qt5/client/OAIUser.h index 0c8cefc0ce14..d388f62a29b6 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUser.h +++ b/samples/client/petstore/cpp-qt5/client/OAIUser.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp b/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp index 8898fd078e08..79731867df9b 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,7 +18,8 @@ namespace OpenAPI { -OAIUserApi::OAIUserApi() { +OAIUserApi::OAIUserApi() : basePath("/v2"), + host("petstore.swagger.io") { } @@ -26,11 +27,24 @@ OAIUserApi::~OAIUserApi() { } -OAIUserApi::OAIUserApi(QString host, QString basePath) { +OAIUserApi::OAIUserApi(const QString& host, const QString& basePath) { this->host = host; this->basePath = basePath; } +void OAIUserApi::setBasePath(const QString& basePath){ + this->basePath = basePath; +} + +void OAIUserApi::setHost(const QString& host){ + this->host = host; +} + +void OAIUserApi::addHeaders(const QString& key, const QString& value){ + defaultHeaders.insert(key, value); +} + + void OAIUserApi::createUser(const OAIUser& body) { QString fullPath; diff --git a/samples/client/petstore/cpp-qt5/client/OAIUserApi.h b/samples/client/petstore/cpp-qt5/client/OAIUserApi.h index 9a2916ebfe82..1f858bad947b 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUserApi.h +++ b/samples/client/petstore/cpp-qt5/client/OAIUserApi.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,13 +28,13 @@ class OAIUserApi: public QObject { public: OAIUserApi(); - OAIUserApi(QString host, QString basePath); + OAIUserApi(const QString& host, const QString& basePath); ~OAIUserApi(); - QString host; - QString basePath; - QMap defaultHeaders; - + void setBasePath(const QString& basePath); + void setHost(const QString& host); + void addHeaders(const QString& key, const QString& value); + void createUser(const OAIUser& body); void createUsersWithArrayInput(const QList& body); void createUsersWithListInput(const QList& body); @@ -45,6 +45,9 @@ public: void updateUser(const QString& username, const OAIUser& body); private: + QString basePath; + QString host; + QMap defaultHeaders; void createUserCallback (OAIHttpRequestWorker * worker); void createUsersWithArrayInputCallback (OAIHttpRequestWorker * worker); void createUsersWithListInputCallback (OAIHttpRequestWorker * worker); diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/README.MD b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/README.MD index 6ebec4f3eeea..5225ebb24fd9 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/README.MD +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/README.MD @@ -49,6 +49,17 @@ To run the server ./build/src/cpp-qt5-qhttpengine-server & ``` +To override the default port via the command line, provide the parameters `port` and `address` like below + +```shell +cpp-qt5-qhttpengine-server --port 9080 --address 127.17.0.1 +``` +or + +```shell +cpp-qt5-qhttpengine-server -p 9080 -a 127.17.0.1 +``` + #### Invoke an API ```shell diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp index d4668ccadcb2..0ea833a0ed4b 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h index 320badff8e86..ee1893cd59ab 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp index 2bc9f9fa83d5..ed0535ee0f3c 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h index 230cd7ee7ecd..1b1c50de6e30 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.cpp index db77c6489e02..e439109af8db 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h index dfd063a4d623..9a549eb0013c 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.cpp index 2a592e4eebfb..7480499945dd 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h index fd849289626c..48c217dc6348 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp index e442d094fe32..d6b3af798d06 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp index e1a0a3539a3e..9d4dd1eb8174 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,13 +37,16 @@ OAIApiResponse::~OAIApiResponse() { void OAIApiResponse::init() { + m_code_isSet = false; m_code_isValid = false; + m_type_isSet = false; m_type_isValid = false; + m_message_isSet = false; m_message_isValid = false; -} + } void OAIApiResponse::fromJson(QString jsonString) { @@ -55,12 +58,16 @@ OAIApiResponse::fromJson(QString jsonString) { void OAIApiResponse::fromJsonObject(QJsonObject json) { + m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]); + m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]); + m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]); + } QString @@ -86,6 +93,7 @@ OAIApiResponse::asJsonObject() const { return obj; } + qint32 OAIApiResponse::getCode() const { return code; @@ -96,6 +104,7 @@ OAIApiResponse::setCode(const qint32 &code) { this->m_code_isSet = true; } + QString OAIApiResponse::getType() const { return type; @@ -106,6 +115,7 @@ OAIApiResponse::setType(const QString &type) { this->m_type_isSet = true; } + QString OAIApiResponse::getMessage() const { return message; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h index cf75b3988c68..b28590dd38ae 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,6 +25,7 @@ #include #include "OAIObject.h" +#include "OAIEnum.h" namespace OpenAPI { @@ -39,30 +40,39 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; + qint32 getCode() const; void setCode(const qint32 &code); + QString getType() const; void setType(const QString &type); + QString getMessage() const; void setMessage(const QString &message); + + virtual bool isSet() const override; virtual bool isValid() const override; private: void init(); + qint32 code; bool m_code_isSet; bool m_code_isValid; + QString type; bool m_type_isSet; bool m_type_isValid; + QString message; bool m_message_isSet; bool m_message_isValid; -}; + + }; } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp index b4695e383a2d..752f6bdbba95 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,11 +37,13 @@ OAICategory::~OAICategory() { void OAICategory::init() { + m_id_isSet = false; m_id_isValid = false; + m_name_isSet = false; m_name_isValid = false; -} + } void OAICategory::fromJson(QString jsonString) { @@ -53,10 +55,13 @@ OAICategory::fromJson(QString jsonString) { void OAICategory::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + } QString @@ -79,6 +84,7 @@ OAICategory::asJsonObject() const { return obj; } + qint64 OAICategory::getId() const { return id; @@ -89,6 +95,7 @@ OAICategory::setId(const qint64 &id) { this->m_id_isSet = true; } + QString OAICategory::getName() const { return name; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h index 2d72ebfbd80f..0586cb3d4e15 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,6 +25,7 @@ #include #include "OAIObject.h" +#include "OAIEnum.h" namespace OpenAPI { @@ -39,24 +40,31 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; + qint64 getId() const; void setId(const qint64 &id); + QString getName() const; void setName(const QString &name); + + virtual bool isSet() const override; virtual bool isValid() const override; private: void init(); + qint64 id; bool m_id_isSet; bool m_id_isValid; + QString name; bool m_name_isSet; bool m_name_isValid; -}; + + }; } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h new file mode 100644 index 000000000000..42daef17ac16 --- /dev/null +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_ENUM_H +#define OAI_ENUM_H + +#include +#include + +namespace OpenAPI { + +class OAIEnum { + public: + OAIEnum() { + + } + + OAIEnum(QString jsonString) { + fromJson(jsonString); + } + + virtual ~OAIEnum(){ + + } + + virtual QJsonValue asJsonValue() const { + return QJsonValue(jstr); + } + + virtual QString asJson() const { + return jstr; + } + + virtual void fromJson(QString jsonString) { + jstr = jsonString; + } + + virtual void fromJsonValue(QJsonValue jval) { + jstr = jval.toString(); + } + + virtual bool isSet() const { + return false; + } + + virtual bool isValid() const { + return true; + } +private : + QString jstr; +}; + +} + +#endif // OAI_ENUM_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp index 753308f7ad1a..bbe372ea8563 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,7 +12,7 @@ #include #include "OAIHelpers.h" -#include "OAIObject.h" + namespace OpenAPI { @@ -64,6 +64,11 @@ toStringValue(const double &value){ return QString::number(value); } +QString +toStringValue(const OAIEnum &value){ + return value.asJson(); +} + QJsonValue toJsonValue(const QString &value){ return QJsonValue(value); @@ -114,6 +119,11 @@ toJsonValue(const OAIObject &value){ return value.asJsonObject(); } +QJsonValue +toJsonValue(const OAIEnum &value){ + return value.asJsonValue(); +} + bool fromStringValue(const QString &inStr, QString &value){ value.clear(); @@ -202,6 +212,12 @@ fromStringValue(const QString &inStr, double &value){ return ok; } +bool +fromStringValue(const QString &inStr, OAIEnum &value){ + value.fromJson(inStr); + return true; +} + bool fromJsonValue(QString &value, const QJsonValue &jval){ bool ok = true; @@ -324,4 +340,10 @@ fromJsonValue(OAIObject &value, const QJsonValue &jval){ return ok; } +bool +fromJsonValue(OAIEnum &value, const QJsonValue &jval){ + value.fromJsonValue(jval); + return true; +} + } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h index 143e3591b10a..ce7cec3fc710 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,6 +23,7 @@ #include #include #include "OAIObject.h" +#include "OAIEnum.h" namespace OpenAPI { @@ -35,6 +36,7 @@ namespace OpenAPI { QString toStringValue(const bool &value); QString toStringValue(const float &value); QString toStringValue(const double &value); + QString toStringValue(const OAIEnum &value); template QString toStringValue(const QList &val) { @@ -58,6 +60,7 @@ namespace OpenAPI { QJsonValue toJsonValue(const float &value); QJsonValue toJsonValue(const double &value); QJsonValue toJsonValue(const OAIObject &value); + QJsonValue toJsonValue(const OAIEnum &value); template QJsonValue toJsonValue(const QList &val) { @@ -86,6 +89,7 @@ namespace OpenAPI { bool fromStringValue(const QString &inStr, bool &value); bool fromStringValue(const QString &inStr, float &value); bool fromStringValue(const QString &inStr, double &value); + bool fromStringValue(const QString &inStr, OAIEnum &value); template bool fromStringValue(const QList &inStr, QList &val) { @@ -119,6 +123,7 @@ namespace OpenAPI { bool fromJsonValue(float &value, const QJsonValue &jval); bool fromJsonValue(double &value, const QJsonValue &jval); bool fromJsonValue(OAIObject &value, const QJsonValue &jval); + bool fromJsonValue(OAIEnum &value, const QJsonValue &jval); template bool fromJsonValue(QList &val, const QJsonValue &jval) { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h index ce51fbf04932..9cc379894cae 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp index 6776ca2a3e2b..1ea3fba155de 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,19 +37,25 @@ OAIOrder::~OAIOrder() { void OAIOrder::init() { + m_id_isSet = false; m_id_isValid = false; + m_pet_id_isSet = false; m_pet_id_isValid = false; + m_quantity_isSet = false; m_quantity_isValid = false; + m_ship_date_isSet = false; m_ship_date_isValid = false; + m_status_isSet = false; m_status_isValid = false; + m_complete_isSet = false; m_complete_isValid = false; -} + } void OAIOrder::fromJson(QString jsonString) { @@ -61,18 +67,25 @@ OAIOrder::fromJson(QString jsonString) { void OAIOrder::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]); + m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]); + m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]); + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); + m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]); + } QString @@ -107,6 +120,7 @@ OAIOrder::asJsonObject() const { return obj; } + qint64 OAIOrder::getId() const { return id; @@ -117,6 +131,7 @@ OAIOrder::setId(const qint64 &id) { this->m_id_isSet = true; } + qint64 OAIOrder::getPetId() const { return pet_id; @@ -127,6 +142,7 @@ OAIOrder::setPetId(const qint64 &pet_id) { this->m_pet_id_isSet = true; } + qint32 OAIOrder::getQuantity() const { return quantity; @@ -137,6 +153,7 @@ OAIOrder::setQuantity(const qint32 &quantity) { this->m_quantity_isSet = true; } + QDateTime OAIOrder::getShipDate() const { return ship_date; @@ -147,6 +164,7 @@ OAIOrder::setShipDate(const QDateTime &ship_date) { this->m_ship_date_isSet = true; } + QString OAIOrder::getStatus() const { return status; @@ -157,6 +175,7 @@ OAIOrder::setStatus(const QString &status) { this->m_status_isSet = true; } + bool OAIOrder::isComplete() const { return complete; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h index c9550fb1df41..eb9edd329e3a 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,6 +26,7 @@ #include #include "OAIObject.h" +#include "OAIEnum.h" namespace OpenAPI { @@ -40,48 +41,63 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; + qint64 getId() const; void setId(const qint64 &id); + qint64 getPetId() const; void setPetId(const qint64 &pet_id); + qint32 getQuantity() const; void setQuantity(const qint32 &quantity); + QDateTime getShipDate() const; void setShipDate(const QDateTime &ship_date); + QString getStatus() const; void setStatus(const QString &status); + bool isComplete() const; void setComplete(const bool &complete); + + virtual bool isSet() const override; virtual bool isValid() const override; private: void init(); + qint64 id; bool m_id_isSet; bool m_id_isValid; + qint64 pet_id; bool m_pet_id_isSet; bool m_pet_id_isValid; + qint32 quantity; bool m_quantity_isSet; bool m_quantity_isValid; + QDateTime ship_date; bool m_ship_date_isSet; bool m_ship_date_isValid; + QString status; bool m_status_isSet; bool m_status_isValid; + bool complete; bool m_complete_isSet; bool m_complete_isValid; -}; + + }; } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp index 94af12c73692..c611d2d82ab2 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,19 +37,25 @@ OAIPet::~OAIPet() { void OAIPet::init() { + m_id_isSet = false; m_id_isValid = false; + m_category_isSet = false; m_category_isValid = false; + m_name_isSet = false; m_name_isValid = false; + m_photo_urls_isSet = false; m_photo_urls_isValid = false; + m_tags_isSet = false; m_tags_isValid = false; + m_status_isSet = false; m_status_isValid = false; -} + } void OAIPet::fromJson(QString jsonString) { @@ -61,18 +67,25 @@ OAIPet::fromJson(QString jsonString) { void OAIPet::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]); + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + m_photo_urls_isValid = ::OpenAPI::fromJsonValue(photo_urls, json[QString("photoUrls")]); + m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]); + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); + } QString @@ -109,6 +122,7 @@ OAIPet::asJsonObject() const { return obj; } + qint64 OAIPet::getId() const { return id; @@ -119,6 +133,7 @@ OAIPet::setId(const qint64 &id) { this->m_id_isSet = true; } + OAICategory OAIPet::getCategory() const { return category; @@ -129,6 +144,7 @@ OAIPet::setCategory(const OAICategory &category) { this->m_category_isSet = true; } + QString OAIPet::getName() const { return name; @@ -139,6 +155,7 @@ OAIPet::setName(const QString &name) { this->m_name_isSet = true; } + QList OAIPet::getPhotoUrls() const { return photo_urls; @@ -149,6 +166,7 @@ OAIPet::setPhotoUrls(const QList &photo_urls) { this->m_photo_urls_isSet = true; } + QList OAIPet::getTags() const { return tags; @@ -159,6 +177,7 @@ OAIPet::setTags(const QList &tags) { this->m_tags_isSet = true; } + QString OAIPet::getStatus() const { return status; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h index 2ca79919a721..ffeb4ba5ad77 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,6 +28,7 @@ #include #include "OAIObject.h" +#include "OAIEnum.h" namespace OpenAPI { @@ -42,48 +43,63 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; + qint64 getId() const; void setId(const qint64 &id); + OAICategory getCategory() const; void setCategory(const OAICategory &category); + QString getName() const; void setName(const QString &name); + QList getPhotoUrls() const; void setPhotoUrls(const QList &photo_urls); + QList getTags() const; void setTags(const QList &tags); + QString getStatus() const; void setStatus(const QString &status); + + virtual bool isSet() const override; virtual bool isValid() const override; private: void init(); + qint64 id; bool m_id_isSet; bool m_id_isValid; + OAICategory category; bool m_category_isSet; bool m_category_isValid; + QString name; bool m_name_isSet; bool m_name_isValid; + QList photo_urls; bool m_photo_urls_isSet; bool m_photo_urls_isValid; + QList tags; bool m_tags_isSet; bool m_tags_isValid; + QString status; bool m_status_isSet; bool m_status_isValid; -}; + + }; } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp index 19ab5832d69d..4cf8d349b452 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,11 +37,13 @@ OAITag::~OAITag() { void OAITag::init() { + m_id_isSet = false; m_id_isValid = false; + m_name_isSet = false; m_name_isValid = false; -} + } void OAITag::fromJson(QString jsonString) { @@ -53,10 +55,13 @@ OAITag::fromJson(QString jsonString) { void OAITag::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + } QString @@ -79,6 +84,7 @@ OAITag::asJsonObject() const { return obj; } + qint64 OAITag::getId() const { return id; @@ -89,6 +95,7 @@ OAITag::setId(const qint64 &id) { this->m_id_isSet = true; } + QString OAITag::getName() const { return name; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h index 27f033928c4d..2a497cf1bd71 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,6 +25,7 @@ #include #include "OAIObject.h" +#include "OAIEnum.h" namespace OpenAPI { @@ -39,24 +40,31 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; + qint64 getId() const; void setId(const qint64 &id); + QString getName() const; void setName(const QString &name); + + virtual bool isSet() const override; virtual bool isValid() const override; private: void init(); + qint64 id; bool m_id_isSet; bool m_id_isValid; + QString name; bool m_name_isSet; bool m_name_isValid; -}; + + }; } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp index 2cf358ae849e..52431c0367bb 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,23 +37,31 @@ OAIUser::~OAIUser() { void OAIUser::init() { + m_id_isSet = false; m_id_isValid = false; + m_username_isSet = false; m_username_isValid = false; + m_first_name_isSet = false; m_first_name_isValid = false; + m_last_name_isSet = false; m_last_name_isValid = false; + m_email_isSet = false; m_email_isValid = false; + m_password_isSet = false; m_password_isValid = false; + m_phone_isSet = false; m_phone_isValid = false; + m_user_status_isSet = false; m_user_status_isValid = false; -} + } void OAIUser::fromJson(QString jsonString) { @@ -65,22 +73,31 @@ OAIUser::fromJson(QString jsonString) { void OAIUser::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]); + m_first_name_isValid = ::OpenAPI::fromJsonValue(first_name, json[QString("firstName")]); + m_last_name_isValid = ::OpenAPI::fromJsonValue(last_name, json[QString("lastName")]); + m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]); + m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]); + m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]); + m_user_status_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]); + } QString @@ -121,6 +138,7 @@ OAIUser::asJsonObject() const { return obj; } + qint64 OAIUser::getId() const { return id; @@ -131,6 +149,7 @@ OAIUser::setId(const qint64 &id) { this->m_id_isSet = true; } + QString OAIUser::getUsername() const { return username; @@ -141,6 +160,7 @@ OAIUser::setUsername(const QString &username) { this->m_username_isSet = true; } + QString OAIUser::getFirstName() const { return first_name; @@ -151,6 +171,7 @@ OAIUser::setFirstName(const QString &first_name) { this->m_first_name_isSet = true; } + QString OAIUser::getLastName() const { return last_name; @@ -161,6 +182,7 @@ OAIUser::setLastName(const QString &last_name) { this->m_last_name_isSet = true; } + QString OAIUser::getEmail() const { return email; @@ -171,6 +193,7 @@ OAIUser::setEmail(const QString &email) { this->m_email_isSet = true; } + QString OAIUser::getPassword() const { return password; @@ -181,6 +204,7 @@ OAIUser::setPassword(const QString &password) { this->m_password_isSet = true; } + QString OAIUser::getPhone() const { return phone; @@ -191,6 +215,7 @@ OAIUser::setPhone(const QString &phone) { this->m_phone_isSet = true; } + qint32 OAIUser::getUserStatus() const { return user_status; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h index 275376c2dea5..d388f62a29b6 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,6 +25,7 @@ #include #include "OAIObject.h" +#include "OAIEnum.h" namespace OpenAPI { @@ -39,60 +40,79 @@ public: void fromJsonObject(QJsonObject json) override; void fromJson(QString jsonString) override; + qint64 getId() const; void setId(const qint64 &id); + QString getUsername() const; void setUsername(const QString &username); + QString getFirstName() const; void setFirstName(const QString &first_name); + QString getLastName() const; void setLastName(const QString &last_name); + QString getEmail() const; void setEmail(const QString &email); + QString getPassword() const; void setPassword(const QString &password); + QString getPhone() const; void setPhone(const QString &phone); + qint32 getUserStatus() const; void setUserStatus(const qint32 &user_status); + + virtual bool isSet() const override; virtual bool isValid() const override; private: void init(); + qint64 id; bool m_id_isSet; bool m_id_isValid; + QString username; bool m_username_isSet; bool m_username_isValid; + QString first_name; bool m_first_name_isSet; bool m_first_name_isValid; + QString last_name; bool m_last_name_isSet; bool m_last_name_isValid; + QString email; bool m_email_isSet; bool m_email_isValid; + QString password; bool m_password_isSet; bool m_password_isValid; + QString phone; bool m_phone_isSet; bool m_phone_isValid; + qint32 user_status; bool m_user_status_isSet; bool m_user_status_isValid; -}; + + }; } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp index 7131fce7e23e..1d4fcfa1634a 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h index 83ce2d281381..ad53bb80e731 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp index fdef383832fa..24ed609d79a3 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h index 9f5dc23e54ea..7f6a604dfdf9 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp index 588056010e98..e91d7a06d89d 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h index ec3b08d52b35..01785063ef5d 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).