Skip to content

[BUG][resttemplate] Object with additionalProperties (HashMap) does not generate a model #3602

@Na3blis

Description

@Na3blis
Description

I am trying to generate a HashMap class, but no class is generated and a plain Java Map is used where the class ContextHeaders should be used.

  @JsonProperty("contextHeaders")

  private Map contextHeaders = null;
openapi-generator version

4.0.3

OpenAPI declaration file content or url

swagger.json
swagger-client-config.json

Command line used for generation

curl -s -o ./codegen.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar
java -jar ./codegen.jar generate -c ./swagger-client-config.json -i ./swagger.json -g java -o generated-client/

Steps to reproduce

Run the codegen 4.0.3 against the swagger.json file with the config swagger-client-config.json. Notice there is no com.example.authrules.v1.client.model.ContextHeaders class, and com.example.authrules.v1.client.model.RulesUser references a plain Java Map instead of a class

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions