OWASP API8 2023 Define Error Responses 401 (Edit)
OWASP API Security recommends defining schemas for all responses, even errors. The 401 describes what happens when a request is unauthorized, so it is important to define this for documentation and contract testing.
OWASPSecurityResponsesAuthenticationOpenAPI