mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-01 08:52:45 +00:00
[1/3] update openapi spec: update generator
Update the generator to be able to handle the new challenges that arose with the new specification, namely: - Enums that do not start with a capital letter - Enums that contain a reserved keyword - Basic handling 'allOf' keys in properties Additionally, the comparison enum deserialisation is now case-insensitive.
This commit is contained in:
parent
0180aeaab1
commit
f71c7a991b
3 changed files with 51 additions and 21 deletions
|
@ -13,9 +13,9 @@ template <>
|
|||
|
||||
QString str = source.toString();
|
||||
|
||||
{{#each values as |value|}}
|
||||
if (str == QStringLiteral("{{value}}")) {
|
||||
return {{className}}::{{value}};
|
||||
{{#each entries as |entry|}}
|
||||
if (str == QStringLiteral("{{entry.value}}")) {
|
||||
return {{className}}::{{entry.name}};
|
||||
}
|
||||
|
||||
{{/each}}
|
||||
|
@ -27,9 +27,9 @@ template <>
|
|||
QJsonValue toJsonValue(const {{className}} &source, convertType<{{className}}>) {
|
||||
switch(source) {
|
||||
|
||||
{{#each values as |value|}}
|
||||
case {{className}}::{{value}}:
|
||||
return QStringLiteral("{{value}}");
|
||||
{{#each entries as |entry|}}
|
||||
case {{className}}::{{entry.name}}:
|
||||
return QStringLiteral("{{entry.value}}");
|
||||
|
||||
{{/each}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue