Who's using Default Response?
Hi all!
I have been using APIsecurity.io OAS security audit tool this week and one of the risks it raised was a lack of default response on APIs: https://apisecurity.io/encyclopedia/content/oasv3/datavalidation/responsedefinition/v3-response-default-undefined.htm
Currently I include the codes that I want to handle: 200, 401,403 perhaps a 500.. But have not tried the swagger Default response yet.
Is anyone in the community using it and could share their thoughts on its best practice?
My POV is that its to cover a scenario where there is more than one http error condition and also when the client does something really bad (perhaps on purpose) and we have a case that captures that and prevents an uncaught being sent to a client (stack trace god forbid)
Be great to hear your thoughts/ usage.
matjung Thanks for sharing.
I took it a step further and spoke with the team at API Security about what it is used for.
They sell an API firewall (smart proxy linked to a Whitelist from the API Def) and it uses the "default response" as a special case in the event that the downstream service sends something that isnt in the API definition.
- API Def has that you could send a 401 and a 403 to clients, but the service sends a 409. In this event it doesn't match the white list so is not forward to the client and instead the default response is sent.
I think if your not using that, then the default case isn't of interest.
Anyone else want to elaborate / share?