Code generation error with openapi: 3.1.0
- For openapi3.1.x, generator can identify the object as a composition
of a free-form and a map. The problem appeared, when the free-form
object m_{{name}} was generated as a QMap<QString, QString>, since
QMap doesn't have isValid() or isSet() methods and should be handled
differently.
This case is now handled correctly by the generator.
- An example that generates the QMap<QString, QString> type has been
added to the basic-schemas.yaml auto test. The expected result of test
is compilation succeed.
Fixes: QTBUG-147745
Pick-to: 6.12 6.11
Change-Id: Ib69e008f9b7c84b57a1f16506f15602f275908ff
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
| commit | b09dd42d800c77fe77e5ccac7f4a21feaef70421 |
| parent | de9e36b1cc0a1a88307dc4d1d973fb8f5b2ca157 |
| author | Tatiana Borisova <tatiana.borisova@qt.io> |
| committer | Tatiana Borisova <tatiana.borisova@qt.io> |
| commit time | Fri, 26 Jun 2026 15:48:24 +0000 |
- M src/tools/qtopenapi-generator/src/main/resources/cpp-qt6-client/model-body.mustache
- M tests/auto/models/client/standard/basic-schemas.yaml
- M tests/auto/qtopenapigen/client/openapigen/data/cmake_generated/clienttest/client/apiresponse.cpp
- M tests/auto/qtopenapigen/client/openapigen/data/cmake_generated/clienttest/client/category.cpp
- M tests/auto/qtopenapigen/client/openapigen/data/cmake_generated/clienttest/client/order.cpp
- M tests/auto/qtopenapigen/client/openapigen/data/cmake_generated/clienttest/client/pet.cpp
- M tests/auto/qtopenapigen/client/openapigen/data/cmake_generated/clienttest/client/tag.cpp
- M tests/auto/qtopenapigen/client/openapigen/data/cmake_generated/clienttest/client/user.cpp