forked from loafle/openapi-generator-original
fixed ordering
This commit is contained in:
@@ -22,20 +22,11 @@ void
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("{{path}}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "{{httpMethod}}");
|
||||
|
||||
{{#pathParams}}
|
||||
QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{paramName}}").append("}");
|
||||
fullPath.replace({{paramName}}PathParam, stringValue({{paramName}}));
|
||||
{{/pathParams}}
|
||||
|
||||
{{#formParams}}{{^isFile}}
|
||||
if({{paramName}} != NULL) {
|
||||
input.add_var("{{paramName}}", *{{paramName}});
|
||||
}
|
||||
{{/isFile}}{{/formParams}}
|
||||
|
||||
{{#queryParams}}
|
||||
{{^collectionFormat}}
|
||||
if(fullPath.indexOf("?") > 0)
|
||||
@@ -91,6 +82,16 @@ void
|
||||
|
||||
{{/collectionFormat}}
|
||||
{{/queryParams}}
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "{{httpMethod}}");
|
||||
|
||||
{{#formParams}}{{^isFile}}
|
||||
if({{paramName}} != NULL) {
|
||||
input.add_var("{{paramName}}", *{{paramName}});
|
||||
}
|
||||
{{/isFile}}{{/formParams}}
|
||||
|
||||
{{#bodyParams}}
|
||||
{{#isContainer}}
|
||||
QJsonArray* {{paramName}}Array = new QJsonArray();
|
||||
@@ -104,7 +105,6 @@ void
|
||||
{{^isContainer}}
|
||||
QString output = {{paramName}}.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
{{/isContainer}}{{/bodyParams}}
|
||||
|
||||
{{#headerParams}}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGTag.h"
|
||||
#include <QList>
|
||||
#include "SWGCategory.h"
|
||||
#include <QString>
|
||||
#include "SWGCategory.h"
|
||||
#include <QList>
|
||||
#include "SWGTag.h"
|
||||
|
||||
#include "SWGObject.h"
|
||||
|
||||
|
||||
@@ -20,20 +20,20 @@ SWGPetApi::updatePet(SWGPet body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "PUT");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -68,20 +68,20 @@ SWGPetApi::addPet(SWGPet body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -116,11 +116,6 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -170,6 +165,12 @@ SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -220,11 +221,6 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/findByTags");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -274,6 +270,12 @@ SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -324,9 +326,6 @@ SWGPetApi::getPetById(qint64 petId) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
|
||||
fullPath.replace(petIdPathParam, stringValue(petId));
|
||||
@@ -334,7 +333,11 @@ SWGPetApi::getPetById(qint64 petId) {
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -378,15 +381,17 @@ SWGPetApi::updatePetWithForm(QString* petId, QString* name, QString* status) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
|
||||
fullPath.replace(petIdPathParam, stringValue(petId));
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
if(name != NULL) {
|
||||
input.add_var("name", *name);
|
||||
}
|
||||
@@ -397,7 +402,6 @@ SWGPetApi::updatePetWithForm(QString* petId, QString* name, QString* status) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -431,9 +435,6 @@ SWGPetApi::deletePet(QString* api_key, qint64 petId) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
|
||||
fullPath.replace(petIdPathParam, stringValue(petId));
|
||||
@@ -441,7 +442,11 @@ SWGPetApi::deletePet(QString* api_key, qint64 petId) {
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -478,22 +483,23 @@ SWGPetApi::uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestI
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
QString petIdPathParam("{"); petIdPathParam.append("petId").append("}");
|
||||
fullPath.replace(petIdPathParam, stringValue(petId));
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
if(additionalMetadata != NULL) {
|
||||
input.add_var("additionalMetadata", *additionalMetadata);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ SWGStoreApi::getInventory() {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/inventory");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
@@ -28,9 +32,6 @@ SWGStoreApi::getInventory() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
@@ -82,20 +83,20 @@ SWGStoreApi::placeOrder(SWGOrder body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/order");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -139,9 +140,6 @@ SWGStoreApi::getOrderById(QString* orderId) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}");
|
||||
fullPath.replace(orderIdPathParam, stringValue(orderId));
|
||||
@@ -149,7 +147,11 @@ SWGStoreApi::getOrderById(QString* orderId) {
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -193,9 +195,6 @@ SWGStoreApi::deleteOrder(QString* orderId) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}");
|
||||
fullPath.replace(orderIdPathParam, stringValue(orderId));
|
||||
@@ -203,7 +202,11 @@ SWGStoreApi::deleteOrder(QString* orderId) {
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,20 +20,20 @@ SWGUserApi::createUser(SWGUser body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -68,15 +68,16 @@ SWGUserApi::createUsersWithArrayInput(QList<SWGUser*>* body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithArray");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
@@ -120,15 +121,16 @@ SWGUserApi::createUsersWithListInput(QList<SWGUser*>* body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithList");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
@@ -172,11 +174,6 @@ SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/login");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -204,6 +201,12 @@ SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -247,6 +250,10 @@ SWGUserApi::logoutUser() {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/logout");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
@@ -255,9 +262,6 @@ SWGUserApi::logoutUser() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
@@ -289,9 +293,6 @@ SWGUserApi::getUserByName(QString* username) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
|
||||
fullPath.replace(usernamePathParam, stringValue(username));
|
||||
@@ -299,7 +300,11 @@ SWGUserApi::getUserByName(QString* username) {
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -343,9 +348,6 @@ SWGUserApi::updateUser(QString* username, SWGUser body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "PUT");
|
||||
|
||||
|
||||
QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
|
||||
fullPath.replace(usernamePathParam, stringValue(username));
|
||||
@@ -353,13 +355,16 @@ SWGUserApi::updateUser(QString* username, SWGUser body) {
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "PUT");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -394,9 +399,6 @@ SWGUserApi::deleteUser(QString* username) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
QString usernamePathParam("{"); usernamePathParam.append("username").append("}");
|
||||
fullPath.replace(usernamePathParam, stringValue(username));
|
||||
@@ -404,7 +406,11 @@ SWGUserApi::deleteUser(QString* username) {
|
||||
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user