camaraproject / Commonalities

Repository to describe, develop, document and test the common guidelines and assets for CAMARA APIs
Apache License 2.0
12 stars 28 forks source link

Inconsistent statements about 405 status code in API Guidelines and CAMARA_common.yaml #285

Open hdamker opened 2 months ago

hdamker commented 2 months ago

Problem description

405 error response is defined in CAMARA_common.yaml, but the API Design Guideline says in chapter 3.2. HTTP response codes:

This code is documented at the API portal level, it should not be documented at the API level.

I consider that as correct, as if a method is documented at API level it is obviously allowed and the method shouldn't return 405 on the resource.

But 405 is included in chapter 6.1 and CAMARA_common.yaml.

Expected behavior

Alternative solution

If there are valid use cases for a 405 reponse on a method which is defined in the API spec, they should be mentioned within the API Guidelines in chapter 6.1. The current response message is from my perspective not correct or can't be influenced by CAMARA.

Additional context

https://www.rfc-editor.org/rfc/rfc9110.html#name-status-codes:

15.5.6. 405 Method Not Allowed

The 405 (Method Not Allowed) status code indicates that the method received in the request-line is known by the origin server but not supported by the target resource. The origin server MUST generate an Allow header field in a 405 response containing a list of the target resource's currently supported methods.

PedroDiez commented 2 months ago

Think we can formally take actions in the next MetaRelease and for the current one MetaRelease just to ensure no one API has defined this error within the yaml

hdamker commented 2 months ago

Think we can formally take actions in the next MetaRelease and for the current one MetaRelease just to ensure no one API has defined this error within the yaml

There currently four APIs within the repositories which have defined the error response 405 within their YAML: