You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Spring Boot RestController that wants to support POST request bodies of both form data or JSON,
to use the built-in functionality, multiple endpoint methods must be used to support both content types.
The JSON accepting method expects the Spring MVC @RequestBody annotation to be used,
while the form data version expects Spring MVC @RequestBody to not be used, so the Swagger annotation must be used instead.
Although the output OpenAPI JSON correctly puts the two as the same request body with different supported content, the operationId is incorrectly deduplicated, changing its value. n.b. This does require the operationId to be set explicitly on both methods, because otherwise the last automatically generated operationId will be picked to represent both methods.
To Reproduce
What version of spring-boot you are using?
3.3.1
What modules and versions of springdoc-openapi are you using?
springdoc-openapi-starter-webmvc-api version 2.6.0,
creating OpenAPI version 3.0.1 JSON.
What is the actual and the expected result using OpenAPI Description (yml or json)?
Actual (snippet):
When the different content types are merged for a single requestBody, this should not trigger deduplication and the originally specified operationId should be used.
The text was updated successfully, but these errors were encountered:
Describe the bug
In a Spring Boot RestController that wants to support POST request bodies of both form data or JSON,
to use the built-in functionality, multiple endpoint methods must be used to support both content types.
The JSON accepting method expects the Spring MVC
@RequestBody
annotation to be used,while the form data version expects Spring MVC
@RequestBody
to not be used, so the Swagger annotation must be used instead.Although the output OpenAPI JSON correctly puts the two as the same request body with different supported content, the operationId is incorrectly deduplicated, changing its value.
n.b. This does require the operationId to be set explicitly on both methods, because otherwise the last automatically generated operationId will be picked to represent both methods.
To Reproduce
3.3.1
springdoc-openapi-starter-webmvc-api version 2.6.0,
creating OpenAPI version 3.0.1 JSON.
Actual (snippet):
Expected the same except:
Expected behavior
The text was updated successfully, but these errors were encountered: