Add backport test for openapi2.0 arrays
- There is a 'collectionFormat' key that specified the array format
and the separator for array items in the openapi2.0.
The 'collectionFormat' supported following values:
tsv, csv, ssv, pipes and multi.
See the documentation for the 'collectionFormat' here:
https://spec.openapis.org/oas/v2.0.html#fixed-fields-6
Starting from openapi3.0 the 'collectionFormat' was exchanged to
'style' + 'explode' combination of variables,
see https://spec.openapis.org/oas/v3.1.1.html#style-examples
The exchange is not 1:1. It means not all 'collectionFormat'
values are being supported by the openapi3.0 version.
However, the backward compatibility with openapi2.0 version
should be tested.
- Add openapi2.0.yaml file that uses {{#collectionFormat}} for
arrays of primitive types.
- Add client test application of tsv, csv, ssv, pipes and multi
values for PATH and QUERY.
NOTE: In openapi2.0 operation parameters supports only primitive
types. You can have an array, but the items must be a
primitive value type. Objects are not supported.
NOTE: the generator's core sets {{#collectionFormat}}='csv' for all
incompatible combinations between Openapi3.0 and Openapi2.0
(e.g. LABEL, MATRIX or 'tsv').
Task-number: QTBUG-138564
Change-Id: Ib00299e6d1550f49d8f8b31d3e5e2da28bbb44e4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
| commit | 9a2eb05764799344ee6a5f4c878b82be9b57c3bc |
| parent | 0170ac36e83bd0ba11c6592a1c762c054a8aa221 |
| author | Tatiana Borisova <tatiana.borisova@qt.io> |
| committer | Tatiana Borisova <tatiana.borisova@qt.io> |
| commit time | Wed, 6 Aug 2025 11:42:11 +0200 |
- M .gitignore
- M coin/run-openapi-generator-linux-tests.sh
- M coin/run-openapi-generator-macos-tests.sh
- M generate.sh
- A tests/auto/openapi2.0/client/CMakeLists.txt
- A tests/auto/openapi2.0/client/build-and-test.bash
- A tests/auto/openapi2.0/client/client/CMakeLists.txt
- A tests/auto/openapi2.0/client/client/Config.cmake.in
- A tests/auto/openapi2.0/client/client/OAIBaseApi.cpp
- A tests/auto/openapi2.0/client/client/OAIBaseApi.h
- A tests/auto/openapi2.0/client/client/OAIEnum.h
- A tests/auto/openapi2.0/client/client/OAIFakeApi.cpp
- A tests/auto/openapi2.0/client/client/OAIFakeApi.h
- A tests/auto/openapi2.0/client/client/OAIHelpers.cpp
- A tests/auto/openapi2.0/client/client/OAIHelpers.h
- A tests/auto/openapi2.0/client/client/OAIHttpFileElement.cpp
- A tests/auto/openapi2.0/client/client/OAIHttpFileElement.h
- A tests/auto/openapi2.0/client/client/OAIHttpRequest.cpp
- A tests/auto/openapi2.0/client/client/OAIHttpRequest.h
- A tests/auto/openapi2.0/client/client/OAIObject.h
- A tests/auto/openapi2.0/client/client/OAIServerConfiguration.h
- A tests/auto/openapi2.0/client/client/OAIServerVariable.h
- A tests/auto/openapi2.0/client/client/README.md
- A tests/auto/openapi2.0/client/client/client.pri
- A tests/auto/openapi2.0/client/client/doc/Doxyfile.in
- A tests/auto/openapi2.0/client/openapi2.0/CMakeLists.txt
- A tests/auto/openapi2.0/client/openapi2.0/OperationParametersBackport.cpp
- A tests/auto/openapi2.0/server/api/openapi.yaml
- A tests/auto/openapi2.0/server/build-and-run.bash
- A tests/auto/openapi2.0/server/go.mod
- A tests/auto/openapi2.0/server/go.sum
- A tests/auto/openapi2.0/server/go/api_fake.go
- A tests/auto/openapi2.0/server/go/routers.go
- A tests/auto/openapi2.0/server/main.go
- A yaml_files/openapi2.0.yaml