Open APIs

 View Only
  • 1.  Http Response Code 422

    Posted Oct 16, 2018 08:19

    I have recently submitted a request to the jaxrs-api Java API (see Pull Request #680) to include the HTTP response codes in RFC 4918. The reason being, the TM Forum Open API's make use of a 422 response code in the published swagger definitions.

    I've not checked all of the TM Forum Open APIs to see how wide spread this is, but it is certainly is use in at least one API (Service Qualification API).

    However, I'm not sure if my request will be approved, as it could be easily be argued that the TM Forum's use of 422 should be considered misuse, as it does not relate to WebDAV in this instance. I will continue to argue our case though, as the definition of 422 is ambiguous, and could be used in non-WebDAV related use cases:

    11.2. 422 Unprocessable Entity

    The 422 (Unprocessable Entity) status code means the server
    understands the content type of the request entity (hence a
    415(Unsupported Media Type) status code is inappropriate), and the
    syntax of the request entity is correct (thus a 400 (Bad Request)
    status code is inappropriate) but was unable to process the contained
    instructions. For example, this error condition may occur if an XML
    request body contains well-formed (i.e., syntactically correct), but
    semantically erroneous, XML instructions.

    So, is this something that should be stated in the TM Forum OpenAPI Design Guidelines, that only http response codes from RFC 2616 and its successors? Currently it is explicitly stated that 422 should be used, along with 429, which is also not recognized by RFC 2616.

    Or, do we continue to argue that 422 and 429 are applicable response codes for use cases beyond WebDAV? In which case, I think we should push for an RFC amendment to include 422 & 429 in a successor to RFC 2616.



    ------------------------------
    Lee Walton
    KCOM Group PLC
    ------------------------------