Skip to content

Commit 72681d2

Browse files
committed
fix(cpp-qt-client): add asJsonObject method to OAIEnum class to fix enum handling in query parameters
1 parent 3c664d1 commit 72681d2

File tree

1 file changed

+7
-0
lines changed
  • modules/openapi-generator/src/main/resources/cpp-qt-client

1 file changed

+7
-0
lines changed

modules/openapi-generator/src/main/resources/cpp-qt-client/enum.mustache

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <QJsonValue>
66
#include <QMetaType>
77
#include <QString>
8+
#include <QJsonObject>
89

910
{{#cppNamespaceDeclarations}}
1011
namespace {{this}} {
@@ -27,6 +28,12 @@ public:
2728
virtual QString asJson() const {
2829
return jstr;
2930
}
31+
32+
virtual QJsonObject asJsonObject() const {
33+
QJsonObject obj;
34+
obj["value"] = jstr;
35+
return obj;
36+
}
3037

3138
virtual void fromJson(QString jsonString) {
3239
jstr = jsonString;

0 commit comments

Comments
 (0)