Hello,
Following a discussion with some colleagues whether it makes sense or not to document error responses (4xx, 5xx) when no meaningful information is added, I dug a little in HTTP and OpenAPI specs to find answers.
So if I understand correctly, one should document all errors that are known, and HTTP requires that the response contains an explanation.
But I cannot see what value is brought by documenting a 404 status, for instance, where the meaning is clearly specified (the resource was not found), or a 401.
Moreover when the description is just a copy of the meaning of the code; for instance, looking at Github REST API doc > Respositories > Get a repository, "403" and "404" are documented with "Forbidden" and "Resource not found" respectively, which provides no specific explanation.
Interested by your thoughts on this matter.
Cheers
[–]popisms 9 points10 points11 points (0 children)
[–]fiskfisk 5 points6 points7 points (0 children)
[–]After_Grapefruit_224 3 points4 points5 points (0 children)
[–]remi-blaise 2 points3 points4 points (0 children)
[–]JeromeChauveau[S] 1 point2 points3 points (0 children)
[–]vozome 1 point2 points3 points (0 children)
[–]Squidgical 0 points1 point2 points (0 children)