moodle-webservice_restful icon indicating copy to clipboard operation
moodle-webservice_restful copied to clipboard

Beeing able to generate openapi documentation

Open p8nut opened this issue 8 months ago • 1 comments

First, What is OpenAPI?

The OpenAPI Specifications provides a formal standard for describing HTTP APIs.

Why could this be useful here ?

OpenAPI spécification enable developer to generate client library in their language see here this would be beneficial for all developers that want to use moodle (using the moodle-webservice_restful) because they could have a programmatically generated library tailored to their moodle instance. Also, OpenApi have nice dashboard which could make the life of developer easier

generated example moodle.openapi3_0.json editor with the generated example.

Why not directly in the moodle source code

In the Moodle Webservice api, the way to call one webservice is through a query param, in OpenAPI (version 3.X) the way to differentiate calls are by using different path like moodle-webservice_restful do. So it seem logical to add this feature in this plugin more than anywhere else.

Why not in an other plugin with a dependency to this plugin ?

I think that this solution could be implemented but would not give the same visibility to the OpenAPI feature that could be offered through an implementation in here.

Thanks for your time.

PS: a demo implementation have been made here #28

p8nut avatar Jun 06 '24 11:06 p8nut