-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
Is your feature request related to a problem? Please describe.
I have a POST route in my openapi specification with a form-urlencoded body. The schema of this body is composed of some known properties that are defined, but also should accept other arbitrary properties as a Map that will be passed to the service without prior validation. To do this, I have an object type with the additionalProperties property to true.
Currently, it generates this error :
Form parameters with additionalProperties are not supported by OpenAPI Generator. Please report the issue to https://github.com/openapitools/openapi-generator if you need help.
Describe the solution you'd like
I would like the generator to generate a method signature with the known parameters as classic parameters, with an additional parameter with a Map<String, Object> or Map<String, String> type
public ResponseEntity<ResponseDTO> postRoute(Boolean param1, String param2,
@RequestParam Map<String, Object> additionalParameters) {
...
}Describe alternatives you've considered
I have not thought of a better way to do this. Currently, I need to remove the @Override modifier because I need this Map.
I can't change the content type or define all the parameters, because I don't control the client that will call this route (a webhook).
Additional context
Here is my openapi specification for the requestBody I need :
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
param1:
type: boolean
default: false
param2:
type: string
additionalProperties: true