Hi,
I'm going to use 200, 400, 401, 403, 404 and 500 status codes only and regard all the rest as error because they are not expected. If some new status code like 409 should be added, I think the version of API I'm writing should be incremented for that or with some new endpoints.
Here the problem is 2xx e.g. 201 is an error according to API I'm writing because it is unexpected but is not an error according to HTTP status codes, but the API is built on HTTP for sure.
I'm inclined to regard it as an error because API server is not supposed to return such codes but would like to hear your opinions. Is it safe to regard all the unexpected status codes error or is too ideal?
Thanks,
-- Donghwan