Closed
Description
Describe the bug
When I have the consumes
parameter in my endpoint like this:
@PostMapping(value = "/{cardId}/lock", consumes = {"application/json;charset=UTF-8", "application/json; charset=UTF-8", "application/json"})
"application/json; charset=UTF-8" is skipped.
To Reproduce
Java: 17
Spring Boot: 3.2.5
Springdocs: 2.5.0
Expected behavior
"application/json; charset=UTF-8" should be present in the generated OpenAPI JSON file.
Additional context
I debugged this problem and found that it started occurring after this commit: Commit 1732dba, which fixed this issue: Issue 1546. The problem is in this section of the commit: Commit 1732dba - Line 272.
After adding the if (ArrayUtils.isEmpty(methodConsumes)) statement, we are skipping the overriding consume types. I believe instead of skipping this step when the consumes array is not empty, we should merge the values.
Metadata
Metadata
Assignees
Labels
No labels