catalyst / moodle-webservice_restful

A REStful webservice plugin for Moodle LMS
GNU General Public License v3.0
36 stars 27 forks source link

Beeing able to generate openapi documentation #27

Open p8nut opened 5 months ago

p8nut commented 5 months ago

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 commented 1 month ago

Hello do you have any update on that?