Closed ysavourel closed 1 year ago
The problem with OpenApi is that it's written for JS-like structures, and it's kinda weird the deeper we go. I believe that additionalProperties
& array type are not directly documented in the spec:
It looks like this is even an issue on Swagger
side:
Anyway, I see the problem. We could adjust that part as it seems to be supported by some codegen libs:
It seems the openApi processor doesn't generate the correct JSON for maps that have a list has value. (Using Javalin 5.5.0 with the OpenAPI plugin 5.5.0-1) I have the following class:
And I get the following OpenAPI output:
As you can see the
mapOfEntries
property is defined as just a singleEntry
object instead of a list. I believe theadditionalProperties
should be more like this:I'm missing some additional annotation(s)?
Even if the list is a list of simple strings (
Map<String, List<String>>
) we get the property defined as just one string: