Skip to content

Open API / XML RPC: set Content-Type for schema and add status to responses

Titouan Soulard requested to merge tsoulard/erp5:for-mr-pig into master

These are small improvements that I made while playing with the new SlapOS API:

  1. harmonize OpenAPI and XML RPC so that they both return a status code in the response body on error;
  2. set proper Content-Type when method viewOpenAPIAsJson is called from the browser;
  3. dump OpenAPI hyperschema with indent=2 so the raw file is easier to read (like done in XML RPC).

There is still one test to be fixed because I thought that the method getContentType existed on WSGIResponse, but apparently I will have to use getHeader instead. Anyway, it is already possible to collect feedback if any. Will merge next week if no concern is raised.

/cc @jerome @romain

Merge request reports