kuzzleio / kuzzle

Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -
https://kuzzle.io
Apache License 2.0
1.44k stars 124 forks source link

Generate OpenAPI documentation for API action #1935

Closed Aschen closed 3 years ago

Aschen commented 3 years ago

Feature description

Allows to declare OpenAPI documentation for controller actions.

This documentation will be declared alongside the handler and http properties of an action:

app.controller.register('greeting', {
  actions: {
    sayHello: {
      handler: request => `Hello, ${request.input.args.name}`,
      // Open API documentation
      openApi: { ... } 
    }
  }
});

Then the complete API specification will be available to a new controller action (e.g. server:openApi)

Refactor

Existent native controller should be refactored to use the same controller definition as Kuzzle as a Framework so we can declare the open API specification

Aschen commented 3 years ago

Done