By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I want to make sure that my code is readable to front-end developers using swagger API development tool Swagger.
For example. If the request is successful, response is a Branch objectif fails, the response is a FindError object which has only one attribute message. So both can be carried out depends on the response. But the swagger UI doesn't show how the response should be shown, because I use "?
How Gratitude Changes You and Your Brain
Is this a best practice to catch an error? This coding documentation swagger is not useful to front-end developers since it doesn't show the response object.
Or any best practice for the above problem? There are a lot of method which return different object like Branch. Thanks in advance. Don't use verbs, instead use nouns as URL.
Your Answer
The following code snippet can help you :. The above class handles multiple exceptions including RecordNotFoundException and you can also customize for payload validations too. Learn more.
Best practice to send response in spring boot Ask Question. Asked 1 year, 7 months ago.]
It you have correctly told :)
Yes, it is the intelligible answer
Bravo, what necessary phrase..., an excellent idea
In my opinion the theme is rather interesting. I suggest you it to discuss here or in PM.
Your opinion is useful