@ApiResponse response parameter not used in 3.0.0
See original GitHub issueStarting with 3.0.0 (in 2.9.2 it worked properly)
@ApiResponse(code = 404, message = "Not Found", response = CustomError::class)
The 404 - Not Found is in the documentation, but the defined response (CustomError in example) not shown in the generated documentation (response sample and model)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Describing Responses - Swagger
In OpenAPI 3.0, you can use oneOf to specify alternate schemas for the response and document possible dependencies verbally in the response description...
Read more ><Spring Boot / Springfox> Swagger UI not showing example ...
In the case of using the springdoc-openapi-ui (>=1.5.0) here is my working sample to show example data in the request and response sections ......
Read more >Documenting a Spring REST API Using OpenAPI 3.0 - Baeldung
Learn how to generate OpenAPI 3.0 specifications for a Spring REST API using SpringDoc.
Read more >F.A.Q - Springdoc-openapi
You can use the same swagger properties in the documentation as Spring Boot ... description = "Not found", content = @Content), @ApiResponse(responseCode ...
Read more >Springfox Reference Documentation - GitHub Pages
For non-boot applications springfox-swagger-ui is no longer ... and indicate that it will use the response model Error (which will be ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue here. After some debugging, root cause should be: https://github.com/springfox/springfox/blob/07a4c86d70b791f21c2d2f656a863920b8c883c7/springfox-swagger2/src/main/java/springfox/documentation/swagger2/mappers/ServiceModelToSwagger2Mapper.java#L117
Springfox 3.0 uses v3 models by default, but
source.getResponses()
gives wrong type. To workaround it for now, add:springfox.documentation.swagger.use-model-v3=false
in your application.properties.The prescribed workaround doesn’t seem to work for
ResponseEntity<?>
return types. I’m not sure if that’s a separate issue or if it’s part and parcel to this bug.