diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache index 29918951019..4dd03102bad 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache @@ -1,6 +1,7 @@ {{>licenseInfo}} -#include "{{prefix}}Helpers.h" #include +#include +#include "{{prefix}}Helpers.h" {{#cppNamespaceDeclarations}} namespace {{this}} { @@ -178,6 +179,17 @@ bool fromStringValue(const QString &inStr, double &value) { return ok; } +bool fromStringValue(const QString &inStr, {{prefix}}Object &value) +{ + QJsonParseError err; + QJsonDocument::fromJson(inStr.toUtf8(),&err); + if ( err.error == QJsonParseError::NoError ){ + value.fromJson(inStr); + return true; + } + return false; +} + bool fromStringValue(const QString &inStr, {{prefix}}Enum &value) { value.fromJson(inStr); return true; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.cpp.mustache index a4ff7f64c4a..ff515e56989 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.cpp.mustache @@ -1,5 +1,4 @@ {{>licenseInfo}} - #include #include #include @@ -11,129 +10,117 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} -void -{{prefix}}HttpFileElement::setMimeType(const QString &mime){ +void {{prefix}}HttpFileElement::setMimeType(const QString &mime) { mime_type = mime; } -void -{{prefix}}HttpFileElement::setFileName(const QString &name){ +void {{prefix}}HttpFileElement::setFileName(const QString &name) { local_filename = name; } -void -{{prefix}}HttpFileElement::setVariableName(const QString &name){ +void {{prefix}}HttpFileElement::setVariableName(const QString &name) { variable_name = name; } -void -{{prefix}}HttpFileElement::setRequestFileName(const QString &name){ +void {{prefix}}HttpFileElement::setRequestFileName(const QString &name) { request_filename = name; } -bool -{{prefix}}HttpFileElement::isSet() const { +bool {{prefix}}HttpFileElement::isSet() const { return !local_filename.isEmpty() || !request_filename.isEmpty(); } -QString -{{prefix}}HttpFileElement::asJson() const{ +QString {{prefix}}HttpFileElement::asJson() const { QFile file(local_filename); QByteArray bArray; bool result = false; - if(file.exists()) { + if (file.exists()) { result = file.open(QIODevice::ReadOnly); bArray = file.readAll(); file.close(); } - if(!result) { + if (!result) { qDebug() << "Error opening file " << local_filename; } return QString(bArray); } -QJsonValue -{{prefix}}HttpFileElement::asJsonValue() const{ +QJsonValue {{prefix}}HttpFileElement::asJsonValue() const { QFile file(local_filename); QByteArray bArray; - bool result = false; - if(file.exists()) { + bool result = false; + if (file.exists()) { result = file.open(QIODevice::ReadOnly); bArray = file.readAll(); file.close(); } - if(!result) { + if (!result) { qDebug() << "Error opening file " << local_filename; } return QJsonDocument::fromBinaryData(bArray.data()).object(); } -bool -{{prefix}}HttpFileElement::fromStringValue(const QString &instr){ +bool {{prefix}}HttpFileElement::fromStringValue(const QString &instr) { QFile file(local_filename); bool result = false; - if(file.exists()) { + if (file.exists()) { file.remove(); } result = file.open(QIODevice::WriteOnly); file.write(instr.toUtf8()); file.close(); - if(!result) { + if (!result) { qDebug() << "Error creating file " << local_filename; } return result; } -bool -{{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) { +bool {{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) { QFile file(local_filename); bool result = false; - if(file.exists()) { + if (file.exists()) { file.remove(); } result = file.open(QIODevice::WriteOnly); file.write(QJsonDocument(jval.toObject()).toBinaryData()); file.close(); - if(!result) { + if (!result) { qDebug() << "Error creating file " << local_filename; } return result; } -QByteArray -{{prefix}}HttpFileElement::asByteArray() const { +QByteArray {{prefix}}HttpFileElement::asByteArray() const { QFile file(local_filename); QByteArray bArray; bool result = false; - if(file.exists()) { + if (file.exists()) { result = file.open(QIODevice::ReadOnly); bArray = file.readAll(); file.close(); } - if(!result) { + if (!result) { qDebug() << "Error opening file " << local_filename; - } + } return bArray; } -bool -{{prefix}}HttpFileElement::fromByteArray(const QByteArray& bytes){ +bool {{prefix}}HttpFileElement::fromByteArray(const QByteArray &bytes) { QFile file(local_filename); bool result = false; - if(file.exists()){ + if (file.exists()) { file.remove(); } result = file.open(QIODevice::WriteOnly); file.write(bytes); file.close(); - if(!result) { + if (!result) { qDebug() << "Error creating file " << local_filename; } return result; } -bool -{{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ +bool {{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray &bytes) { setMimeType(mime); setFileName(localFName); setVariableName(varName); @@ -141,8 +128,7 @@ bool return fromByteArray(bytes); } -QByteArray -{{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ +QByteArray {{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime) { setMimeType(mime); setFileName(localFName); setVariableName(varName); @@ -151,5 +137,5 @@ QByteArray } {{#cppNamespaceDeclarations}} -} -{{/cppNamespaceDeclarations}} \ No newline at end of file +} // namespace {{this}} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.h.mustache index 9ebfe362356..d09c4e57db8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.h.mustache @@ -6,7 +6,6 @@ #include #include - {{#cppNamespaceDeclarations}} namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -25,8 +24,8 @@ public: bool isSet() const; bool fromStringValue(const QString &instr); bool fromJsonValue(const QJsonValue &jval); - bool fromByteArray(const QByteArray& bytes); - bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); + bool fromByteArray(const QByteArray &bytes); + bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray &bytes); QString asJson() const; QJsonValue asJsonValue() const; QByteArray asByteArray() const; @@ -34,7 +33,7 @@ public: }; {{#cppNamespaceDeclarations}} -} +} // namespace {{this}} {{/cppNamespaceDeclarations}} Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}HttpFileElement) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache index bf34a3a150c..7a613a5947d 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache @@ -2,27 +2,23 @@ #ifndef {{prefix}}_ENUM_H #define {{prefix}}_ENUM_H -#include #include #include +#include {{#cppNamespaceDeclarations}} namespace {{this}} { {{/cppNamespaceDeclarations}} class {{prefix}}Enum { - public: - {{prefix}}Enum() { - - } +public: + {{prefix}}Enum() {} {{prefix}}Enum(QString jsonString) { fromJson(jsonString); } - virtual ~{{prefix}}Enum(){ - - } + virtual ~{{prefix}}Enum() {} virtual QJsonValue asJsonValue() const { return QJsonValue(jstr); @@ -47,12 +43,13 @@ class {{prefix}}Enum { virtual bool isValid() const { return true; } -private : + +private: QString jstr; }; {{#cppNamespaceDeclarations}} -} +} // namespace {{this}} {{/cppNamespaceDeclarations}} Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Enum) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache index 24ff004c9f6..4dd03102bad 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache @@ -3,227 +3,183 @@ #include #include "{{prefix}}Helpers.h" - {{#cppNamespaceDeclarations}} namespace {{this}} { {{/cppNamespaceDeclarations}} - -QString -toStringValue(const QString &value) { +QString toStringValue(const QString &value) { return value; } -QString -toStringValue(const QDateTime &value){ +QString toStringValue(const QDateTime &value) { // ISO 8601 return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); } -QString -toStringValue(const QByteArray &value){ +QString toStringValue(const QByteArray &value) { return QString(value); } -QString -toStringValue(const QDate &value){ +QString toStringValue(const QDate &value) { // ISO 8601 return value.toString(Qt::DateFormat::ISODate); } -QString -toStringValue(const qint32 &value) { +QString toStringValue(const qint32 &value) { return QString::number(value); } -QString -toStringValue(const qint64 &value) { +QString toStringValue(const qint64 &value) { return QString::number(value); } -QString -toStringValue(const bool &value) { +QString toStringValue(const bool &value) { return QString(value ? "true" : "false"); } -QString -toStringValue(const float &value){ +QString toStringValue(const float &value) { return QString::number(static_cast(value)); } -QString -toStringValue(const double &value){ +QString toStringValue(const double &value) { return QString::number(value); } -QString -toStringValue(const {{prefix}}Object &value){ +QString toStringValue(const {{prefix}}Object &value) { return value.asJson(); } - -QString -toStringValue(const {{prefix}}Enum &value){ +QString toStringValue(const {{prefix}}Enum &value) { return value.asJson(); } -QString -toStringValue(const {{prefix}}HttpFileElement &value){ +QString toStringValue(const {{prefix}}HttpFileElement &value) { return value.asJson(); } - -QJsonValue -toJsonValue(const QString &value){ - return QJsonValue(value); +QJsonValue toJsonValue(const QString &value) { + return QJsonValue(value); } -QJsonValue -toJsonValue(const QDateTime &value){ +QJsonValue toJsonValue(const QDateTime &value) { return QJsonValue(value.toString(Qt::ISODate)); } -QJsonValue -toJsonValue(const QByteArray &value){ +QJsonValue toJsonValue(const QByteArray &value) { return QJsonValue(QString(value.toBase64())); } -QJsonValue -toJsonValue(const QDate &value){ +QJsonValue toJsonValue(const QDate &value) { return QJsonValue(value.toString(Qt::ISODate)); } -QJsonValue -toJsonValue(const qint32 &value){ +QJsonValue toJsonValue(const qint32 &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const qint64 &value){ +QJsonValue toJsonValue(const qint64 &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const bool &value){ +QJsonValue toJsonValue(const bool &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const float &value){ +QJsonValue toJsonValue(const float &value) { return QJsonValue(static_cast(value)); } -QJsonValue -toJsonValue(const double &value){ +QJsonValue toJsonValue(const double &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const {{prefix}}Object &value){ +QJsonValue toJsonValue(const {{prefix}}Object &value) { return value.asJsonObject(); } -QJsonValue -toJsonValue(const {{prefix}}Enum &value){ +QJsonValue toJsonValue(const {{prefix}}Enum &value) { return value.asJsonValue(); } -QJsonValue -toJsonValue(const {{prefix}}HttpFileElement &value){ +QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value) { return value.asJsonValue(); } - -bool -fromStringValue(const QString &inStr, QString &value){ +bool fromStringValue(const QString &inStr, QString &value) { value.clear(); value.append(inStr); return !inStr.isEmpty(); } -bool -fromStringValue(const QString &inStr, QDateTime &value){ - if(inStr.isEmpty()){ +bool fromStringValue(const QString &inStr, QDateTime &value) { + if (inStr.isEmpty()) { return false; - } - else{ + } else { auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); - if(dateTime.isValid()){ + if (dateTime.isValid()) { value.setDate(dateTime.date()); value.setTime(dateTime.time()); - } - else{ + } else { qDebug() << "DateTime is invalid"; } return dateTime.isValid(); } } -bool -fromStringValue(const QString &inStr, QByteArray &value){ - if(inStr.isEmpty()){ +bool fromStringValue(const QString &inStr, QByteArray &value) { + if (inStr.isEmpty()) { return false; - } - else{ + } else { value.clear(); value.append(inStr.toUtf8()); return value.count() > 0; } } -bool -fromStringValue(const QString &inStr, QDate &value){ - if(inStr.isEmpty()){ +bool fromStringValue(const QString &inStr, QDate &value) { + if (inStr.isEmpty()) { return false; - } - else{ + } else { auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate); - if(date.isValid()){ + if (date.isValid()) { value.setDate(date.year(), date.month(), date.day()); - } - else{ + } else { qDebug() << "Date is invalid"; } return date.isValid(); } } -bool -fromStringValue(const QString &inStr, qint32 &value){ +bool fromStringValue(const QString &inStr, qint32 &value) { bool ok = false; value = QVariant(inStr).toInt(&ok); return ok; } -bool -fromStringValue(const QString &inStr, qint64 &value){ +bool fromStringValue(const QString &inStr, qint64 &value) { bool ok = false; value = QVariant(inStr).toLongLong(&ok); return ok; } -bool -fromStringValue(const QString &inStr, bool &value){ +bool fromStringValue(const QString &inStr, bool &value) { value = QVariant(inStr).toBool(); return ((inStr == "true") || (inStr == "false")); } -bool -fromStringValue(const QString &inStr, float &value){ +bool fromStringValue(const QString &inStr, float &value) { bool ok = false; value = QVariant(inStr).toFloat(&ok); return ok; } -bool -fromStringValue(const QString &inStr, double &value){ +bool fromStringValue(const QString &inStr, double &value) { bool ok = false; value = QVariant(inStr).toDouble(&ok); return ok; } -bool -fromStringValue(const QString &inStr, {{prefix}}Object &value) +bool fromStringValue(const QString &inStr, {{prefix}}Object &value) { QJsonParseError err; QJsonDocument::fromJson(inStr.toUtf8(),&err); @@ -234,26 +190,23 @@ fromStringValue(const QString &inStr, {{prefix}}Object &value) return false; } -bool -fromStringValue(const QString &inStr, {{prefix}}Enum &value){ +bool fromStringValue(const QString &inStr, {{prefix}}Enum &value) { value.fromJson(inStr); return true; } -bool -fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value){ +bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value) { return value.fromStringValue(inStr); } -bool -fromJsonValue(QString &value, const QJsonValue &jval){ +bool fromJsonValue(QString &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull()){ - if(jval.isString()){ + if (!jval.isUndefined() && !jval.isNull()) { + if (jval.isString()) { value = jval.toString(); - } else if(jval.isBool()) { - value = jval.toBool() ? "true" : "false"; - } else if(jval.isDouble()){ + } else if (jval.isBool()) { + value = jval.toBool() ? "true" : "false"; + } else if (jval.isDouble()) { value = QString::number(jval.toDouble()); } else { ok = false; @@ -264,10 +217,9 @@ fromJsonValue(QString &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(QDateTime &value, const QJsonValue &jval){ +bool fromJsonValue(QDateTime &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ + if (!jval.isUndefined() && !jval.isNull() && jval.isString()) { value = QDateTime::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); } else { @@ -276,22 +228,20 @@ fromJsonValue(QDateTime &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(QByteArray &value, const QJsonValue &jval){ +bool fromJsonValue(QByteArray &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()) { + if (!jval.isUndefined() && !jval.isNull() && jval.isString()) { value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString())); - ok = value.size() > 0 ; + ok = value.size() > 0; } else { ok = false; } return ok; } -bool -fromJsonValue(QDate &value, const QJsonValue &jval){ +bool fromJsonValue(QDate &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ + if (!jval.isUndefined() && !jval.isNull() && jval.isString()) { value = QDate::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); } else { @@ -300,10 +250,9 @@ fromJsonValue(QDate &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(qint32 &value, const QJsonValue &jval){ +bool fromJsonValue(qint32 &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ + if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) { value = jval.toInt(); } else { ok = false; @@ -311,10 +260,9 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(qint64 &value, const QJsonValue &jval){ +bool fromJsonValue(qint64 &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ + if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) { value = jval.toVariant().toLongLong(); } else { ok = false; @@ -322,10 +270,9 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(bool &value, const QJsonValue &jval){ +bool fromJsonValue(bool &value, const QJsonValue &jval) { bool ok = true; - if(jval.isBool()){ + if (jval.isBool()) { value = jval.toBool(); } else { ok = false; @@ -333,10 +280,9 @@ fromJsonValue(bool &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(float &value, const QJsonValue &jval){ +bool fromJsonValue(float &value, const QJsonValue &jval) { bool ok = true; - if(jval.isDouble()){ + if (jval.isDouble()) { value = static_cast(jval.toDouble()); } else { ok = false; @@ -344,10 +290,9 @@ fromJsonValue(float &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(double &value, const QJsonValue &jval){ +bool fromJsonValue(double &value, const QJsonValue &jval) { bool ok = true; - if(jval.isDouble()){ + if (jval.isDouble()) { value = jval.toDouble(); } else { ok = false; @@ -355,10 +300,9 @@ fromJsonValue(double &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue({{prefix}}Object &value, const QJsonValue &jval){ +bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval) { bool ok = true; - if(jval.isObject()){ + if (jval.isObject()) { value.fromJsonObject(jval.toObject()); ok = value.isValid(); } else { @@ -367,17 +311,15 @@ fromJsonValue({{prefix}}Object &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval){ +bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval) { value.fromJsonValue(jval); return true; } -bool -fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval){ +bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval) { return value.fromJsonValue(jval); } {{#cppNamespaceDeclarations}} -} +} // namespace {{this}} {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache index f5275022a71..a53e0a30edd 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache @@ -2,163 +2,184 @@ #ifndef {{prefix}}_HELPERS_H #define {{prefix}}_HELPERS_H -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include #include -#include "{{prefix}}Object.h" #include "{{prefix}}Enum.h" #include "{{prefix}}HttpFileElement.h" +#include "{{prefix}}Object.h" {{#cppNamespaceDeclarations}} namespace {{this}} { {{/cppNamespaceDeclarations}} - QString toStringValue(const QString &value); - QString toStringValue(const QDateTime &value); - QString toStringValue(const QByteArray &value); - QString toStringValue(const QDate &value); - QString toStringValue(const qint32 &value); - QString toStringValue(const qint64 &value); - QString toStringValue(const bool &value); - QString toStringValue(const float &value); - QString toStringValue(const double &value); - QString toStringValue(const {{prefix}}Object &value); - QString toStringValue(const {{prefix}}Enum &value); - QString toStringValue(const {{prefix}}HttpFileElement &value); +template +QString toStringValue(const QList &val); - template - QString toStringValue(const QList &val) { - QString strArray; - for(const auto& item : val) { - strArray.append(toStringValue(item) + ","); - } - if(val.count() > 0) { - strArray.chop(1); - } - return strArray; +template +bool fromStringValue(const QList &inStr, QList &val); + +template +bool fromStringValue(const QMap &inStr, QMap &val); + +template +QJsonValue toJsonValue(const QList &val); + +template +QJsonValue toJsonValue(const QMap &val); + +template +bool fromJsonValue(QList &val, const QJsonValue &jval); + +template +bool fromJsonValue(QMap &val, const QJsonValue &jval); + +QString toStringValue(const QString &value); +QString toStringValue(const QDateTime &value); +QString toStringValue(const QByteArray &value); +QString toStringValue(const QDate &value); +QString toStringValue(const qint32 &value); +QString toStringValue(const qint64 &value); +QString toStringValue(const bool &value); +QString toStringValue(const float &value); +QString toStringValue(const double &value); +QString toStringValue(const {{prefix}}Object &value); +QString toStringValue(const {{prefix}}Enum &value); +QString toStringValue(const {{prefix}}HttpFileElement &value); + +template +QString toStringValue(const QList &val) { + QString strArray; + for (const auto &item : val) { + strArray.append(toStringValue(item) + ","); } - - QJsonValue toJsonValue(const QString &value); - QJsonValue toJsonValue(const QDateTime &value); - QJsonValue toJsonValue(const QByteArray &value); - QJsonValue toJsonValue(const QDate &value); - QJsonValue toJsonValue(const qint32 &value); - QJsonValue toJsonValue(const qint64 &value); - QJsonValue toJsonValue(const bool &value); - QJsonValue toJsonValue(const float &value); - QJsonValue toJsonValue(const double &value); - QJsonValue toJsonValue(const {{prefix}}Object &value); - QJsonValue toJsonValue(const {{prefix}}Enum &value); - QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value); - - template - QJsonValue toJsonValue(const QList &val) { - QJsonArray jArray; - for(const auto& item : val) { - jArray.append(toJsonValue(item)); - } - return jArray; + if (val.count() > 0) { + strArray.chop(1); } + return strArray; +} - template - QJsonValue toJsonValue(const QMap &val) { - QJsonObject jObject; - for(const auto& itemkey : val.keys()) { - jObject.insert(itemkey, toJsonValue(val.value(itemkey))); - } - return jObject; +QJsonValue toJsonValue(const QString &value); +QJsonValue toJsonValue(const QDateTime &value); +QJsonValue toJsonValue(const QByteArray &value); +QJsonValue toJsonValue(const QDate &value); +QJsonValue toJsonValue(const qint32 &value); +QJsonValue toJsonValue(const qint64 &value); +QJsonValue toJsonValue(const bool &value); +QJsonValue toJsonValue(const float &value); +QJsonValue toJsonValue(const double &value); +QJsonValue toJsonValue(const {{prefix}}Object &value); +QJsonValue toJsonValue(const {{prefix}}Enum &value); +QJsonValue toJsonValue(const {{prefix}}HttpFileElement &value); + +template +QJsonValue toJsonValue(const QList &val) { + QJsonArray jArray; + for (const auto &item : val) { + jArray.append(toJsonValue(item)); } + return jArray; +} - bool fromStringValue(const QString &inStr, QString &value); - bool fromStringValue(const QString &inStr, QDateTime &value); - bool fromStringValue(const QString &inStr, QByteArray &value); - bool fromStringValue(const QString &inStr, QDate &value); - bool fromStringValue(const QString &inStr, qint32 &value); - bool fromStringValue(const QString &inStr, qint64 &value); - 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, {{prefix}}Object &value); - bool fromStringValue(const QString &inStr, {{prefix}}Enum &value); - bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value); - - template - bool fromStringValue(const QList &inStr, QList &val) { - bool ok = (inStr.count() > 0); - for(const auto& item: inStr){ - T itemVal; - ok &= fromStringValue(item, itemVal); - val.push_back(itemVal); - } - return ok; +template +QJsonValue toJsonValue(const QMap &val) { + QJsonObject jObject; + for (const auto &itemkey : val.keys()) { + jObject.insert(itemkey, toJsonValue(val.value(itemkey))); } + return jObject; +} - template - bool fromStringValue(const QMap &inStr, QMap &val) { - bool ok = (inStr.count() > 0); - for(const auto& itemkey : inStr.keys()){ - T itemVal; - ok &= fromStringValue(inStr.value(itemkey), itemVal); - val.insert(itemkey, itemVal); - } - return ok; +bool fromStringValue(const QString &inStr, QString &value); +bool fromStringValue(const QString &inStr, QDateTime &value); +bool fromStringValue(const QString &inStr, QByteArray &value); +bool fromStringValue(const QString &inStr, QDate &value); +bool fromStringValue(const QString &inStr, qint32 &value); +bool fromStringValue(const QString &inStr, qint64 &value); +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, {{prefix}}Object &value); +bool fromStringValue(const QString &inStr, {{prefix}}Enum &value); +bool fromStringValue(const QString &inStr, {{prefix}}HttpFileElement &value); + +template +bool fromStringValue(const QList &inStr, QList &val) { + bool ok = (inStr.count() > 0); + for (const auto &item : inStr) { + T itemVal; + ok &= fromStringValue(item, itemVal); + val.push_back(itemVal); } + return ok; +} - bool fromJsonValue(QString &value, const QJsonValue &jval); - bool fromJsonValue(QDateTime &value, const QJsonValue &jval); - bool fromJsonValue(QByteArray &value, const QJsonValue &jval); - bool fromJsonValue(QDate &value, const QJsonValue &jval); - bool fromJsonValue(qint32 &value, const QJsonValue &jval); - bool fromJsonValue(qint64 &value, const QJsonValue &jval); - bool fromJsonValue(bool &value, const QJsonValue &jval); - bool fromJsonValue(float &value, const QJsonValue &jval); - bool fromJsonValue(double &value, const QJsonValue &jval); - bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval); - bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval); - bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval); +template +bool fromStringValue(const QMap &inStr, QMap &val) { + bool ok = (inStr.count() > 0); + for (const auto &itemkey : inStr.keys()) { + T itemVal; + ok &= fromStringValue(inStr.value(itemkey), itemVal); + val.insert(itemkey, itemVal); + } + return ok; +} - template - bool fromJsonValue(QList &val, const QJsonValue &jval) { - bool ok = true; - if(jval.isArray()){ - for(const auto& jitem : jval.toArray()){ - T item; - ok &= fromJsonValue(item, jitem); - val.push_back(item); +bool fromJsonValue(QString &value, const QJsonValue &jval); +bool fromJsonValue(QDateTime &value, const QJsonValue &jval); +bool fromJsonValue(QByteArray &value, const QJsonValue &jval); +bool fromJsonValue(QDate &value, const QJsonValue &jval); +bool fromJsonValue(qint32 &value, const QJsonValue &jval); +bool fromJsonValue(qint64 &value, const QJsonValue &jval); +bool fromJsonValue(bool &value, const QJsonValue &jval); +bool fromJsonValue(float &value, const QJsonValue &jval); +bool fromJsonValue(double &value, const QJsonValue &jval); +bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval); +bool fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval); +bool fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval); + +template +bool fromJsonValue(QList &val, const QJsonValue &jval) { + bool ok = true; + if (jval.isArray()) { + for (const auto jitem : jval.toArray()) { + T item; + ok &= fromJsonValue(item, jitem); + val.push_back(item); + } + } else { + ok = false; + } + return ok; +} + +template +bool fromJsonValue(QMap &val, const QJsonValue &jval) { + bool ok = true; + if (jval.isObject()) { + auto varmap = jval.toObject().toVariantMap(); + if (varmap.count() > 0) { + for (const auto &itemkey : varmap.keys()) { + T itemVal; + ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey))); + val.insert(itemkey, itemVal); } - } else { - ok = false; } - return ok; - } - - template - bool fromJsonValue(QMap &val, const QJsonValue &jval) { - bool ok = true; - if(jval.isObject()){ - auto varmap = jval.toObject().toVariantMap(); - if(varmap.count() > 0){ - for(const auto& itemkey : varmap.keys() ){ - T itemVal; - ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey))); - val.insert(itemkey, itemVal); - } - } - } else { - ok = false; - } - return ok; + } else { + ok = false; } + return ok; +} {{#cppNamespaceDeclarations}} -} +} // namespace {{this}} {{/cppNamespaceDeclarations}} #endif // {{prefix}}_HELPERS_H diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/licenseInfo.mustache index 9866f297a4d..360883d9f9d 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/licenseInfo.mustache @@ -3,8 +3,8 @@ * {{{appDescription}}} * * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} - * + *{{#infoEmail}} Contact: {{{infoEmail}}} + *{{/infoEmail}} * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache index 0f71c97ca6c..05f22ceb8fb 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache @@ -1,11 +1,10 @@ -{{>licenseInfo}} -{{#models}}{{#model}} +{{>licenseInfo}}{{#models}}{{#model}} #include "{{classname}}.h" -#include -#include -#include #include +#include +#include +#include #include "{{prefix}}Helpers.h" @@ -14,54 +13,53 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} {{classname}}::{{classname}}(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } {{classname}}::{{classname}}() { - this->init(); + this->initializeModel(); } -{{classname}}::~{{classname}}() { +{{classname}}::~{{classname}}() {} -} - -void -{{classname}}::init() { - {{^isEnum}}{{#vars}} +void {{classname}}::initializeModel() { +{{^isEnum}}{{#vars}} m_{{name}}_isSet = false; - m_{{name}}_isValid = false; - {{/vars}}{{/isEnum}}{{#isEnum}} + m_{{name}}_isValid = false;{{^-last}} +{{/-last}}{{/vars}}{{/isEnum}}{{#isEnum}} m_value_isSet = false; m_value_isValid = false; - m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED; - {{/isEnum}} + m_value = e{{classname}}::INVALID_VALUE_OPENAPI_GENERATED;{{/isEnum}} } -void -{{classname}}::fromJson(QString jsonString) { - {{^isEnum}}QByteArray array (jsonString.toStdString().c_str()); +void {{classname}}::fromJson(QString jsonString) { + {{^isEnum}}QByteArray array(jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject);{{/isEnum}}{{#isEnum}}{{#allowableValues}}{{#enumVars}} {{#-first}}if{{/-first}}{{^-first}}else if{{/-first}} ( jsonString.compare({{#isString}}"{{value}}"{{/isString}}{{^isString}}QString::number({{value}}){{/isString}}, Qt::CaseInsensitive) == 0) { m_value = e{{classname}}::{{name}}; - m_value_isValid = true; + m_value_isSet = m_value_isValid = true; }{{/enumVars}}{{/allowableValues}}{{/isEnum}} } -void -{{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) { - {{^isEnum}}{{#vars}} - {{^isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/isContainer}} - {{#isContainer}}{{^items.isContainer}}m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]);{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}} +void {{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) { +{{^isEnum}}{{#vars}}{{^isContainer}} + m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]); + m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/isContainer}}{{#isContainer}}{{^items.isContainer}} + m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]); + m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}} if(json["{{baseName}}"].isArray()){ auto arr = json["{{baseName}}"].toArray(); m_{{name}}_isValid = true; - for (const QJsonValue & jval : arr) { - {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap{{/items.isMapContainer}} item; - m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval) - {{name}}.push_back(item); + if(arr.count() > 0) { + for (const QJsonValue jval : arr) { + {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap{{/items.isMapContainer}} item; + m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); + m_{{name}}_isSet = !jval.isNull() && m_{{name}}_isValid; + {{name}}.push_back(item); + } } }{{/isListContainer}}{{#isMapContainer}} if(json["{{baseName}}"].isObject()){ @@ -72,16 +70,16 @@ void {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isListContainer}}QList<{{items.items.baseType}}>{{/items.isListContainer}}{{#items.isMapContainer}}QMap{{/items.isMapContainer}} item; auto jval = QJsonValue::fromVariant(varmap.value(val)); m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); + m_{{name}}_isSet &= !jval.isNull() && m_{{name}}_isValid; {{name}}.insert({{name}}.end(), val, item); } } - }{{/isMapContainer}}{{/items.isContainer}}{{/isContainer}} - {{/vars}}{{/isEnum}}{{#isEnum}} - {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}fromJson(json.toString());{{/isString}}{{^isString}}m_value = static_cast(json.toInt());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}} + }{{/isMapContainer}}{{/items.isContainer}}{{/isContainer}}{{^-last}} +{{/-last}} +{{/vars}}{{/isEnum}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}fromJson(json.toString());{{/isString}}{{^isString}}m_value = static_cast(json.toInt());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}} } -QString -{{classname}}::asJson () const { +QString {{classname}}::asJson() const { {{^isEnum}}QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); @@ -100,27 +98,24 @@ QString return val;{{/isEnum}} } -QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} -{{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const { - {{^isEnum}}QJsonObject obj;{{#vars}} - {{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{ +QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} {{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const { + {{^isEnum}}QJsonObject obj;{{#vars}}{{^isContainer}}{{#complexType}} + if ({{name}}.isSet()){{/complexType}}{{^complexType}} + if (m_{{name}}_isSet){{/complexType}} { obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}})); }{{/isContainer}}{{#isContainer}} - if({{name}}.size() > 0){ + if ({{name}}.size() > 0) { {{^items.isContainer}}obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}}));{{/items.isContainer}}{{#items.isContainer}} obj.insert(QString("{{baseName}}"), toJsonValue({{name}}));{{/items.isContainer}} - } {{/isContainer}}{{/vars}} + }{{/isContainer}}{{/vars}} return obj;{{/isEnum}}{{#isEnum}} {{#allowableValues}}{{#enumVars}}{{#-first}}{{^isString}}return QJsonValue(static_cast(m_value));{{/isString}}{{#isString}}return QJsonValue(asJson());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}} } -{{^isEnum}}{{#vars}} -{{{dataType}}} -{{classname}}::{{getter}}() const { +{{^isEnum}}{{#vars}}{{{dataType}}} {{classname}}::{{getter}}() const { return {{name}}; } -void -{{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) { +void {{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) { this->{{name}} = {{name}}; this->m_{{name}}_isSet = true; } @@ -135,25 +130,27 @@ void {{classname}}::setValue(const {{classname}}::e{{classname}}& value){ m_value_isSet = true; } {{/isEnum}} -bool -{{classname}}::isSet() const { +bool {{classname}}::isSet() const { {{^isEnum}}bool isObjectUpdated = false; - do{ {{#vars}} - {{#isContainer}}if({{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{{/isContainer}}{ isObjectUpdated = true; break;} - {{/vars}}}while(false); + do { +{{#vars}} {{#isContainer}}if ({{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if ({{name}}.isSet()){{/complexType}}{{^complexType}}if (m_{{name}}_isSet){{/complexType}}{{/isContainer}} { + isObjectUpdated = true; + break; + }{{^-last}} + +{{/-last}}{{/vars}} + } while (false); return isObjectUpdated;{{/isEnum}}{{#isEnum}} return m_value_isSet;{{/isEnum}} } -bool -{{classname}}::isValid() const { +bool {{classname}}::isValid() const { // only required properties are required for the object to be considered valid return {{^isEnum}}{{#vars}}{{#required}}m_{{name}}_isValid && {{/required}}{{/vars}}true{{/isEnum}}{{#isEnum}}m_value_isValid{{/isEnum}}; } {{#cppNamespaceDeclarations}} -} +} // namespace {{this}} {{/cppNamespaceDeclarations}} - {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache index 3c83c1f0d53..8f194ac12f9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache @@ -10,13 +10,11 @@ #include -{{/model}}{{/models}} -{{#imports}}{{{import}}} +{{/model}}{{/models}}{{#imports}}{{{import}}} {{/imports}} -#include "{{prefix}}Object.h" #include "{{prefix}}Enum.h" - +#include "{{prefix}}Object.h" {{#models}} {{#model}} @@ -24,22 +22,21 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} -class {{classname}}: public {{prefix}}{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Enum{{/isEnum}} { +class {{classname}} : public {{prefix}}{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Enum{{/isEnum}} { public: {{classname}}(); {{classname}}(QString json); ~{{classname}}() override; - QString asJson () const override; + QString asJson() const override; QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const override; void fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) override; void fromJson(QString jsonString) override; - - {{^isEnum}}{{#vars}} +{{^isEnum}}{{#vars}} {{{dataType}}} {{getter}}() const; void {{setter}}(const {{{dataType}}} &{{name}}); - - {{/vars}}{{/isEnum}}{{#isEnum}}{{#allowableValues}} +{{/vars}}{{/isEnum}}{{#isEnum}} +{{#allowableValues}} enum class e{{classname}} {{#enumVars}}{{#-first}}{{^isString}}: int {{/isString}}{{/-first}}{{/enumVars}}{ INVALID_VALUE_OPENAPI_GENERATED = 0, {{#enumVars}} @@ -51,28 +48,25 @@ public: {{{name}}}{{^-last}}, {{/-last}} {{/enumVars}} };{{/allowableValues}} - {{classname}}::e{{classname}} getValue() const; void setValue(const {{classname}}::e{{classname}}& value);{{/isEnum}} - virtual bool isSet() const override; virtual bool isValid() const override; private: - void init(); - {{^isEnum}}{{#vars}} + void initializeModel(); +{{^isEnum}}{{#vars}} {{{dataType}}} {{name}}; bool m_{{name}}_isSet; bool m_{{name}}_isValid; - {{/vars}}{{/isEnum}} - {{#isEnum}}e{{classname}} m_value; +{{/vars}}{{/isEnum}}{{#isEnum}} + e{{classname}} m_value; bool m_value_isSet; bool m_value_isValid; - {{/isEnum}} -}; +{{/isEnum}}}; {{#cppNamespaceDeclarations}} -} +} // namespace {{this}} {{/cppNamespaceDeclarations}} Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{classname}}) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache index e58b49adb92..7a68ecc6f74 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache @@ -2,8 +2,8 @@ #ifndef {{prefix}}_OBJECT_H #define {{prefix}}_OBJECT_H -#include #include +#include #include {{#cppNamespaceDeclarations}} @@ -11,18 +11,14 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} class {{prefix}}Object { - public: - {{prefix}}Object() { - - } +public: + {{prefix}}Object() {} {{prefix}}Object(QString jsonString) { fromJson(jsonString); } - virtual ~{{prefix}}Object(){ - - } + virtual ~{{prefix}}Object() {} virtual QJsonObject asJsonObject() const { return jObj; @@ -49,12 +45,13 @@ class {{prefix}}Object { virtual bool isValid() const { return true; } -private : + +private: QJsonObject jObj; }; {{#cppNamespaceDeclarations}} -} +} // namespace {{this}} {{/cppNamespaceDeclarations}} Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}Object) diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index 58592f031f6..bfbf77eb7fa 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5/client/CMakeLists.txt b/samples/client/petstore/cpp-qt5/client/CMakeLists.txt index c53100cca69..317566a3001 100644 --- a/samples/client/petstore/cpp-qt5/client/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt5/client/CMakeLists.txt @@ -5,7 +5,11 @@ set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") +else () + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") +endif () find_package(Qt5Core REQUIRED) find_package(Qt5Network REQUIRED) diff --git a/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp b/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp index 620a5aad65e..66ff2d4fd4e 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp @@ -9,8 +9,9 @@ * Do not edit the class manually. */ -#include "PFXHelpers.h" #include +#include +#include "PFXHelpers.h" namespace test_namespace { @@ -186,6 +187,17 @@ bool fromStringValue(const QString &inStr, double &value) { return ok; } +bool fromStringValue(const QString &inStr, PFXObject &value) +{ + QJsonParseError err; + QJsonDocument::fromJson(inStr.toUtf8(),&err); + if ( err.error == QJsonParseError::NoError ){ + value.fromJson(inStr); + return true; + } + return false; +} + bool fromStringValue(const QString &inStr, PFXEnum &value) { value.fromJson(inStr); return true; 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 0ea833a0ed4..80afab2f7cb 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 @@ -3,7 +3,6 @@ * 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 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 ee1893cd59a..395a863b9ff 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 @@ -3,7 +3,6 @@ * 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 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 b565ee9a74f..ff42a83e79b 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 @@ -3,7 +3,6 @@ * 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 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 cfa39da6d4b..4bc37141433 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 @@ -3,7 +3,6 @@ * 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 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 e439109af8d..05c12c4fdbc 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 @@ -3,7 +3,6 @@ * 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 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 9a549eb0013..d6ffe1da900 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 @@ -3,7 +3,6 @@ * 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 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 7480499945d..77594058ccd 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 @@ -3,7 +3,6 @@ * 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 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 48c217dc634..50423749ed5 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 @@ -3,7 +3,6 @@ * 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 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 d6b3af798d0..e2af8d6386f 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 @@ -3,7 +3,6 @@ * 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 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 233f607a9cf..1099e88df0e 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 @@ -3,147 +3,134 @@ * 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. */ - #include "OAIApiResponse.h" -#include -#include -#include #include +#include +#include +#include #include "OAIHelpers.h" namespace OpenAPI { OAIApiResponse::OAIApiResponse(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } OAIApiResponse::OAIApiResponse() { - this->init(); + this->initializeModel(); } -OAIApiResponse::~OAIApiResponse() { +OAIApiResponse::~OAIApiResponse() {} -} +void OAIApiResponse::initializeModel() { -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) { - QByteArray array (jsonString.toStdString().c_str()); +void OAIApiResponse::fromJson(QString jsonString) { + QByteArray array(jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject); } -void -OAIApiResponse::fromJsonObject(QJsonObject json) { - +void OAIApiResponse::fromJsonObject(QJsonObject json) { + m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]); - - + m_code_isSet = !json[QString("code")].isNull() && m_code_isValid; + m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]); - - + m_type_isSet = !json[QString("type")].isNull() && m_type_isValid; + m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]); - - + m_message_isSet = !json[QString("message")].isNull() && m_message_isValid; } -QString -OAIApiResponse::asJson () const { +QString OAIApiResponse::asJson() const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); return QString(bytes); } -QJsonObject -OAIApiResponse::asJsonObject() const { +QJsonObject OAIApiResponse::asJsonObject() const { QJsonObject obj; - if(m_code_isSet){ + if (m_code_isSet) { obj.insert(QString("code"), ::OpenAPI::toJsonValue(code)); } - if(m_type_isSet){ + if (m_type_isSet) { obj.insert(QString("type"), ::OpenAPI::toJsonValue(type)); } - if(m_message_isSet){ + if (m_message_isSet) { obj.insert(QString("message"), ::OpenAPI::toJsonValue(message)); } return obj; } - -qint32 -OAIApiResponse::getCode() const { +qint32 OAIApiResponse::getCode() const { return code; } -void -OAIApiResponse::setCode(const qint32 &code) { +void OAIApiResponse::setCode(const qint32 &code) { this->code = code; this->m_code_isSet = true; } - -QString -OAIApiResponse::getType() const { +QString OAIApiResponse::getType() const { return type; } -void -OAIApiResponse::setType(const QString &type) { +void OAIApiResponse::setType(const QString &type) { this->type = type; this->m_type_isSet = true; } - -QString -OAIApiResponse::getMessage() const { +QString OAIApiResponse::getMessage() const { return message; } -void -OAIApiResponse::setMessage(const QString &message) { +void OAIApiResponse::setMessage(const QString &message) { this->message = message; this->m_message_isSet = true; } -bool -OAIApiResponse::isSet() const { +bool OAIApiResponse::isSet() const { bool isObjectUpdated = false; - do{ - if(m_code_isSet){ isObjectUpdated = true; break;} - - if(m_type_isSet){ isObjectUpdated = true; break;} - - if(m_message_isSet){ isObjectUpdated = true; break;} - }while(false); + do { + if (m_code_isSet) { + isObjectUpdated = true; + break; + } + + if (m_type_isSet) { + isObjectUpdated = true; + break; + } + + if (m_message_isSet) { + isObjectUpdated = true; + break; + } + } while (false); return isObjectUpdated; } -bool -OAIApiResponse::isValid() const { +bool OAIApiResponse::isValid() const { // only required properties are required for the object to be considered valid return true; } -} - +} // namespace OpenAPI 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 7e4d7460383..1dc044d47d6 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 @@ -3,7 +3,6 @@ * 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 @@ -21,61 +20,53 @@ #include - #include -#include "OAIObject.h" #include "OAIEnum.h" - +#include "OAIObject.h" namespace OpenAPI { -class OAIApiResponse: public OAIObject { +class OAIApiResponse : public OAIObject { public: OAIApiResponse(); OAIApiResponse(QString json); ~OAIApiResponse() override; - QString asJson () const override; + QString asJson() const override; QJsonObject asJsonObject() const override; 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(); - + void initializeModel(); + 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; - - }; +}; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse) 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 571dc37b6fa..1945693f153 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 @@ -3,125 +3,112 @@ * 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. */ - #include "OAICategory.h" -#include -#include -#include #include +#include +#include +#include #include "OAIHelpers.h" namespace OpenAPI { OAICategory::OAICategory(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } OAICategory::OAICategory() { - this->init(); + this->initializeModel(); } -OAICategory::~OAICategory() { +OAICategory::~OAICategory() {} -} +void OAICategory::initializeModel() { -void -OAICategory::init() { - m_id_isSet = false; m_id_isValid = false; - + m_name_isSet = false; m_name_isValid = false; - } +} -void -OAICategory::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); +void OAICategory::fromJson(QString jsonString) { + QByteArray array(jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject); } -void -OAICategory::fromJsonObject(QJsonObject json) { - +void OAICategory::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); - - + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); - - + m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; } -QString -OAICategory::asJson () const { +QString OAICategory::asJson() const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); return QString(bytes); } -QJsonObject -OAICategory::asJsonObject() const { +QJsonObject OAICategory::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if (m_id_isSet) { obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_name_isSet){ + if (m_name_isSet) { obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); } return obj; } - -qint64 -OAICategory::getId() const { +qint64 OAICategory::getId() const { return id; } -void -OAICategory::setId(const qint64 &id) { +void OAICategory::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } - -QString -OAICategory::getName() const { +QString OAICategory::getName() const { return name; } -void -OAICategory::setName(const QString &name) { +void OAICategory::setName(const QString &name) { this->name = name; this->m_name_isSet = true; } -bool -OAICategory::isSet() const { +bool OAICategory::isSet() const { bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_name_isSet){ isObjectUpdated = true; break;} - }while(false); + do { + if (m_id_isSet) { + isObjectUpdated = true; + break; + } + + if (m_name_isSet) { + isObjectUpdated = true; + break; + } + } while (false); return isObjectUpdated; } -bool -OAICategory::isValid() const { +bool OAICategory::isValid() const { // only required properties are required for the object to be considered valid return true; } -} - +} // namespace OpenAPI 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 8cfc76f4305..e091b32946d 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 @@ -3,7 +3,6 @@ * 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 @@ -21,53 +20,46 @@ #include - #include -#include "OAIObject.h" #include "OAIEnum.h" - +#include "OAIObject.h" namespace OpenAPI { -class OAICategory: public OAIObject { +class OAICategory : public OAIObject { public: OAICategory(); OAICategory(QString json); ~OAICategory() override; - QString asJson () const override; + QString asJson() const override; QJsonObject asJsonObject() const override; 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(); - + void initializeModel(); + qint64 id; bool m_id_isSet; bool m_id_isValid; - + QString name; bool m_name_isSet; bool m_name_isValid; - - }; +}; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAICategory) 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 index 66625c43b63..85785fb879f 100644 --- 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 @@ -3,7 +3,6 @@ * 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 @@ -13,25 +12,21 @@ #ifndef OAI_ENUM_H #define OAI_ENUM_H -#include #include #include +#include namespace OpenAPI { class OAIEnum { - public: - OAIEnum() { - - } +public: + OAIEnum() {} OAIEnum(QString jsonString) { fromJson(jsonString); } - virtual ~OAIEnum(){ - - } + virtual ~OAIEnum() {} virtual QJsonValue asJsonValue() const { return QJsonValue(jstr); @@ -56,11 +51,12 @@ class OAIEnum { virtual bool isValid() const { return true; } -private : + +private: QString jstr; }; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAIEnum) 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 f925722d154..6f24349c29f 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 @@ -3,7 +3,6 @@ * 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 @@ -14,225 +13,181 @@ #include #include "OAIHelpers.h" - namespace OpenAPI { - -QString -toStringValue(const QString &value) { +QString toStringValue(const QString &value) { return value; } -QString -toStringValue(const QDateTime &value){ +QString toStringValue(const QDateTime &value) { // ISO 8601 return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); } -QString -toStringValue(const QByteArray &value){ +QString toStringValue(const QByteArray &value) { return QString(value); } -QString -toStringValue(const QDate &value){ +QString toStringValue(const QDate &value) { // ISO 8601 return value.toString(Qt::DateFormat::ISODate); } -QString -toStringValue(const qint32 &value) { +QString toStringValue(const qint32 &value) { return QString::number(value); } -QString -toStringValue(const qint64 &value) { +QString toStringValue(const qint64 &value) { return QString::number(value); } -QString -toStringValue(const bool &value) { +QString toStringValue(const bool &value) { return QString(value ? "true" : "false"); } -QString -toStringValue(const float &value){ +QString toStringValue(const float &value) { return QString::number(static_cast(value)); } -QString -toStringValue(const double &value){ +QString toStringValue(const double &value) { return QString::number(value); } -QString -toStringValue(const OAIObject &value){ +QString toStringValue(const OAIObject &value) { return value.asJson(); } - -QString -toStringValue(const OAIEnum &value){ +QString toStringValue(const OAIEnum &value) { return value.asJson(); } -QString -toStringValue(const OAIHttpFileElement &value){ +QString toStringValue(const OAIHttpFileElement &value) { return value.asJson(); } - -QJsonValue -toJsonValue(const QString &value){ - return QJsonValue(value); +QJsonValue toJsonValue(const QString &value) { + return QJsonValue(value); } -QJsonValue -toJsonValue(const QDateTime &value){ +QJsonValue toJsonValue(const QDateTime &value) { return QJsonValue(value.toString(Qt::ISODate)); } -QJsonValue -toJsonValue(const QByteArray &value){ +QJsonValue toJsonValue(const QByteArray &value) { return QJsonValue(QString(value.toBase64())); } -QJsonValue -toJsonValue(const QDate &value){ +QJsonValue toJsonValue(const QDate &value) { return QJsonValue(value.toString(Qt::ISODate)); } -QJsonValue -toJsonValue(const qint32 &value){ +QJsonValue toJsonValue(const qint32 &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const qint64 &value){ +QJsonValue toJsonValue(const qint64 &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const bool &value){ +QJsonValue toJsonValue(const bool &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const float &value){ +QJsonValue toJsonValue(const float &value) { return QJsonValue(static_cast(value)); } -QJsonValue -toJsonValue(const double &value){ +QJsonValue toJsonValue(const double &value) { return QJsonValue(value); } -QJsonValue -toJsonValue(const OAIObject &value){ +QJsonValue toJsonValue(const OAIObject &value) { return value.asJsonObject(); } -QJsonValue -toJsonValue(const OAIEnum &value){ +QJsonValue toJsonValue(const OAIEnum &value) { return value.asJsonValue(); } -QJsonValue -toJsonValue(const OAIHttpFileElement &value){ +QJsonValue toJsonValue(const OAIHttpFileElement &value) { return value.asJsonValue(); } - -bool -fromStringValue(const QString &inStr, QString &value){ +bool fromStringValue(const QString &inStr, QString &value) { value.clear(); value.append(inStr); return !inStr.isEmpty(); } -bool -fromStringValue(const QString &inStr, QDateTime &value){ - if(inStr.isEmpty()){ +bool fromStringValue(const QString &inStr, QDateTime &value) { + if (inStr.isEmpty()) { return false; - } - else{ + } else { auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); - if(dateTime.isValid()){ + if (dateTime.isValid()) { value.setDate(dateTime.date()); value.setTime(dateTime.time()); - } - else{ + } else { qDebug() << "DateTime is invalid"; } return dateTime.isValid(); } } -bool -fromStringValue(const QString &inStr, QByteArray &value){ - if(inStr.isEmpty()){ +bool fromStringValue(const QString &inStr, QByteArray &value) { + if (inStr.isEmpty()) { return false; - } - else{ + } else { value.clear(); value.append(inStr.toUtf8()); return value.count() > 0; } } -bool -fromStringValue(const QString &inStr, QDate &value){ - if(inStr.isEmpty()){ +bool fromStringValue(const QString &inStr, QDate &value) { + if (inStr.isEmpty()) { return false; - } - else{ + } else { auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate); - if(date.isValid()){ + if (date.isValid()) { value.setDate(date.year(), date.month(), date.day()); - } - else{ + } else { qDebug() << "Date is invalid"; } return date.isValid(); } } -bool -fromStringValue(const QString &inStr, qint32 &value){ +bool fromStringValue(const QString &inStr, qint32 &value) { bool ok = false; value = QVariant(inStr).toInt(&ok); return ok; } -bool -fromStringValue(const QString &inStr, qint64 &value){ +bool fromStringValue(const QString &inStr, qint64 &value) { bool ok = false; value = QVariant(inStr).toLongLong(&ok); return ok; } -bool -fromStringValue(const QString &inStr, bool &value){ +bool fromStringValue(const QString &inStr, bool &value) { value = QVariant(inStr).toBool(); return ((inStr == "true") || (inStr == "false")); } -bool -fromStringValue(const QString &inStr, float &value){ +bool fromStringValue(const QString &inStr, float &value) { bool ok = false; value = QVariant(inStr).toFloat(&ok); return ok; } -bool -fromStringValue(const QString &inStr, double &value){ +bool fromStringValue(const QString &inStr, double &value) { bool ok = false; value = QVariant(inStr).toDouble(&ok); return ok; } -bool -fromStringValue(const QString &inStr, OAIObject &value) +bool fromStringValue(const QString &inStr, OAIObject &value) { QJsonParseError err; QJsonDocument::fromJson(inStr.toUtf8(),&err); @@ -243,26 +198,23 @@ fromStringValue(const QString &inStr, OAIObject &value) return false; } -bool -fromStringValue(const QString &inStr, OAIEnum &value){ +bool fromStringValue(const QString &inStr, OAIEnum &value) { value.fromJson(inStr); return true; } -bool -fromStringValue(const QString &inStr, OAIHttpFileElement &value){ +bool fromStringValue(const QString &inStr, OAIHttpFileElement &value) { return value.fromStringValue(inStr); } -bool -fromJsonValue(QString &value, const QJsonValue &jval){ +bool fromJsonValue(QString &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull()){ - if(jval.isString()){ + if (!jval.isUndefined() && !jval.isNull()) { + if (jval.isString()) { value = jval.toString(); - } else if(jval.isBool()) { - value = jval.toBool() ? "true" : "false"; - } else if(jval.isDouble()){ + } else if (jval.isBool()) { + value = jval.toBool() ? "true" : "false"; + } else if (jval.isDouble()) { value = QString::number(jval.toDouble()); } else { ok = false; @@ -273,10 +225,9 @@ fromJsonValue(QString &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(QDateTime &value, const QJsonValue &jval){ +bool fromJsonValue(QDateTime &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ + if (!jval.isUndefined() && !jval.isNull() && jval.isString()) { value = QDateTime::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); } else { @@ -285,22 +236,20 @@ fromJsonValue(QDateTime &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(QByteArray &value, const QJsonValue &jval){ +bool fromJsonValue(QByteArray &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()) { + if (!jval.isUndefined() && !jval.isNull() && jval.isString()) { value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString())); - ok = value.size() > 0 ; + ok = value.size() > 0; } else { ok = false; } return ok; } -bool -fromJsonValue(QDate &value, const QJsonValue &jval){ +bool fromJsonValue(QDate &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ + if (!jval.isUndefined() && !jval.isNull() && jval.isString()) { value = QDate::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); } else { @@ -309,10 +258,9 @@ fromJsonValue(QDate &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(qint32 &value, const QJsonValue &jval){ +bool fromJsonValue(qint32 &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ + if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) { value = jval.toInt(); } else { ok = false; @@ -320,10 +268,9 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(qint64 &value, const QJsonValue &jval){ +bool fromJsonValue(qint64 &value, const QJsonValue &jval) { bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ + if (!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()) { value = jval.toVariant().toLongLong(); } else { ok = false; @@ -331,10 +278,9 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(bool &value, const QJsonValue &jval){ +bool fromJsonValue(bool &value, const QJsonValue &jval) { bool ok = true; - if(jval.isBool()){ + if (jval.isBool()) { value = jval.toBool(); } else { ok = false; @@ -342,10 +288,9 @@ fromJsonValue(bool &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(float &value, const QJsonValue &jval){ +bool fromJsonValue(float &value, const QJsonValue &jval) { bool ok = true; - if(jval.isDouble()){ + if (jval.isDouble()) { value = static_cast(jval.toDouble()); } else { ok = false; @@ -353,10 +298,9 @@ fromJsonValue(float &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(double &value, const QJsonValue &jval){ +bool fromJsonValue(double &value, const QJsonValue &jval) { bool ok = true; - if(jval.isDouble()){ + if (jval.isDouble()) { value = jval.toDouble(); } else { ok = false; @@ -364,10 +308,9 @@ fromJsonValue(double &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(OAIObject &value, const QJsonValue &jval){ +bool fromJsonValue(OAIObject &value, const QJsonValue &jval) { bool ok = true; - if(jval.isObject()){ + if (jval.isObject()) { value.fromJsonObject(jval.toObject()); ok = value.isValid(); } else { @@ -376,15 +319,13 @@ fromJsonValue(OAIObject &value, const QJsonValue &jval){ return ok; } -bool -fromJsonValue(OAIEnum &value, const QJsonValue &jval){ +bool fromJsonValue(OAIEnum &value, const QJsonValue &jval) { value.fromJsonValue(jval); return true; } -bool -fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval){ +bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval) { return value.fromJsonValue(jval); } -} +} // namespace OpenAPI 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 a2992183298..221119f2131 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 @@ -3,7 +3,6 @@ * 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 @@ -13,159 +12,180 @@ #ifndef OAI_HELPERS_H #define OAI_HELPERS_H -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include #include -#include "OAIObject.h" #include "OAIEnum.h" #include "OAIHttpFileElement.h" +#include "OAIObject.h" namespace OpenAPI { - QString toStringValue(const QString &value); - QString toStringValue(const QDateTime &value); - QString toStringValue(const QByteArray &value); - QString toStringValue(const QDate &value); - QString toStringValue(const qint32 &value); - QString toStringValue(const qint64 &value); - QString toStringValue(const bool &value); - QString toStringValue(const float &value); - QString toStringValue(const double &value); - QString toStringValue(const OAIObject &value); - QString toStringValue(const OAIEnum &value); - QString toStringValue(const OAIHttpFileElement &value); +template +QString toStringValue(const QList &val); - template - QString toStringValue(const QList &val) { - QString strArray; - for(const auto& item : val) { - strArray.append(toStringValue(item) + ","); - } - if(val.count() > 0) { - strArray.chop(1); - } - return strArray; +template +bool fromStringValue(const QList &inStr, QList &val); + +template +bool fromStringValue(const QMap &inStr, QMap &val); + +template +QJsonValue toJsonValue(const QList &val); + +template +QJsonValue toJsonValue(const QMap &val); + +template +bool fromJsonValue(QList &val, const QJsonValue &jval); + +template +bool fromJsonValue(QMap &val, const QJsonValue &jval); + +QString toStringValue(const QString &value); +QString toStringValue(const QDateTime &value); +QString toStringValue(const QByteArray &value); +QString toStringValue(const QDate &value); +QString toStringValue(const qint32 &value); +QString toStringValue(const qint64 &value); +QString toStringValue(const bool &value); +QString toStringValue(const float &value); +QString toStringValue(const double &value); +QString toStringValue(const OAIObject &value); +QString toStringValue(const OAIEnum &value); +QString toStringValue(const OAIHttpFileElement &value); + +template +QString toStringValue(const QList &val) { + QString strArray; + for (const auto &item : val) { + strArray.append(toStringValue(item) + ","); } - - QJsonValue toJsonValue(const QString &value); - QJsonValue toJsonValue(const QDateTime &value); - QJsonValue toJsonValue(const QByteArray &value); - QJsonValue toJsonValue(const QDate &value); - QJsonValue toJsonValue(const qint32 &value); - QJsonValue toJsonValue(const qint64 &value); - QJsonValue toJsonValue(const bool &value); - QJsonValue toJsonValue(const float &value); - QJsonValue toJsonValue(const double &value); - QJsonValue toJsonValue(const OAIObject &value); - QJsonValue toJsonValue(const OAIEnum &value); - QJsonValue toJsonValue(const OAIHttpFileElement &value); - - template - QJsonValue toJsonValue(const QList &val) { - QJsonArray jArray; - for(const auto& item : val) { - jArray.append(toJsonValue(item)); - } - return jArray; + if (val.count() > 0) { + strArray.chop(1); } - - template - QJsonValue toJsonValue(const QMap &val) { - QJsonObject jObject; - for(const auto& itemkey : val.keys()) { - jObject.insert(itemkey, toJsonValue(val.value(itemkey))); - } - return jObject; - } - - bool fromStringValue(const QString &inStr, QString &value); - bool fromStringValue(const QString &inStr, QDateTime &value); - bool fromStringValue(const QString &inStr, QByteArray &value); - bool fromStringValue(const QString &inStr, QDate &value); - bool fromStringValue(const QString &inStr, qint32 &value); - bool fromStringValue(const QString &inStr, qint64 &value); - 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, OAIObject &value); - bool fromStringValue(const QString &inStr, OAIEnum &value); - bool fromStringValue(const QString &inStr, OAIHttpFileElement &value); - - template - bool fromStringValue(const QList &inStr, QList &val) { - bool ok = (inStr.count() > 0); - for(const auto& item: inStr){ - T itemVal; - ok &= fromStringValue(item, itemVal); - val.push_back(itemVal); - } - return ok; - } - - template - bool fromStringValue(const QMap &inStr, QMap &val) { - bool ok = (inStr.count() > 0); - for(const auto& itemkey : inStr.keys()){ - T itemVal; - ok &= fromStringValue(inStr.value(itemkey), itemVal); - val.insert(itemkey, itemVal); - } - return ok; - } - - bool fromJsonValue(QString &value, const QJsonValue &jval); - bool fromJsonValue(QDateTime &value, const QJsonValue &jval); - bool fromJsonValue(QByteArray &value, const QJsonValue &jval); - bool fromJsonValue(QDate &value, const QJsonValue &jval); - bool fromJsonValue(qint32 &value, const QJsonValue &jval); - bool fromJsonValue(qint64 &value, const QJsonValue &jval); - bool fromJsonValue(bool &value, const QJsonValue &jval); - 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); - bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval); - - template - bool fromJsonValue(QList &val, const QJsonValue &jval) { - bool ok = true; - if(jval.isArray()){ - for(const auto& jitem : jval.toArray()){ - T item; - ok &= fromJsonValue(item, jitem); - val.push_back(item); - } - } else { - ok = false; - } - return ok; - } - - template - bool fromJsonValue(QMap &val, const QJsonValue &jval) { - bool ok = true; - if(jval.isObject()){ - auto varmap = jval.toObject().toVariantMap(); - if(varmap.count() > 0){ - for(const auto& itemkey : varmap.keys() ){ - T itemVal; - ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey))); - val.insert(itemkey, itemVal); - } - } - } else { - ok = false; - } - return ok; - } - + return strArray; } +QJsonValue toJsonValue(const QString &value); +QJsonValue toJsonValue(const QDateTime &value); +QJsonValue toJsonValue(const QByteArray &value); +QJsonValue toJsonValue(const QDate &value); +QJsonValue toJsonValue(const qint32 &value); +QJsonValue toJsonValue(const qint64 &value); +QJsonValue toJsonValue(const bool &value); +QJsonValue toJsonValue(const float &value); +QJsonValue toJsonValue(const double &value); +QJsonValue toJsonValue(const OAIObject &value); +QJsonValue toJsonValue(const OAIEnum &value); +QJsonValue toJsonValue(const OAIHttpFileElement &value); + +template +QJsonValue toJsonValue(const QList &val) { + QJsonArray jArray; + for (const auto &item : val) { + jArray.append(toJsonValue(item)); + } + return jArray; +} + +template +QJsonValue toJsonValue(const QMap &val) { + QJsonObject jObject; + for (const auto &itemkey : val.keys()) { + jObject.insert(itemkey, toJsonValue(val.value(itemkey))); + } + return jObject; +} + +bool fromStringValue(const QString &inStr, QString &value); +bool fromStringValue(const QString &inStr, QDateTime &value); +bool fromStringValue(const QString &inStr, QByteArray &value); +bool fromStringValue(const QString &inStr, QDate &value); +bool fromStringValue(const QString &inStr, qint32 &value); +bool fromStringValue(const QString &inStr, qint64 &value); +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, OAIObject &value); +bool fromStringValue(const QString &inStr, OAIEnum &value); +bool fromStringValue(const QString &inStr, OAIHttpFileElement &value); + +template +bool fromStringValue(const QList &inStr, QList &val) { + bool ok = (inStr.count() > 0); + for (const auto &item : inStr) { + T itemVal; + ok &= fromStringValue(item, itemVal); + val.push_back(itemVal); + } + return ok; +} + +template +bool fromStringValue(const QMap &inStr, QMap &val) { + bool ok = (inStr.count() > 0); + for (const auto &itemkey : inStr.keys()) { + T itemVal; + ok &= fromStringValue(inStr.value(itemkey), itemVal); + val.insert(itemkey, itemVal); + } + return ok; +} + +bool fromJsonValue(QString &value, const QJsonValue &jval); +bool fromJsonValue(QDateTime &value, const QJsonValue &jval); +bool fromJsonValue(QByteArray &value, const QJsonValue &jval); +bool fromJsonValue(QDate &value, const QJsonValue &jval); +bool fromJsonValue(qint32 &value, const QJsonValue &jval); +bool fromJsonValue(qint64 &value, const QJsonValue &jval); +bool fromJsonValue(bool &value, const QJsonValue &jval); +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); +bool fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval); + +template +bool fromJsonValue(QList &val, const QJsonValue &jval) { + bool ok = true; + if (jval.isArray()) { + for (const auto jitem : jval.toArray()) { + T item; + ok &= fromJsonValue(item, jitem); + val.push_back(item); + } + } else { + ok = false; + } + return ok; +} + +template +bool fromJsonValue(QMap &val, const QJsonValue &jval) { + bool ok = true; + if (jval.isObject()) { + auto varmap = jval.toObject().toVariantMap(); + if (varmap.count() > 0) { + for (const auto &itemkey : varmap.keys()) { + T itemVal; + ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey))); + val.insert(itemkey, itemVal); + } + } + } else { + ok = false; + } + return ok; +} + +} // namespace OpenAPI + #endif // OAI_HELPERS_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.cpp index ef627144b1e..f407abf0971 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.cpp @@ -3,14 +3,12 @@ * 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. */ - #include #include #include @@ -20,129 +18,117 @@ namespace OpenAPI { -void -OAIHttpFileElement::setMimeType(const QString &mime){ +void OAIHttpFileElement::setMimeType(const QString &mime) { mime_type = mime; } -void -OAIHttpFileElement::setFileName(const QString &name){ +void OAIHttpFileElement::setFileName(const QString &name) { local_filename = name; } -void -OAIHttpFileElement::setVariableName(const QString &name){ +void OAIHttpFileElement::setVariableName(const QString &name) { variable_name = name; } -void -OAIHttpFileElement::setRequestFileName(const QString &name){ +void OAIHttpFileElement::setRequestFileName(const QString &name) { request_filename = name; } -bool -OAIHttpFileElement::isSet() const { +bool OAIHttpFileElement::isSet() const { return !local_filename.isEmpty() || !request_filename.isEmpty(); } -QString -OAIHttpFileElement::asJson() const{ +QString OAIHttpFileElement::asJson() const { QFile file(local_filename); QByteArray bArray; bool result = false; - if(file.exists()) { + if (file.exists()) { result = file.open(QIODevice::ReadOnly); bArray = file.readAll(); file.close(); } - if(!result) { + if (!result) { qDebug() << "Error opening file " << local_filename; } return QString(bArray); } -QJsonValue -OAIHttpFileElement::asJsonValue() const{ +QJsonValue OAIHttpFileElement::asJsonValue() const { QFile file(local_filename); QByteArray bArray; - bool result = false; - if(file.exists()) { + bool result = false; + if (file.exists()) { result = file.open(QIODevice::ReadOnly); bArray = file.readAll(); file.close(); } - if(!result) { + if (!result) { qDebug() << "Error opening file " << local_filename; } return QJsonDocument::fromBinaryData(bArray.data()).object(); } -bool -OAIHttpFileElement::fromStringValue(const QString &instr){ +bool OAIHttpFileElement::fromStringValue(const QString &instr) { QFile file(local_filename); bool result = false; - if(file.exists()) { + if (file.exists()) { file.remove(); } result = file.open(QIODevice::WriteOnly); file.write(instr.toUtf8()); file.close(); - if(!result) { + if (!result) { qDebug() << "Error creating file " << local_filename; } return result; } -bool -OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) { +bool OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) { QFile file(local_filename); bool result = false; - if(file.exists()) { + if (file.exists()) { file.remove(); } result = file.open(QIODevice::WriteOnly); file.write(QJsonDocument(jval.toObject()).toBinaryData()); file.close(); - if(!result) { + if (!result) { qDebug() << "Error creating file " << local_filename; } return result; } -QByteArray -OAIHttpFileElement::asByteArray() const { +QByteArray OAIHttpFileElement::asByteArray() const { QFile file(local_filename); QByteArray bArray; bool result = false; - if(file.exists()) { + if (file.exists()) { result = file.open(QIODevice::ReadOnly); bArray = file.readAll(); file.close(); } - if(!result) { + if (!result) { qDebug() << "Error opening file " << local_filename; - } + } return bArray; } -bool -OAIHttpFileElement::fromByteArray(const QByteArray& bytes){ +bool OAIHttpFileElement::fromByteArray(const QByteArray &bytes) { QFile file(local_filename); bool result = false; - if(file.exists()){ + if (file.exists()) { file.remove(); } result = file.open(QIODevice::WriteOnly); file.write(bytes); file.close(); - if(!result) { + if (!result) { qDebug() << "Error creating file " << local_filename; } return result; } -bool -OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ +bool OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray &bytes) { setMimeType(mime); setFileName(localFName); setVariableName(varName); @@ -150,8 +136,7 @@ OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName return fromByteArray(bytes); } -QByteArray -OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ +QByteArray OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime) { setMimeType(mime); setFileName(localFName); setVariableName(varName); @@ -159,4 +144,4 @@ OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFNa return asByteArray(); } -} +} // namespace OpenAPI diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.h index b5d189b3440..30fa47c81a4 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.h @@ -3,7 +3,6 @@ * 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 @@ -17,7 +16,6 @@ #include #include - namespace OpenAPI { class OAIHttpFileElement { @@ -34,15 +32,15 @@ public: bool isSet() const; bool fromStringValue(const QString &instr); bool fromJsonValue(const QJsonValue &jval); - bool fromByteArray(const QByteArray& bytes); - bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); + bool fromByteArray(const QByteArray &bytes); + bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray &bytes); QString asJson() const; QJsonValue asJsonValue() const; QByteArray asByteArray() const; QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime); }; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAIHttpFileElement) 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 83757b56717..1c598ed4c96 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 @@ -3,7 +3,6 @@ * 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 @@ -13,25 +12,21 @@ #ifndef OAI_OBJECT_H #define OAI_OBJECT_H -#include #include +#include #include namespace OpenAPI { class OAIObject { - public: - OAIObject() { - - } +public: + OAIObject() {} OAIObject(QString jsonString) { fromJson(jsonString); } - virtual ~OAIObject(){ - - } + virtual ~OAIObject() {} virtual QJsonObject asJsonObject() const { return jObj; @@ -58,11 +53,12 @@ class OAIObject { virtual bool isValid() const { return true; } -private : + +private: QJsonObject jObj; }; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAIObject) 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 a6f0fb92d97..296e9589d05 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 @@ -3,213 +3,200 @@ * 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. */ - #include "OAIOrder.h" -#include -#include -#include #include +#include +#include +#include #include "OAIHelpers.h" namespace OpenAPI { OAIOrder::OAIOrder(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } OAIOrder::OAIOrder() { - this->init(); + this->initializeModel(); } -OAIOrder::~OAIOrder() { +OAIOrder::~OAIOrder() {} -} +void OAIOrder::initializeModel() { -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) { - QByteArray array (jsonString.toStdString().c_str()); +void OAIOrder::fromJson(QString jsonString) { + QByteArray array(jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject); } -void -OAIOrder::fromJsonObject(QJsonObject json) { - +void OAIOrder::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); - - + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]); - - + m_pet_id_isSet = !json[QString("petId")].isNull() && m_pet_id_isValid; + m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]); - - + m_quantity_isSet = !json[QString("quantity")].isNull() && m_quantity_isValid; + m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]); - - + m_ship_date_isSet = !json[QString("shipDate")].isNull() && m_ship_date_isValid; + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); - - + m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; + m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]); - - + m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid; } -QString -OAIOrder::asJson () const { +QString OAIOrder::asJson() const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); return QString(bytes); } -QJsonObject -OAIOrder::asJsonObject() const { +QJsonObject OAIOrder::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if (m_id_isSet) { obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_pet_id_isSet){ + if (m_pet_id_isSet) { obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id)); } - if(m_quantity_isSet){ + if (m_quantity_isSet) { obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity)); } - if(m_ship_date_isSet){ + if (m_ship_date_isSet) { obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date)); } - if(m_status_isSet){ + if (m_status_isSet) { obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); } - if(m_complete_isSet){ + if (m_complete_isSet) { obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete)); } return obj; } - -qint64 -OAIOrder::getId() const { +qint64 OAIOrder::getId() const { return id; } -void -OAIOrder::setId(const qint64 &id) { +void OAIOrder::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } - -qint64 -OAIOrder::getPetId() const { +qint64 OAIOrder::getPetId() const { return pet_id; } -void -OAIOrder::setPetId(const qint64 &pet_id) { +void OAIOrder::setPetId(const qint64 &pet_id) { this->pet_id = pet_id; this->m_pet_id_isSet = true; } - -qint32 -OAIOrder::getQuantity() const { +qint32 OAIOrder::getQuantity() const { return quantity; } -void -OAIOrder::setQuantity(const qint32 &quantity) { +void OAIOrder::setQuantity(const qint32 &quantity) { this->quantity = quantity; this->m_quantity_isSet = true; } - -QDateTime -OAIOrder::getShipDate() const { +QDateTime OAIOrder::getShipDate() const { return ship_date; } -void -OAIOrder::setShipDate(const QDateTime &ship_date) { +void OAIOrder::setShipDate(const QDateTime &ship_date) { this->ship_date = ship_date; this->m_ship_date_isSet = true; } - -QString -OAIOrder::getStatus() const { +QString OAIOrder::getStatus() const { return status; } -void -OAIOrder::setStatus(const QString &status) { +void OAIOrder::setStatus(const QString &status) { this->status = status; this->m_status_isSet = true; } - -bool -OAIOrder::isComplete() const { +bool OAIOrder::isComplete() const { return complete; } -void -OAIOrder::setComplete(const bool &complete) { +void OAIOrder::setComplete(const bool &complete) { this->complete = complete; this->m_complete_isSet = true; } -bool -OAIOrder::isSet() const { +bool OAIOrder::isSet() const { bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_pet_id_isSet){ isObjectUpdated = true; break;} - - if(m_quantity_isSet){ isObjectUpdated = true; break;} - - if(m_ship_date_isSet){ isObjectUpdated = true; break;} - - if(m_status_isSet){ isObjectUpdated = true; break;} - - if(m_complete_isSet){ isObjectUpdated = true; break;} - }while(false); + do { + if (m_id_isSet) { + isObjectUpdated = true; + break; + } + + if (m_pet_id_isSet) { + isObjectUpdated = true; + break; + } + + if (m_quantity_isSet) { + isObjectUpdated = true; + break; + } + + if (m_ship_date_isSet) { + isObjectUpdated = true; + break; + } + + if (m_status_isSet) { + isObjectUpdated = true; + break; + } + + if (m_complete_isSet) { + isObjectUpdated = true; + break; + } + } while (false); return isObjectUpdated; } -bool -OAIOrder::isValid() const { +bool OAIOrder::isValid() const { // only required properties are required for the object to be considered valid return true; } -} - +} // namespace OpenAPI 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 7acf2ab0a32..983c947855c 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 @@ -3,7 +3,6 @@ * 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 @@ -21,86 +20,75 @@ #include - #include #include -#include "OAIObject.h" #include "OAIEnum.h" - +#include "OAIObject.h" namespace OpenAPI { -class OAIOrder: public OAIObject { +class OAIOrder : public OAIObject { public: OAIOrder(); OAIOrder(QString json); ~OAIOrder() override; - QString asJson () const override; + QString asJson() const override; QJsonObject asJsonObject() const override; 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(); - + void initializeModel(); + 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; - - }; +}; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAIOrder) 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 8a6cfec0319..9c3fca7c83b 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 @@ -3,215 +3,200 @@ * 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. */ - #include "OAIPet.h" -#include -#include -#include #include +#include +#include +#include #include "OAIHelpers.h" namespace OpenAPI { OAIPet::OAIPet(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } OAIPet::OAIPet() { - this->init(); + this->initializeModel(); } -OAIPet::~OAIPet() { +OAIPet::~OAIPet() {} -} +void OAIPet::initializeModel() { -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) { - QByteArray array (jsonString.toStdString().c_str()); +void OAIPet::fromJson(QString jsonString) { + QByteArray array(jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject); } -void -OAIPet::fromJsonObject(QJsonObject json) { - +void OAIPet::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); - - + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]); - - + m_category_isSet = !json[QString("category")].isNull() && m_category_isValid; + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); - - - + m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; + m_photo_urls_isValid = ::OpenAPI::fromJsonValue(photo_urls, json[QString("photoUrls")]); - - + m_photo_urls_isSet = !json[QString("photoUrls")].isNull() && m_photo_urls_isValid; + m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]); - + m_tags_isSet = !json[QString("tags")].isNull() && m_tags_isValid; + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); - - + m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; } -QString -OAIPet::asJson () const { +QString OAIPet::asJson() const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); return QString(bytes); } -QJsonObject -OAIPet::asJsonObject() const { +QJsonObject OAIPet::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if (m_id_isSet) { obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(category.isSet()){ + if (category.isSet()) { obj.insert(QString("category"), ::OpenAPI::toJsonValue(category)); } - if(m_name_isSet){ + if (m_name_isSet) { obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); } - - if(photo_urls.size() > 0){ + if (photo_urls.size() > 0) { obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls)); - } - - if(tags.size() > 0){ + } + if (tags.size() > 0) { obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags)); - } - if(m_status_isSet){ + } + if (m_status_isSet) { obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); } return obj; } - -qint64 -OAIPet::getId() const { +qint64 OAIPet::getId() const { return id; } -void -OAIPet::setId(const qint64 &id) { +void OAIPet::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } - -OAICategory -OAIPet::getCategory() const { +OAICategory OAIPet::getCategory() const { return category; } -void -OAIPet::setCategory(const OAICategory &category) { +void OAIPet::setCategory(const OAICategory &category) { this->category = category; this->m_category_isSet = true; } - -QString -OAIPet::getName() const { +QString OAIPet::getName() const { return name; } -void -OAIPet::setName(const QString &name) { +void OAIPet::setName(const QString &name) { this->name = name; this->m_name_isSet = true; } - -QList -OAIPet::getPhotoUrls() const { +QList OAIPet::getPhotoUrls() const { return photo_urls; } -void -OAIPet::setPhotoUrls(const QList &photo_urls) { +void OAIPet::setPhotoUrls(const QList &photo_urls) { this->photo_urls = photo_urls; this->m_photo_urls_isSet = true; } - -QList -OAIPet::getTags() const { +QList OAIPet::getTags() const { return tags; } -void -OAIPet::setTags(const QList &tags) { +void OAIPet::setTags(const QList &tags) { this->tags = tags; this->m_tags_isSet = true; } - -QString -OAIPet::getStatus() const { +QString OAIPet::getStatus() const { return status; } -void -OAIPet::setStatus(const QString &status) { +void OAIPet::setStatus(const QString &status) { this->status = status; this->m_status_isSet = true; } -bool -OAIPet::isSet() const { +bool OAIPet::isSet() const { bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(category.isSet()){ isObjectUpdated = true; break;} - - if(m_name_isSet){ isObjectUpdated = true; break;} - - if(photo_urls.size() > 0){ isObjectUpdated = true; break;} - - if(tags.size() > 0){ isObjectUpdated = true; break;} - - if(m_status_isSet){ isObjectUpdated = true; break;} - }while(false); + do { + if (m_id_isSet) { + isObjectUpdated = true; + break; + } + + if (category.isSet()) { + isObjectUpdated = true; + break; + } + + if (m_name_isSet) { + isObjectUpdated = true; + break; + } + + if (photo_urls.size() > 0) { + isObjectUpdated = true; + break; + } + + if (tags.size() > 0) { + isObjectUpdated = true; + break; + } + + if (m_status_isSet) { + isObjectUpdated = true; + break; + } + } while (false); return isObjectUpdated; } -bool -OAIPet::isValid() const { +bool OAIPet::isValid() const { // only required properties are required for the object to be considered valid return m_name_isValid && m_photo_urls_isValid && true; } -} - +} // namespace OpenAPI 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 c2577bfc5a2..73d40aed286 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 @@ -3,7 +3,6 @@ * 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 @@ -21,88 +20,77 @@ #include - #include "OAICategory.h" #include "OAITag.h" #include #include -#include "OAIObject.h" #include "OAIEnum.h" - +#include "OAIObject.h" namespace OpenAPI { -class OAIPet: public OAIObject { +class OAIPet : public OAIObject { public: OAIPet(); OAIPet(QString json); ~OAIPet() override; - QString asJson () const override; + QString asJson() const override; QJsonObject asJsonObject() const override; 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(); - + void initializeModel(); + 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; - - }; +}; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAIPet) 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 d986ce63b14..636bda52af6 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 @@ -3,125 +3,112 @@ * 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. */ - #include "OAITag.h" -#include -#include -#include #include +#include +#include +#include #include "OAIHelpers.h" namespace OpenAPI { OAITag::OAITag(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } OAITag::OAITag() { - this->init(); + this->initializeModel(); } -OAITag::~OAITag() { +OAITag::~OAITag() {} -} +void OAITag::initializeModel() { -void -OAITag::init() { - m_id_isSet = false; m_id_isValid = false; - + m_name_isSet = false; m_name_isValid = false; - } +} -void -OAITag::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); +void OAITag::fromJson(QString jsonString) { + QByteArray array(jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject); } -void -OAITag::fromJsonObject(QJsonObject json) { - +void OAITag::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); - - + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); - - + m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; } -QString -OAITag::asJson () const { +QString OAITag::asJson() const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); return QString(bytes); } -QJsonObject -OAITag::asJsonObject() const { +QJsonObject OAITag::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if (m_id_isSet) { obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_name_isSet){ + if (m_name_isSet) { obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); } return obj; } - -qint64 -OAITag::getId() const { +qint64 OAITag::getId() const { return id; } -void -OAITag::setId(const qint64 &id) { +void OAITag::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } - -QString -OAITag::getName() const { +QString OAITag::getName() const { return name; } -void -OAITag::setName(const QString &name) { +void OAITag::setName(const QString &name) { this->name = name; this->m_name_isSet = true; } -bool -OAITag::isSet() const { +bool OAITag::isSet() const { bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_name_isSet){ isObjectUpdated = true; break;} - }while(false); + do { + if (m_id_isSet) { + isObjectUpdated = true; + break; + } + + if (m_name_isSet) { + isObjectUpdated = true; + break; + } + } while (false); return isObjectUpdated; } -bool -OAITag::isValid() const { +bool OAITag::isValid() const { // only required properties are required for the object to be considered valid return true; } -} - +} // namespace OpenAPI 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 2c8eb291d0f..aa7c6007804 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 @@ -3,7 +3,6 @@ * 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 @@ -21,53 +20,46 @@ #include - #include -#include "OAIObject.h" #include "OAIEnum.h" - +#include "OAIObject.h" namespace OpenAPI { -class OAITag: public OAIObject { +class OAITag : public OAIObject { public: OAITag(); OAITag(QString json); ~OAITag() override; - QString asJson () const override; + QString asJson() const override; QJsonObject asJsonObject() const override; 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(); - + void initializeModel(); + qint64 id; bool m_id_isSet; bool m_id_isValid; - + QString name; bool m_name_isSet; bool m_name_isValid; - - }; +}; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAITag) 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 2afe6d808eb..a20a60929de 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 @@ -3,257 +3,244 @@ * 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. */ - #include "OAIUser.h" -#include -#include -#include #include +#include +#include +#include #include "OAIHelpers.h" namespace OpenAPI { OAIUser::OAIUser(QString json) { - this->init(); + this->initializeModel(); this->fromJson(json); } OAIUser::OAIUser() { - this->init(); + this->initializeModel(); } -OAIUser::~OAIUser() { +OAIUser::~OAIUser() {} -} +void OAIUser::initializeModel() { -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) { - QByteArray array (jsonString.toStdString().c_str()); +void OAIUser::fromJson(QString jsonString) { + QByteArray array(jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject); } -void -OAIUser::fromJsonObject(QJsonObject json) { - +void OAIUser::fromJsonObject(QJsonObject json) { + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); - - + m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; + m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]); - - + m_username_isSet = !json[QString("username")].isNull() && m_username_isValid; + m_first_name_isValid = ::OpenAPI::fromJsonValue(first_name, json[QString("firstName")]); - - + m_first_name_isSet = !json[QString("firstName")].isNull() && m_first_name_isValid; + m_last_name_isValid = ::OpenAPI::fromJsonValue(last_name, json[QString("lastName")]); - - + m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid; + m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]); - - + m_email_isSet = !json[QString("email")].isNull() && m_email_isValid; + m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]); - - + m_password_isSet = !json[QString("password")].isNull() && m_password_isValid; + m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]); - - + m_phone_isSet = !json[QString("phone")].isNull() && m_phone_isValid; + m_user_status_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]); - - + m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid; } -QString -OAIUser::asJson () const { +QString OAIUser::asJson() const { QJsonObject obj = this->asJsonObject(); QJsonDocument doc(obj); QByteArray bytes = doc.toJson(); return QString(bytes); } -QJsonObject -OAIUser::asJsonObject() const { +QJsonObject OAIUser::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if (m_id_isSet) { obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_username_isSet){ + if (m_username_isSet) { obj.insert(QString("username"), ::OpenAPI::toJsonValue(username)); } - if(m_first_name_isSet){ + if (m_first_name_isSet) { obj.insert(QString("firstName"), ::OpenAPI::toJsonValue(first_name)); } - if(m_last_name_isSet){ + if (m_last_name_isSet) { obj.insert(QString("lastName"), ::OpenAPI::toJsonValue(last_name)); } - if(m_email_isSet){ + if (m_email_isSet) { obj.insert(QString("email"), ::OpenAPI::toJsonValue(email)); } - if(m_password_isSet){ + if (m_password_isSet) { obj.insert(QString("password"), ::OpenAPI::toJsonValue(password)); } - if(m_phone_isSet){ + if (m_phone_isSet) { obj.insert(QString("phone"), ::OpenAPI::toJsonValue(phone)); } - if(m_user_status_isSet){ + if (m_user_status_isSet) { obj.insert(QString("userStatus"), ::OpenAPI::toJsonValue(user_status)); } return obj; } - -qint64 -OAIUser::getId() const { +qint64 OAIUser::getId() const { return id; } -void -OAIUser::setId(const qint64 &id) { +void OAIUser::setId(const qint64 &id) { this->id = id; this->m_id_isSet = true; } - -QString -OAIUser::getUsername() const { +QString OAIUser::getUsername() const { return username; } -void -OAIUser::setUsername(const QString &username) { +void OAIUser::setUsername(const QString &username) { this->username = username; this->m_username_isSet = true; } - -QString -OAIUser::getFirstName() const { +QString OAIUser::getFirstName() const { return first_name; } -void -OAIUser::setFirstName(const QString &first_name) { +void OAIUser::setFirstName(const QString &first_name) { this->first_name = first_name; this->m_first_name_isSet = true; } - -QString -OAIUser::getLastName() const { +QString OAIUser::getLastName() const { return last_name; } -void -OAIUser::setLastName(const QString &last_name) { +void OAIUser::setLastName(const QString &last_name) { this->last_name = last_name; this->m_last_name_isSet = true; } - -QString -OAIUser::getEmail() const { +QString OAIUser::getEmail() const { return email; } -void -OAIUser::setEmail(const QString &email) { +void OAIUser::setEmail(const QString &email) { this->email = email; this->m_email_isSet = true; } - -QString -OAIUser::getPassword() const { +QString OAIUser::getPassword() const { return password; } -void -OAIUser::setPassword(const QString &password) { +void OAIUser::setPassword(const QString &password) { this->password = password; this->m_password_isSet = true; } - -QString -OAIUser::getPhone() const { +QString OAIUser::getPhone() const { return phone; } -void -OAIUser::setPhone(const QString &phone) { +void OAIUser::setPhone(const QString &phone) { this->phone = phone; this->m_phone_isSet = true; } - -qint32 -OAIUser::getUserStatus() const { +qint32 OAIUser::getUserStatus() const { return user_status; } -void -OAIUser::setUserStatus(const qint32 &user_status) { +void OAIUser::setUserStatus(const qint32 &user_status) { this->user_status = user_status; this->m_user_status_isSet = true; } -bool -OAIUser::isSet() const { +bool OAIUser::isSet() const { bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_username_isSet){ isObjectUpdated = true; break;} - - if(m_first_name_isSet){ isObjectUpdated = true; break;} - - if(m_last_name_isSet){ isObjectUpdated = true; break;} - - if(m_email_isSet){ isObjectUpdated = true; break;} - - if(m_password_isSet){ isObjectUpdated = true; break;} - - if(m_phone_isSet){ isObjectUpdated = true; break;} - - if(m_user_status_isSet){ isObjectUpdated = true; break;} - }while(false); + do { + if (m_id_isSet) { + isObjectUpdated = true; + break; + } + + if (m_username_isSet) { + isObjectUpdated = true; + break; + } + + if (m_first_name_isSet) { + isObjectUpdated = true; + break; + } + + if (m_last_name_isSet) { + isObjectUpdated = true; + break; + } + + if (m_email_isSet) { + isObjectUpdated = true; + break; + } + + if (m_password_isSet) { + isObjectUpdated = true; + break; + } + + if (m_phone_isSet) { + isObjectUpdated = true; + break; + } + + if (m_user_status_isSet) { + isObjectUpdated = true; + break; + } + } while (false); return isObjectUpdated; } -bool -OAIUser::isValid() const { +bool OAIUser::isValid() const { // only required properties are required for the object to be considered valid return true; } -} - +} // namespace OpenAPI 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 29da83043b6..fee30755c25 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 @@ -3,7 +3,6 @@ * 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 @@ -21,101 +20,88 @@ #include - #include -#include "OAIObject.h" #include "OAIEnum.h" - +#include "OAIObject.h" namespace OpenAPI { -class OAIUser: public OAIObject { +class OAIUser : public OAIObject { public: OAIUser(); OAIUser(QString json); ~OAIUser() override; - QString asJson () const override; + QString asJson() const override; QJsonObject asJsonObject() const override; 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(); - + void initializeModel(); + 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; - - }; +}; -} +} // namespace OpenAPI Q_DECLARE_METATYPE(OpenAPI::OAIUser) 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 d1a62ee04b5..5ce057e6893 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 @@ -3,7 +3,6 @@ * 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 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 41a0e49e796..3c5aceb4736 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 @@ -3,7 +3,6 @@ * 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 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 24ed609d79a..372a92fc752 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 @@ -3,7 +3,6 @@ * 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 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 7f6a604dfdf..1db8cab8102 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 @@ -3,7 +3,6 @@ * 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 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 e91d7a06d89..a28463d4778 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 @@ -3,7 +3,6 @@ * 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 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 01785063ef5..e35ee7bc4b3 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 @@ -3,7 +3,6 @@ * 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