forked from loafle/openapi-generator-original
Additional locations where float/double handling is needed
This commit is contained in:
@@ -94,6 +94,16 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) {
|
||||
setValue(&val, jval, QStringLiteral("bool"), QStringLiteral(""));
|
||||
output->append((void*)&val);
|
||||
}
|
||||
else if(QStringLiteral("float").compare(complexType) == 0) {
|
||||
float val;
|
||||
setValue(&val, jval, QStringLiteral("float"), QStringLiteral(""));
|
||||
output->append((void*)&val);
|
||||
}
|
||||
else if(QStringLiteral("double").compare(complexType) == 0) {
|
||||
double val;
|
||||
setValue(&val, jval, QStringLiteral("double"), QStringLiteral(""));
|
||||
output->append((void*)&val);
|
||||
}
|
||||
}
|
||||
}
|
||||
QList<void*> **val = static_cast<QList<void*>**>(value);
|
||||
@@ -139,6 +149,14 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) {
|
||||
bool* str = static_cast<bool*>(value);
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("float").compare(type) == 0) {
|
||||
float* str = static_cast<float*>(value);
|
||||
output->insert(name, QJsonValue((double)*str));
|
||||
}
|
||||
else if(QStringLiteral("double").compare(type) == 0) {
|
||||
double* str = static_cast<double*>(value);
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user