Skip to content

[QT5CPP] Code generator does not handle the additionalproperties section of the yaml for qt5cpp #6841

@etherealjoy

Description

@etherealjoy

Code generator does not handle the additionalproperties section of the yaml for qt5cpp

Description

Whenever the yaml have additionalProperties the generated code is missing handling for the QMap caused by the arbitrary name of the property.

when the additionalProperties is referencing an array the generated code is also missing handling the QList from the additional property which may then host a normal property.

Swagger-codegen version

The problem is reproducible in v2.2.3 and v3.0.0
It is not a regression.

Swagger declaration file content or url

https://docs.docker.com/engine/api/v1.31/swagger.yaml

Command line used for generation

java -jar /home/dev/swagger-codegen/swagger-codegen-cli-3.0.0-20171009.075709-6.jar generate -i /mnt/YoctoDisk/genivi/genivi-dev-platform/meta-userapp/recipes-dockerctrl/dockerctrl/sources/dockerctrl-qtapp/docker-v132-subset.yaml -o /mnt/YoctoDisk/genivi/genivi-dev-platform/meta-userapp/recipes-dockerctrl/dockerctrl/sources/dockerctrl-qtapp/gen-qt1 -l qt5cpp

java -jar /home/dev/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i /mnt/YoctoDisk/genivi/genivi-dev-platform/meta-userapp/recipes-dockerctrl/dockerctrl/sources/dockerctrl-qtapp/docker-v132-subset.yaml -o /mnt/YoctoDisk/genivi/genivi-dev-platform/meta-userapp/recipes-dockerctrl/dockerctrl/sources/dockerctrl-qtapp/gen-qt1 -l qt5cpp

Steps to reproduce

Have the yaml code referencing additional properties pointing to an array type, and then the code generation is missing some steps to deserialize the json data.

Related issues/PRs

I have not seen this issue yet in the known issues

Suggest a fix/enhancement
  • fix handling of QMap for the additionalproperties arbitrary section.
  • provide means to access the QMap for both key and json value
  • when the QMap has an array as JSon value there has to be a way to access that

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions