Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response for Controller with type of "Map of Map" is not properly generated. #325

Open
iliapastushenko opened this issue Jun 15, 2022 · 0 comments
Labels

Comments

@iliapastushenko
Copy link

iliapastushenko commented Jun 15, 2022

Describe the bug

I have next controller method

public Map<String, Map<String, String>> getContent()

I need to describe this response in the yml.

Tried this option:

  responses:
    '200':
      description: successful operation
      content:
        '*/*':
          schema:
            type: object
            additionalProperties:
              type: object
              additionalProperties:
                type: string

But this generates next interface:

default ResponseEntity<Map<String, Map<String>> getContent
so obviously this code has compilation error.

I tried other options for yml - nothing works.
Looks like a bug.

To Reproduce:
Mentioned above.

Expected behavior:
Properly generated code: default ResponseEntity<Map<String, Map<String,String>>> getContent ()

Environment

Plugin version: 2.19.2
Gradle version: 7.1
Java version: openjdk version "16" 2021-03-16 OpenJDK Runtime Environment (build 16+36-2231)
OS: masOS Big Sur Version 11.5.2

Dependencies are:

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web:2.7.0'
    implementation 'io.swagger.core.v3:swagger-annotations:2.2.0'
    implementation 'io.springfox:springfox-swagger2:3.0.0'
    implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
    swaggerCodegen 'org.openapitools:openapi-generator-cli:6.0.0'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant