question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unwanted error responses coming in springfox 2.8.0

See original GitHub issue

I have used below configuration for @ApiResponses but when i checked the swagger info unwanted 403 and 404 error response are coming even though i haven’t added. springfox-swagger2 : 2.8.0 springfox-swagger-ui : 2.8.0

@ApiResponses(value = {
	@ApiResponse(code = 401, message = "List of supported error codes:\r\n" + "- 40: Missing credentials\r\n"
					+ "- 41: Invalid credentials", response = Error.class),
	@ApiResponse(code = 400, message = "List of supported error codes:\r\n" + "- 25: Missing header\r\n"
					+ "- 26: Invalid header value", response = Error.class),
	@ApiResponse(code = 503, message = "List of supported error codes:\r\n"
					+ "- 5: The service is temporarily unavailable", response = Error.class),
	@ApiResponse(code = 500, message = "List of supported error codes:\r\n"
					+ "- 1: Internal error", response = Error.class) })

Method : Get operation image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
harish0000commented, Mar 21, 2018

@dilipkrish thanks ,below one worked


return new Docket(DocumentationType.SWAGGER_2)
            .useDefaultResponseMessages(false)
2reactions
dilipkrishcommented, May 31, 2018

@jtviegas would you mind creating a new issue for that so we dont miss it when working on 3.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Swagger 2 Issue - Spring Boot - Stack Overflow
Searching about I tried to change versions to 2.8.0, 2.7.0, 3.0.0... also returns error. The application is an apirest with task list ...
Read more >
docs/release-notes.md · serv/springfox - Gitee.com
BUILD-SNAPSHOT @varghgeorge (#1186) Unwanted class with map of map attribute @cbornet (#1174) Doc: includePatterns does not exist (anymore?)
Read more >
Springfox Reference Documentation - GitHub Pages
12, Allows globally overriding response messages for different http methods. In this example we override the 500 error code for all GET ...
Read more >
Remove Basic Error Controller In SpringFox Swagger-UI
Learn multiple ways to configure Swagger in a Spring Boot application to hide paths exposed by the BasicErrorController.
Read more >
Spring Boot RESTful API Documentation with Swagger 2
For best practices on documentation, I suggest going through this ... io.springfox. springfox-swagger2. 2.8.0. compile. com.h2database.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found