Set default base path and change constructor to const ref (#2973)

This commit is contained in:
sunn 2019-05-26 11:03:48 +02:00 committed by William Cheng
parent 2bc9592bd5
commit 2e6b911022
68 changed files with 457 additions and 121 deletions

View File

@ -19,6 +19,8 @@ package org.openapitools.codegen.languages;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.Schema;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -26,10 +28,12 @@ import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.DefaultCodegen;
import org.openapitools.codegen.templating.mustache.IndentedLambda; import org.openapitools.codegen.templating.mustache.IndentedLambda;
import org.openapitools.codegen.utils.URLPathUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.File; import java.io.File;
import java.net.URL;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; 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);
}
}
} }

View File

@ -404,14 +404,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
public String getTypeDeclaration(String str) { public String getTypeDeclaration(String str) {
return toModelName(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 * Specify whether external libraries will be added during the generation
* @param value the value to be set * @param value the value to be set

View File

@ -194,13 +194,6 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
return result; 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 @Override
public String toApiFilename(String name) { public String toApiFilename(String name) {
return modelNamePrefix + sanitizeName(camelize(name)) + "ApiHandler"; return modelNamePrefix + sanitizeName(camelize(name)) + "ApiHandler";

View File

@ -53,7 +53,7 @@ int main() {
std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP}; std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP};
setUpUnixSignals(sigs); setUpUnixSignals(sigs);
#endif #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)); httpEndpoint = new Pistache::Http::Endpoint((addr));
auto router = std::make_shared<Pistache::Rest::Router>(); auto router = std::make_shared<Pistache::Rest::Router>();

View File

@ -9,7 +9,8 @@
namespace {{this}} { namespace {{this}} {
{{/cppNamespaceDeclarations}} {{/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->host = host;
this->basePath = basePath; 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}} {{#operations}}
{{#operation}} {{#operation}}
void void

View File

@ -18,16 +18,19 @@ class {{classname}}: public QObject {
public: public:
{{classname}}(); {{classname}}();
{{classname}}(QString host, QString basePath); {{classname}}(const QString& host, const QString& basePath);
~{{classname}}(); ~{{classname}}();
QString host; void setBasePath(const QString& basePath);
QString basePath; void setHost(const QString& host);
QMap<QString, QString> defaultHeaders; void addHeaders(const QString& key, const QString& value);
{{#operations}}{{#operation}}void {{nickname}}({{#allParams}}const {{{dataType}}}& {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}const {{{dataType}}}& {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
{{/operation}}{{/operations}} {{/operation}}{{/operations}}
private: private:
QString basePath;
QString host;
QMap<QString, QString> defaultHeaders;
{{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker); {{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker);
{{/operation}}{{/operations}} {{/operation}}{{/operations}}
signals: signals:

View File

@ -58,7 +58,7 @@ int main(int argc, char * argv[])
QStringList() << "p" << "port", QStringList() << "p" << "port",
"port to listen on", "port to listen on",
"port", "port",
"{{serverPort}}" "{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}"
); );
parser.addOption(portOption); parser.addOption(portOption);
parser.addHelpOption(); parser.addHelpOption();

View File

@ -1 +1 @@
3.0.1-SNAPSHOT 4.0.1-SNAPSHOT

View File

@ -13,8 +13,7 @@ PetApiTests::~PetApiTests () {
OAIPetApi* PetApiTests::getApi() { OAIPetApi* PetApiTests::getApi() {
auto api = new OAIPetApi(); auto api = new OAIPetApi();
api->host = "http://petstore.swagger.io"; api->setHost("http://petstore.swagger.io");
api->basePath = "/v2";
return api; return api;
} }

View File

@ -13,8 +13,7 @@ StoreApiTests::~StoreApiTests () {
OAIStoreApi* StoreApiTests::getApi() { OAIStoreApi* StoreApiTests::getApi() {
auto api = new OAIStoreApi(); auto api = new OAIStoreApi();
api->host = "http://petstore.swagger.io"; api->setHost("http://petstore.swagger.io");
api->basePath = "/v2";
return api; return api;
} }
@ -43,6 +42,7 @@ void StoreApiTests::placeOrderTest() {
}; };
connect(this, &StoreApiTests::quit, finalizer); connect(this, &StoreApiTests::quit, finalizer);
connect(api, &OAIStoreApi::placeOrderSignal, this, validator); connect(api, &OAIStoreApi::placeOrderSignal, this, validator);
connect(api, &OAIStoreApi::placeOrderSignalE, this, finalizer);
connect(&timer, &QTimer::timeout, &loop, finalizer); connect(&timer, &QTimer::timeout, &loop, finalizer);
OAIOrder order; OAIOrder order;

View File

@ -13,8 +13,7 @@ UserApiTests::~UserApiTests () {
OAIUserApi* UserApiTests::getApi() { OAIUserApi* UserApiTests::getApi() {
auto api = new OAIUserApi(); auto api = new OAIUserApi();
api->host = "http://petstore.swagger.io"; api->setHost("http://petstore.swagger.io");
api->basePath = "/v2";
return api; return api;
} }

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -18,7 +18,8 @@
namespace OpenAPI { 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->host = host;
this->basePath = basePath; 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 void
OAIPetApi::addPet(const OAIPet& body) { OAIPetApi::addPet(const OAIPet& body) {
QString fullPath; QString fullPath;
@ -91,7 +105,7 @@ OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) {
OAIHttpRequestInput input(fullPath, "DELETE"); OAIHttpRequestInput input(fullPath, "DELETE");
if (api_key != nullptr) { if (api_key != nullptr) {
input.headers.insert("api_key", "api_key"); input.headers.insert("api_key", api_key);
} }
foreach(QString key, this->defaultHeaders.keys()) { foreach(QString key, this->defaultHeaders.keys()) {

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -29,13 +29,13 @@ class OAIPetApi: public QObject {
public: public:
OAIPetApi(); OAIPetApi();
OAIPetApi(QString host, QString basePath); OAIPetApi(const QString& host, const QString& basePath);
~OAIPetApi(); ~OAIPetApi();
QString host; void setBasePath(const QString& basePath);
QString basePath; void setHost(const QString& host);
QMap<QString, QString> defaultHeaders; void addHeaders(const QString& key, const QString& value);
void addPet(const OAIPet& body); void addPet(const OAIPet& body);
void deletePet(const qint64& pet_id, const QString& api_key); void deletePet(const qint64& pet_id, const QString& api_key);
void findPetsByStatus(const QList<QString>& status); void findPetsByStatus(const QList<QString>& status);
@ -46,6 +46,9 @@ public:
void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file); void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file);
private: private:
QString basePath;
QString host;
QMap<QString, QString> defaultHeaders;
void addPetCallback (OAIHttpRequestWorker * worker); void addPetCallback (OAIHttpRequestWorker * worker);
void deletePetCallback (OAIHttpRequestWorker * worker); void deletePetCallback (OAIHttpRequestWorker * worker);
void findPetsByStatusCallback (OAIHttpRequestWorker * worker); void findPetsByStatusCallback (OAIHttpRequestWorker * worker);

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -18,7 +18,8 @@
namespace OpenAPI { 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->host = host;
this->basePath = basePath; 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 void
OAIStoreApi::deleteOrder(const QString& order_id) { OAIStoreApi::deleteOrder(const QString& order_id) {
QString fullPath; QString fullPath;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -28,19 +28,22 @@ class OAIStoreApi: public QObject {
public: public:
OAIStoreApi(); OAIStoreApi();
OAIStoreApi(QString host, QString basePath); OAIStoreApi(const QString& host, const QString& basePath);
~OAIStoreApi(); ~OAIStoreApi();
QString host; void setBasePath(const QString& basePath);
QString basePath; void setHost(const QString& host);
QMap<QString, QString> defaultHeaders; void addHeaders(const QString& key, const QString& value);
void deleteOrder(const QString& order_id); void deleteOrder(const QString& order_id);
void getInventory(); void getInventory();
void getOrderById(const qint64& order_id); void getOrderById(const qint64& order_id);
void placeOrder(const OAIOrder& body); void placeOrder(const OAIOrder& body);
private: private:
QString basePath;
QString host;
QMap<QString, QString> defaultHeaders;
void deleteOrderCallback (OAIHttpRequestWorker * worker); void deleteOrderCallback (OAIHttpRequestWorker * worker);
void getInventoryCallback (OAIHttpRequestWorker * worker); void getInventoryCallback (OAIHttpRequestWorker * worker);
void getOrderByIdCallback (OAIHttpRequestWorker * worker); void getOrderByIdCallback (OAIHttpRequestWorker * worker);

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -18,7 +18,8 @@
namespace OpenAPI { 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->host = host;
this->basePath = basePath; 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 void
OAIUserApi::createUser(const OAIUser& body) { OAIUserApi::createUser(const OAIUser& body) {
QString fullPath; QString fullPath;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -28,13 +28,13 @@ class OAIUserApi: public QObject {
public: public:
OAIUserApi(); OAIUserApi();
OAIUserApi(QString host, QString basePath); OAIUserApi(const QString& host, const QString& basePath);
~OAIUserApi(); ~OAIUserApi();
QString host; void setBasePath(const QString& basePath);
QString basePath; void setHost(const QString& host);
QMap<QString, QString> defaultHeaders; void addHeaders(const QString& key, const QString& value);
void createUser(const OAIUser& body); void createUser(const OAIUser& body);
void createUsersWithArrayInput(const QList<OAIUser>& body); void createUsersWithArrayInput(const QList<OAIUser>& body);
void createUsersWithListInput(const QList<OAIUser>& body); void createUsersWithListInput(const QList<OAIUser>& body);
@ -45,6 +45,9 @@ public:
void updateUser(const QString& username, const OAIUser& body); void updateUser(const QString& username, const OAIUser& body);
private: private:
QString basePath;
QString host;
QMap<QString, QString> defaultHeaders;
void createUserCallback (OAIHttpRequestWorker * worker); void createUserCallback (OAIHttpRequestWorker * worker);
void createUsersWithArrayInputCallback (OAIHttpRequestWorker * worker); void createUsersWithArrayInputCallback (OAIHttpRequestWorker * worker);
void createUsersWithListInputCallback (OAIHttpRequestWorker * worker); void createUsersWithListInputCallback (OAIHttpRequestWorker * worker);

View File

@ -1 +1 @@
4.0.0-SNAPSHOT 4.0.1-SNAPSHOT

View File

@ -49,6 +49,17 @@ To run the server
./build/src/cpp-qt5-qhttpengine-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 #### Invoke an API
```shell ```shell

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -37,13 +37,16 @@ OAIApiResponse::~OAIApiResponse() {
void void
OAIApiResponse::init() { OAIApiResponse::init() {
m_code_isSet = false; m_code_isSet = false;
m_code_isValid = false; m_code_isValid = false;
m_type_isSet = false; m_type_isSet = false;
m_type_isValid = false; m_type_isValid = false;
m_message_isSet = false; m_message_isSet = false;
m_message_isValid = false; m_message_isValid = false;
} }
void void
OAIApiResponse::fromJson(QString jsonString) { OAIApiResponse::fromJson(QString jsonString) {
@ -55,12 +58,16 @@ OAIApiResponse::fromJson(QString jsonString) {
void void
OAIApiResponse::fromJsonObject(QJsonObject json) { OAIApiResponse::fromJsonObject(QJsonObject json) {
m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]); m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]);
m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]); m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]);
m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]); m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]);
} }
QString QString
@ -86,6 +93,7 @@ OAIApiResponse::asJsonObject() const {
return obj; return obj;
} }
qint32 qint32
OAIApiResponse::getCode() const { OAIApiResponse::getCode() const {
return code; return code;
@ -96,6 +104,7 @@ OAIApiResponse::setCode(const qint32 &code) {
this->m_code_isSet = true; this->m_code_isSet = true;
} }
QString QString
OAIApiResponse::getType() const { OAIApiResponse::getType() const {
return type; return type;
@ -106,6 +115,7 @@ OAIApiResponse::setType(const QString &type) {
this->m_type_isSet = true; this->m_type_isSet = true;
} }
QString QString
OAIApiResponse::getMessage() const { OAIApiResponse::getMessage() const {
return message; return message;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -25,6 +25,7 @@
#include <QString> #include <QString>
#include "OAIObject.h" #include "OAIObject.h"
#include "OAIEnum.h"
namespace OpenAPI { namespace OpenAPI {
@ -39,30 +40,39 @@ public:
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint32 getCode() const; qint32 getCode() const;
void setCode(const qint32 &code); void setCode(const qint32 &code);
QString getType() const; QString getType() const;
void setType(const QString &type); void setType(const QString &type);
QString getMessage() const; QString getMessage() const;
void setMessage(const QString &message); void setMessage(const QString &message);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void init();
qint32 code; qint32 code;
bool m_code_isSet; bool m_code_isSet;
bool m_code_isValid; bool m_code_isValid;
QString type; QString type;
bool m_type_isSet; bool m_type_isSet;
bool m_type_isValid; bool m_type_isValid;
QString message; QString message;
bool m_message_isSet; bool m_message_isSet;
bool m_message_isValid; bool m_message_isValid;
};
};
} }

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -37,11 +37,13 @@ OAICategory::~OAICategory() {
void void
OAICategory::init() { OAICategory::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_name_isSet = false; m_name_isSet = false;
m_name_isValid = false; m_name_isValid = false;
} }
void void
OAICategory::fromJson(QString jsonString) { OAICategory::fromJson(QString jsonString) {
@ -53,10 +55,13 @@ OAICategory::fromJson(QString jsonString) {
void void
OAICategory::fromJsonObject(QJsonObject json) { OAICategory::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
} }
QString QString
@ -79,6 +84,7 @@ OAICategory::asJsonObject() const {
return obj; return obj;
} }
qint64 qint64
OAICategory::getId() const { OAICategory::getId() const {
return id; return id;
@ -89,6 +95,7 @@ OAICategory::setId(const qint64 &id) {
this->m_id_isSet = true; this->m_id_isSet = true;
} }
QString QString
OAICategory::getName() const { OAICategory::getName() const {
return name; return name;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -25,6 +25,7 @@
#include <QString> #include <QString>
#include "OAIObject.h" #include "OAIObject.h"
#include "OAIEnum.h"
namespace OpenAPI { namespace OpenAPI {
@ -39,24 +40,31 @@ public:
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
QString getName() const; QString getName() const;
void setName(const QString &name); void setName(const QString &name);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void init();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
QString name; QString name;
bool m_name_isSet; bool m_name_isSet;
bool m_name_isValid; bool m_name_isValid;
};
};
} }

View File

@ -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 <QString>
#include <QJsonValue>
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

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -12,7 +12,7 @@
#include <QDebug> #include <QDebug>
#include "OAIHelpers.h" #include "OAIHelpers.h"
#include "OAIObject.h"
namespace OpenAPI { namespace OpenAPI {
@ -64,6 +64,11 @@ toStringValue(const double &value){
return QString::number(value); return QString::number(value);
} }
QString
toStringValue(const OAIEnum &value){
return value.asJson();
}
QJsonValue QJsonValue
toJsonValue(const QString &value){ toJsonValue(const QString &value){
return QJsonValue(value); return QJsonValue(value);
@ -114,6 +119,11 @@ toJsonValue(const OAIObject &value){
return value.asJsonObject(); return value.asJsonObject();
} }
QJsonValue
toJsonValue(const OAIEnum &value){
return value.asJsonValue();
}
bool bool
fromStringValue(const QString &inStr, QString &value){ fromStringValue(const QString &inStr, QString &value){
value.clear(); value.clear();
@ -202,6 +212,12 @@ fromStringValue(const QString &inStr, double &value){
return ok; return ok;
} }
bool
fromStringValue(const QString &inStr, OAIEnum &value){
value.fromJson(inStr);
return true;
}
bool bool
fromJsonValue(QString &value, const QJsonValue &jval){ fromJsonValue(QString &value, const QJsonValue &jval){
bool ok = true; bool ok = true;
@ -324,4 +340,10 @@ fromJsonValue(OAIObject &value, const QJsonValue &jval){
return ok; return ok;
} }
bool
fromJsonValue(OAIEnum &value, const QJsonValue &jval){
value.fromJsonValue(jval);
return true;
}
} }

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -23,6 +23,7 @@
#include <QDate> #include <QDate>
#include <QVariant> #include <QVariant>
#include "OAIObject.h" #include "OAIObject.h"
#include "OAIEnum.h"
namespace OpenAPI { namespace OpenAPI {
@ -35,6 +36,7 @@ namespace OpenAPI {
QString toStringValue(const bool &value); QString toStringValue(const bool &value);
QString toStringValue(const float &value); QString toStringValue(const float &value);
QString toStringValue(const double &value); QString toStringValue(const double &value);
QString toStringValue(const OAIEnum &value);
template <typename T> template <typename T>
QString toStringValue(const QList<T> &val) { QString toStringValue(const QList<T> &val) {
@ -58,6 +60,7 @@ namespace OpenAPI {
QJsonValue toJsonValue(const float &value); QJsonValue toJsonValue(const float &value);
QJsonValue toJsonValue(const double &value); QJsonValue toJsonValue(const double &value);
QJsonValue toJsonValue(const OAIObject &value); QJsonValue toJsonValue(const OAIObject &value);
QJsonValue toJsonValue(const OAIEnum &value);
template <typename T> template <typename T>
QJsonValue toJsonValue(const QList<T> &val) { QJsonValue toJsonValue(const QList<T> &val) {
@ -86,6 +89,7 @@ namespace OpenAPI {
bool fromStringValue(const QString &inStr, bool &value); bool fromStringValue(const QString &inStr, bool &value);
bool fromStringValue(const QString &inStr, float &value); bool fromStringValue(const QString &inStr, float &value);
bool fromStringValue(const QString &inStr, double &value); bool fromStringValue(const QString &inStr, double &value);
bool fromStringValue(const QString &inStr, OAIEnum &value);
template <typename T> template <typename T>
bool fromStringValue(const QList<QString> &inStr, QList<T> &val) { bool fromStringValue(const QList<QString> &inStr, QList<T> &val) {
@ -119,6 +123,7 @@ namespace OpenAPI {
bool fromJsonValue(float &value, const QJsonValue &jval); bool fromJsonValue(float &value, const QJsonValue &jval);
bool fromJsonValue(double &value, const QJsonValue &jval); bool fromJsonValue(double &value, const QJsonValue &jval);
bool fromJsonValue(OAIObject &value, const QJsonValue &jval); bool fromJsonValue(OAIObject &value, const QJsonValue &jval);
bool fromJsonValue(OAIEnum &value, const QJsonValue &jval);
template <typename T> template <typename T>
bool fromJsonValue(QList<T> &val, const QJsonValue &jval) { bool fromJsonValue(QList<T> &val, const QJsonValue &jval) {

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -37,19 +37,25 @@ OAIOrder::~OAIOrder() {
void void
OAIOrder::init() { OAIOrder::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_pet_id_isSet = false; m_pet_id_isSet = false;
m_pet_id_isValid = false; m_pet_id_isValid = false;
m_quantity_isSet = false; m_quantity_isSet = false;
m_quantity_isValid = false; m_quantity_isValid = false;
m_ship_date_isSet = false; m_ship_date_isSet = false;
m_ship_date_isValid = false; m_ship_date_isValid = false;
m_status_isSet = false; m_status_isSet = false;
m_status_isValid = false; m_status_isValid = false;
m_complete_isSet = false; m_complete_isSet = false;
m_complete_isValid = false; m_complete_isValid = false;
} }
void void
OAIOrder::fromJson(QString jsonString) { OAIOrder::fromJson(QString jsonString) {
@ -61,18 +67,25 @@ OAIOrder::fromJson(QString jsonString) {
void void
OAIOrder::fromJsonObject(QJsonObject json) { OAIOrder::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]); m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]);
m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]); m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]);
m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]); m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]);
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]); m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]);
} }
QString QString
@ -107,6 +120,7 @@ OAIOrder::asJsonObject() const {
return obj; return obj;
} }
qint64 qint64
OAIOrder::getId() const { OAIOrder::getId() const {
return id; return id;
@ -117,6 +131,7 @@ OAIOrder::setId(const qint64 &id) {
this->m_id_isSet = true; this->m_id_isSet = true;
} }
qint64 qint64
OAIOrder::getPetId() const { OAIOrder::getPetId() const {
return pet_id; return pet_id;
@ -127,6 +142,7 @@ OAIOrder::setPetId(const qint64 &pet_id) {
this->m_pet_id_isSet = true; this->m_pet_id_isSet = true;
} }
qint32 qint32
OAIOrder::getQuantity() const { OAIOrder::getQuantity() const {
return quantity; return quantity;
@ -137,6 +153,7 @@ OAIOrder::setQuantity(const qint32 &quantity) {
this->m_quantity_isSet = true; this->m_quantity_isSet = true;
} }
QDateTime QDateTime
OAIOrder::getShipDate() const { OAIOrder::getShipDate() const {
return ship_date; return ship_date;
@ -147,6 +164,7 @@ OAIOrder::setShipDate(const QDateTime &ship_date) {
this->m_ship_date_isSet = true; this->m_ship_date_isSet = true;
} }
QString QString
OAIOrder::getStatus() const { OAIOrder::getStatus() const {
return status; return status;
@ -157,6 +175,7 @@ OAIOrder::setStatus(const QString &status) {
this->m_status_isSet = true; this->m_status_isSet = true;
} }
bool bool
OAIOrder::isComplete() const { OAIOrder::isComplete() const {
return complete; return complete;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -26,6 +26,7 @@
#include <QString> #include <QString>
#include "OAIObject.h" #include "OAIObject.h"
#include "OAIEnum.h"
namespace OpenAPI { namespace OpenAPI {
@ -40,48 +41,63 @@ public:
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
qint64 getPetId() const; qint64 getPetId() const;
void setPetId(const qint64 &pet_id); void setPetId(const qint64 &pet_id);
qint32 getQuantity() const; qint32 getQuantity() const;
void setQuantity(const qint32 &quantity); void setQuantity(const qint32 &quantity);
QDateTime getShipDate() const; QDateTime getShipDate() const;
void setShipDate(const QDateTime &ship_date); void setShipDate(const QDateTime &ship_date);
QString getStatus() const; QString getStatus() const;
void setStatus(const QString &status); void setStatus(const QString &status);
bool isComplete() const; bool isComplete() const;
void setComplete(const bool &complete); void setComplete(const bool &complete);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void init();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
qint64 pet_id; qint64 pet_id;
bool m_pet_id_isSet; bool m_pet_id_isSet;
bool m_pet_id_isValid; bool m_pet_id_isValid;
qint32 quantity; qint32 quantity;
bool m_quantity_isSet; bool m_quantity_isSet;
bool m_quantity_isValid; bool m_quantity_isValid;
QDateTime ship_date; QDateTime ship_date;
bool m_ship_date_isSet; bool m_ship_date_isSet;
bool m_ship_date_isValid; bool m_ship_date_isValid;
QString status; QString status;
bool m_status_isSet; bool m_status_isSet;
bool m_status_isValid; bool m_status_isValid;
bool complete; bool complete;
bool m_complete_isSet; bool m_complete_isSet;
bool m_complete_isValid; bool m_complete_isValid;
};
};
} }

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -37,19 +37,25 @@ OAIPet::~OAIPet() {
void void
OAIPet::init() { OAIPet::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_category_isSet = false; m_category_isSet = false;
m_category_isValid = false; m_category_isValid = false;
m_name_isSet = false; m_name_isSet = false;
m_name_isValid = false; m_name_isValid = false;
m_photo_urls_isSet = false; m_photo_urls_isSet = false;
m_photo_urls_isValid = false; m_photo_urls_isValid = false;
m_tags_isSet = false; m_tags_isSet = false;
m_tags_isValid = false; m_tags_isValid = false;
m_status_isSet = false; m_status_isSet = false;
m_status_isValid = false; m_status_isValid = false;
} }
void void
OAIPet::fromJson(QString jsonString) { OAIPet::fromJson(QString jsonString) {
@ -61,18 +67,25 @@ OAIPet::fromJson(QString jsonString) {
void void
OAIPet::fromJsonObject(QJsonObject json) { OAIPet::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]); m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]);
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
m_photo_urls_isValid = ::OpenAPI::fromJsonValue(photo_urls, json[QString("photoUrls")]); m_photo_urls_isValid = ::OpenAPI::fromJsonValue(photo_urls, json[QString("photoUrls")]);
m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]); m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]);
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
} }
QString QString
@ -109,6 +122,7 @@ OAIPet::asJsonObject() const {
return obj; return obj;
} }
qint64 qint64
OAIPet::getId() const { OAIPet::getId() const {
return id; return id;
@ -119,6 +133,7 @@ OAIPet::setId(const qint64 &id) {
this->m_id_isSet = true; this->m_id_isSet = true;
} }
OAICategory OAICategory
OAIPet::getCategory() const { OAIPet::getCategory() const {
return category; return category;
@ -129,6 +144,7 @@ OAIPet::setCategory(const OAICategory &category) {
this->m_category_isSet = true; this->m_category_isSet = true;
} }
QString QString
OAIPet::getName() const { OAIPet::getName() const {
return name; return name;
@ -139,6 +155,7 @@ OAIPet::setName(const QString &name) {
this->m_name_isSet = true; this->m_name_isSet = true;
} }
QList<QString> QList<QString>
OAIPet::getPhotoUrls() const { OAIPet::getPhotoUrls() const {
return photo_urls; return photo_urls;
@ -149,6 +166,7 @@ OAIPet::setPhotoUrls(const QList<QString> &photo_urls) {
this->m_photo_urls_isSet = true; this->m_photo_urls_isSet = true;
} }
QList<OAITag> QList<OAITag>
OAIPet::getTags() const { OAIPet::getTags() const {
return tags; return tags;
@ -159,6 +177,7 @@ OAIPet::setTags(const QList<OAITag> &tags) {
this->m_tags_isSet = true; this->m_tags_isSet = true;
} }
QString QString
OAIPet::getStatus() const { OAIPet::getStatus() const {
return status; return status;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -28,6 +28,7 @@
#include <QString> #include <QString>
#include "OAIObject.h" #include "OAIObject.h"
#include "OAIEnum.h"
namespace OpenAPI { namespace OpenAPI {
@ -42,48 +43,63 @@ public:
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
OAICategory getCategory() const; OAICategory getCategory() const;
void setCategory(const OAICategory &category); void setCategory(const OAICategory &category);
QString getName() const; QString getName() const;
void setName(const QString &name); void setName(const QString &name);
QList<QString> getPhotoUrls() const; QList<QString> getPhotoUrls() const;
void setPhotoUrls(const QList<QString> &photo_urls); void setPhotoUrls(const QList<QString> &photo_urls);
QList<OAITag> getTags() const; QList<OAITag> getTags() const;
void setTags(const QList<OAITag> &tags); void setTags(const QList<OAITag> &tags);
QString getStatus() const; QString getStatus() const;
void setStatus(const QString &status); void setStatus(const QString &status);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void init();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
OAICategory category; OAICategory category;
bool m_category_isSet; bool m_category_isSet;
bool m_category_isValid; bool m_category_isValid;
QString name; QString name;
bool m_name_isSet; bool m_name_isSet;
bool m_name_isValid; bool m_name_isValid;
QList<QString> photo_urls; QList<QString> photo_urls;
bool m_photo_urls_isSet; bool m_photo_urls_isSet;
bool m_photo_urls_isValid; bool m_photo_urls_isValid;
QList<OAITag> tags; QList<OAITag> tags;
bool m_tags_isSet; bool m_tags_isSet;
bool m_tags_isValid; bool m_tags_isValid;
QString status; QString status;
bool m_status_isSet; bool m_status_isSet;
bool m_status_isValid; bool m_status_isValid;
};
};
} }

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -37,11 +37,13 @@ OAITag::~OAITag() {
void void
OAITag::init() { OAITag::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_name_isSet = false; m_name_isSet = false;
m_name_isValid = false; m_name_isValid = false;
} }
void void
OAITag::fromJson(QString jsonString) { OAITag::fromJson(QString jsonString) {
@ -53,10 +55,13 @@ OAITag::fromJson(QString jsonString) {
void void
OAITag::fromJsonObject(QJsonObject json) { OAITag::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]);
} }
QString QString
@ -79,6 +84,7 @@ OAITag::asJsonObject() const {
return obj; return obj;
} }
qint64 qint64
OAITag::getId() const { OAITag::getId() const {
return id; return id;
@ -89,6 +95,7 @@ OAITag::setId(const qint64 &id) {
this->m_id_isSet = true; this->m_id_isSet = true;
} }
QString QString
OAITag::getName() const { OAITag::getName() const {
return name; return name;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -25,6 +25,7 @@
#include <QString> #include <QString>
#include "OAIObject.h" #include "OAIObject.h"
#include "OAIEnum.h"
namespace OpenAPI { namespace OpenAPI {
@ -39,24 +40,31 @@ public:
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
QString getName() const; QString getName() const;
void setName(const QString &name); void setName(const QString &name);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void init();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
QString name; QString name;
bool m_name_isSet; bool m_name_isSet;
bool m_name_isValid; bool m_name_isValid;
};
};
} }

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -37,23 +37,31 @@ OAIUser::~OAIUser() {
void void
OAIUser::init() { OAIUser::init() {
m_id_isSet = false; m_id_isSet = false;
m_id_isValid = false; m_id_isValid = false;
m_username_isSet = false; m_username_isSet = false;
m_username_isValid = false; m_username_isValid = false;
m_first_name_isSet = false; m_first_name_isSet = false;
m_first_name_isValid = false; m_first_name_isValid = false;
m_last_name_isSet = false; m_last_name_isSet = false;
m_last_name_isValid = false; m_last_name_isValid = false;
m_email_isSet = false; m_email_isSet = false;
m_email_isValid = false; m_email_isValid = false;
m_password_isSet = false; m_password_isSet = false;
m_password_isValid = false; m_password_isValid = false;
m_phone_isSet = false; m_phone_isSet = false;
m_phone_isValid = false; m_phone_isValid = false;
m_user_status_isSet = false; m_user_status_isSet = false;
m_user_status_isValid = false; m_user_status_isValid = false;
} }
void void
OAIUser::fromJson(QString jsonString) { OAIUser::fromJson(QString jsonString) {
@ -65,22 +73,31 @@ OAIUser::fromJson(QString jsonString) {
void void
OAIUser::fromJsonObject(QJsonObject json) { OAIUser::fromJsonObject(QJsonObject json) {
m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]);
m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]); m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]);
m_first_name_isValid = ::OpenAPI::fromJsonValue(first_name, json[QString("firstName")]); m_first_name_isValid = ::OpenAPI::fromJsonValue(first_name, json[QString("firstName")]);
m_last_name_isValid = ::OpenAPI::fromJsonValue(last_name, json[QString("lastName")]); m_last_name_isValid = ::OpenAPI::fromJsonValue(last_name, json[QString("lastName")]);
m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]); m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]);
m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]); m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]);
m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]); m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]);
m_user_status_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]); m_user_status_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]);
} }
QString QString
@ -121,6 +138,7 @@ OAIUser::asJsonObject() const {
return obj; return obj;
} }
qint64 qint64
OAIUser::getId() const { OAIUser::getId() const {
return id; return id;
@ -131,6 +149,7 @@ OAIUser::setId(const qint64 &id) {
this->m_id_isSet = true; this->m_id_isSet = true;
} }
QString QString
OAIUser::getUsername() const { OAIUser::getUsername() const {
return username; return username;
@ -141,6 +160,7 @@ OAIUser::setUsername(const QString &username) {
this->m_username_isSet = true; this->m_username_isSet = true;
} }
QString QString
OAIUser::getFirstName() const { OAIUser::getFirstName() const {
return first_name; return first_name;
@ -151,6 +171,7 @@ OAIUser::setFirstName(const QString &first_name) {
this->m_first_name_isSet = true; this->m_first_name_isSet = true;
} }
QString QString
OAIUser::getLastName() const { OAIUser::getLastName() const {
return last_name; return last_name;
@ -161,6 +182,7 @@ OAIUser::setLastName(const QString &last_name) {
this->m_last_name_isSet = true; this->m_last_name_isSet = true;
} }
QString QString
OAIUser::getEmail() const { OAIUser::getEmail() const {
return email; return email;
@ -171,6 +193,7 @@ OAIUser::setEmail(const QString &email) {
this->m_email_isSet = true; this->m_email_isSet = true;
} }
QString QString
OAIUser::getPassword() const { OAIUser::getPassword() const {
return password; return password;
@ -181,6 +204,7 @@ OAIUser::setPassword(const QString &password) {
this->m_password_isSet = true; this->m_password_isSet = true;
} }
QString QString
OAIUser::getPhone() const { OAIUser::getPhone() const {
return phone; return phone;
@ -191,6 +215,7 @@ OAIUser::setPhone(const QString &phone) {
this->m_phone_isSet = true; this->m_phone_isSet = true;
} }
qint32 qint32
OAIUser::getUserStatus() const { OAIUser::getUserStatus() const {
return user_status; return user_status;

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -25,6 +25,7 @@
#include <QString> #include <QString>
#include "OAIObject.h" #include "OAIObject.h"
#include "OAIEnum.h"
namespace OpenAPI { namespace OpenAPI {
@ -39,60 +40,79 @@ public:
void fromJsonObject(QJsonObject json) override; void fromJsonObject(QJsonObject json) override;
void fromJson(QString jsonString) override; void fromJson(QString jsonString) override;
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &id); void setId(const qint64 &id);
QString getUsername() const; QString getUsername() const;
void setUsername(const QString &username); void setUsername(const QString &username);
QString getFirstName() const; QString getFirstName() const;
void setFirstName(const QString &first_name); void setFirstName(const QString &first_name);
QString getLastName() const; QString getLastName() const;
void setLastName(const QString &last_name); void setLastName(const QString &last_name);
QString getEmail() const; QString getEmail() const;
void setEmail(const QString &email); void setEmail(const QString &email);
QString getPassword() const; QString getPassword() const;
void setPassword(const QString &password); void setPassword(const QString &password);
QString getPhone() const; QString getPhone() const;
void setPhone(const QString &phone); void setPhone(const QString &phone);
qint32 getUserStatus() const; qint32 getUserStatus() const;
void setUserStatus(const qint32 &user_status); void setUserStatus(const qint32 &user_status);
virtual bool isSet() const override; virtual bool isSet() const override;
virtual bool isValid() const override; virtual bool isValid() const override;
private: private:
void init(); void init();
qint64 id; qint64 id;
bool m_id_isSet; bool m_id_isSet;
bool m_id_isValid; bool m_id_isValid;
QString username; QString username;
bool m_username_isSet; bool m_username_isSet;
bool m_username_isValid; bool m_username_isValid;
QString first_name; QString first_name;
bool m_first_name_isSet; bool m_first_name_isSet;
bool m_first_name_isValid; bool m_first_name_isValid;
QString last_name; QString last_name;
bool m_last_name_isSet; bool m_last_name_isSet;
bool m_last_name_isValid; bool m_last_name_isValid;
QString email; QString email;
bool m_email_isSet; bool m_email_isSet;
bool m_email_isValid; bool m_email_isValid;
QString password; QString password;
bool m_password_isSet; bool m_password_isSet;
bool m_password_isValid; bool m_password_isValid;
QString phone; QString phone;
bool m_phone_isSet; bool m_phone_isSet;
bool m_phone_isValid; bool m_phone_isValid;
qint32 user_status; qint32 user_status;
bool m_user_status_isSet; bool m_user_status_isSet;
bool m_user_status_isValid; bool m_user_status_isValid;
};
};
} }

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -2,7 +2,7 @@
* OpenAPI Petstore * 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. * 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). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).