openapi-generator
openapi-generator copied to clipboard
[BUG] Kotlin generated class for `type: object` with `additionalProperties` does not compile
Description
OpenApi allows to define an open ended object (map). When generating Kotlin code for it, the class declaration contains a compile error.
data class Metadata(...) : kotlin.collections.HashMap<String, kotlin.String>{
is generated, but it should be:
data class Metadata(...) : kotlin.collections.HashMap<String, kotlin.String>(){
.
openapi-generator version
6.0.0 / 6.0.1
OpenAPI declaration file content or url
Spec:
components:
schemas:
Metadata:
type: "object"
properties:
customerIp:
type: "string"
additionalProperties:
type: "string"
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
Issue still exists in latest 6.2.0 version. It is problematic because I needed use .openapi-generator-ignore
file and ignore some types during generating and later build it manually.