Open MetallFoX opened 1 year ago
According to swagger reference to openapi specification, the correct way to define Dictionary or Map is to specify additionalProperties
section.
SpringDoc annotation processing generates something like this for the Map<String, List<String>>
too:
/foo/bar:
get:
tags:
- foo
- bar
summary: foobar
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
additionalProperties:
type: array
items:
type: string
I've tried several definitions with no result and didn't find additionalProperties
handling in the code either.
It might be better to add additionalProperties
support instead of using custom mapping workarounds for such cases.
at the moment, only one level of generic is supported in the mapping (I think it is in the docs). I didn't spent any time yet to find out what it would take to support more levels.
yes, there is no code that checks additionalProperties
. So let's make this a feature request :-)
Hi @hauner!
Processing response mapping of generic types with depth 1 works fine:
But it doesn't work with a complex generic types such as:
FooToBar => java.util.Map<java.lang.String, java.lang.List<java.lang.String>>
The output of processing:
It would be useful to add complex generic types support.