-
-
Notifications
You must be signed in to change notification settings - Fork 545
Closed
Description
Example:
@Tag(name = "deployments")
@RestController
public class DeploymentController {
@PostMapping("/bla")
@ResponseStatus(HttpStatus.ACCEPTED)
@Operation(operationId = "deployment")
public DeploymentPostResponse createDeployment(@Valid @RequestBody DeploymentPostRequest deploymentPostRequest) {
return new DeploymentPostRequest();
}
}
Generates (note missing content-type: application/json, request however has it)
{
"responses": {
"202": {
"description": "Accepted",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/DeploymentPostResponse"
}
}
}
}
}
}
Then after adding @Opeation with application/json on createDeployment
@Operation(operationId = "deployment", responses=@ApiResponse(content = @Content(mediaType = "application/json")))
I get:
{
"responses": {
"default": {
"description": "default response",
"content": {
"application/json": {}
}
}
}
}
Few things which seems unclear:
- Why content-type generated for say for request ? but not for response?
- Would it make sense to combine autogen with annotations, annotations overriding? Or that would be too verbose?
Metadata
Metadata
Assignees
Labels
No labels