Skip to content

Where there are multiple fields with same generic definition Map<K, V> (e.g Map<String, String>) then only the first field is rendered in the example text #2972

@camlane

Description

@camlane

Where there are multiple fields with same generic definition Map<K, V> (e.g Map<String, String>) then only the first field is rendered in the example text

When I have a response class with more than one field of type Map<String, String> only the first field will render
in the 'Example Value' part of the response definition in swagger ui

private Map<String, String> myField1;
private Map<String, String> myField2;

Only the below is output

"myField": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  }

However I can see the below lines being output to the log twice.

io.swagger.v3.core.converter.ModelConverterContextImpl resolve: resolve [map type; class java.util.Map, [simple type, class java.lang.String] -> [simple type, class java.lang.String]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions