Open hakamairi opened 2 years ago
Same issue, trying to generate a jira cloud api python client, from https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json. I'm using the swaggerapi/swagger-codegen-cli-v3 docker image.
i faced with the same problem for java serialization with jackson objectMapper. There is only additionalProperties in json but not actual ones. Is there any information about ht fix?
The two options I've found:
VehicleInfo vehicle = new VehicleInfo(); vehicle.put("info", new Info());
Has anyone found a better solution? I went with option 2 since it avoided a lot of trial and error.
Description
So I'm generating a client for yaml similar to the one below. They have types in schema that have their own properties and are open for new ones (additionalProperties: true). The expectation would be that when I call the service I get a typed response and all or remaining other properties in the map. Unfortunately I get all the values in key -> value map and none in the typed properties.
Seems to work not the way I would expect.
Swagger-codegen version
3.0.30
Swagger declaration file content or url
Command line used for generation
The config json:
And the generated VehicleInfo model:
I've tried this using JAVA and default gson as well as jersey2.
Steps to reproduce
Generate a client from yaml, try to use it and expect from the response object the type property to be set. Instead everything is treated as additional value and stored in map.
Related issues/PRs
Suggest a fix/enhancement
Would it be possible to populate the existing properties?