Improve Swagger with examples in POST operations #182
Labels
code improvements
Improvements to make the code base more readable and manageable.
documentation
Improvements or additions to the documentation.
Description
The Swagger interface of REMReM publish should have proper examples of JSON structures in the POST requests. Right now these endpoints have a big blob of irrelevant JSON which does not help the user prepare a body for the HTTP request. I want to replace the default JSON blob with the correct JSON body.
This could be achieved for example by defining JSON schemas to show how the JSON object should look like and what fields are required/optional etc. I did a quick google search and found it is possible to define JSON schemas using Swagger, https://swagger.io/docs/specification/describing-request-body/
Motivation
Easier to start playing around with the REST API of REMReM publish.
Exemplification
Currently we have:
But I would like a proper example of accurate JSON which could immediately be copied and used. So the yellow box would contain an example value which is actually useful.
Benefits
More useful Swagger description of the interface.
Possible Drawbacks
None that I can think of.
The text was updated successfully, but these errors were encountered: