We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
springdoc
Learn more about funding links in repositories.
Report abuse
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
springdoc.default-support-form-data
I'm using.
v3.4.1
v2.8.1
v3.1
In my example I'm using @Schema(types = "boolean").
@Schema(types = "boolean")
Here's a code that will generate a valid Swagger definition.
@PostMapping(path = "/dummy", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @ResponseStatus(value = HttpStatus.OK) public String dummy( @RequestPart(value = "file", required = false) MultipartFile file, @Parameter(description = "There is dummy param", schema = @Schema(types = "boolean")) @RequestParam(name = "is_dummy") String isDummy ) { return ""; }
The param definition is as follows. It's valid.
"parameters": [ { "name": "is_dummy", "in": "query", "description": "There is dummy param", "required": true, "schema": { "type": "boolean" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" } } } } } }
Then let's try to set true for springdoc.default-support-form-data config option. We will get a param definition as follows.
true
"requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" }, "is_dummy": { "description": "There is dummy param" } } } } } }
The schema to is_dummy field is not added anymore.
schema
is_dummy
Another example properly working example. Code below. POST with application/x-www-form-urlencoded content type.
POST
application/x-www-form-urlencoded
@PostMapping(path = "/dummy", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) @ResponseStatus(value = HttpStatus.OK) public String dummy( @Parameter(description = "There is dummy param", schema = @Schema(types = "boolean")) @RequestParam(name = "is_dummy") String isDummy ) { return ""; }
It produces valid param definition.
"requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "type": "boolean", "description": "There is dummy param" } } } },
The text was updated successfully, but these errors were encountered:
06b297a
No branches or pull requests
I'm using.
v3.4.1
v2.8.1
v3.1
In my example I'm using
@Schema(types = "boolean")
.Here's a code that will generate a valid Swagger definition.
The param definition is as follows. It's valid.
Then let's try to set
true
forspringdoc.default-support-form-data
config option. We will get a param definition as follows.The
schema
tois_dummy
field is not added anymore.Another example properly working example. Code below.
POST
withapplication/x-www-form-urlencoded
content type.It produces valid param definition.
The text was updated successfully, but these errors were encountered: