You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The blog talks about the UX of an API and then shows an example of bad API design. But the example only shows 'happy flows'.
I have noticed that bad API design can also be visible in the error responses.
The error response should never contain a technical error: "Cannot call method 'toString of undefined'".
Instead, the error message should be meaningful, such as "The name should be provided" or "The provided quantity should be a number."
Also, the HTTP return code in the response can tell you a lot about the error.
I hate responses that have a 200 return code, but then the body contains an error.
Hopefully, these examples show a more extensive view on UX for API's.
The text was updated successfully, but these errors were encountered:
I really liked this blog: https://blog.boot.dev/clean-code/backend-ux-design/
But I would like to see it extended.
The blog talks about the UX of an API and then shows an example of bad API design. But the example only shows 'happy flows'.
I have noticed that bad API design can also be visible in the error responses.
The error response should never contain a technical error: "Cannot call method 'toString of undefined'".
Instead, the error message should be meaningful, such as "The name should be provided" or "The provided quantity should be a number."
Also, the HTTP return code in the response can tell you a lot about the error.
I hate responses that have a 200 return code, but then the body contains an error.
Hopefully, these examples show a more extensive view on UX for API's.
The text was updated successfully, but these errors were encountered: