custom reason message for 200
See original GitHub issueI’m using springfox 2.7 with spring mvc. its working fine except below problem: I want to return a string in one rest service. I can set reason for 400,401, 500 response codes. but I can not show a reason for 200 status code.I dont want return “OK” message. in the “Response Class (Status 200)” section I will get “string” message always:
Response Class (Status 200) string
I’m using following code :
@ApiResponses(value = {
@ApiResponse(code = 200, message = "my message 200", response = String.class),
@ApiResponse(code = 400, message = "my message 400.", response = String.class),
@ApiResponse(code = 500, message = "Failure", response = String.class),
})
While if i use a custom pojo class instead of String.class, I can see “my message 200” in the “Response Class (Status 200)” section:
@ApiResponse(code = 200, message = "my message 200", response = SamplePojo.class)
Response Class (Status 200) my message 200
what is the problem? thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Express 4.14 - How to send 200 status with a custom message?
You can use: res.status(200).send('some text');. if you want to pass number to the send method, convert it to string first to avoid deprecation ......
Read more >How to set a custom health check 200 response code
Cause : A server should only be passing health checks when a specific 200 response code is received. Resolution: Set the Real Server...
Read more >HTTP/1.1: Response
The reason phrases listed here are only recommendations -- they MAY be replaced by local equivalents without affecting the protocol. Status-Code = "100"...
Read more >How to Return HTTP Status Codes in a Spring Boot Application
Return HTTP Status Codes in Spring Boot If the request went through just fine, a 200 OK is returned, while a 404 Not...
Read more >HTTP Status Codes for Beginners | Alone On A Hill
The 200 status code is by far the most common returned. It means, simply, that the request was received and understood and is...
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
@paulosales thank you!
Closing as not reproducable.