etherealjoy 12f3661d6f Qt5cpp plug memleaks (#7695)
* Small fixes to prevent crash when empty json body is provided.

* WIP: plug mem-leaks

* fixup: add the QJsonObject instance in toJsonArray instead of pointer

* fixup: simplify toJsonMap

Actually the original solution is incomplete, because "innerType" maps to a single C++ type. Have a look at Qt's builtin QJsonObject::fromVariantMap.

* Updates to antis81:patch-1 after tests.

* update to remove string allocation

* Updates due to address of members being passed

* Update PetStore Examples

* Small updates for Header includes
2018-03-07 20:54:40 +08:00

35 lines
1.2 KiB
C++

/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#ifndef SWG_HELPERS_H
#define SWG_HELPERS_H
#include <QJsonValue>
#include <QList>
#include <QMap>
namespace Swagger {
void setValue(void* value, QJsonValue obj, QString type, QString complexType);
void toJsonArray(QList<void*>* value, QJsonObject& output, QString innerName, QString innerType);
void toJsonValue(QString name, void* value, QJsonObject& output, QString type);
void toJsonMap(QMap<QString, void*>* value, QJsonObject& output, QString innerName, QString innerType);
bool isCompatibleJsonValue(QString type);
QString stringValue(QString* value);
QString stringValue(qint32 value);
QString stringValue(qint64 value);
QString stringValue(bool value);
}
#endif // SWG_HELPERS_H