Project

General

Profile

Actions

Feature #24763

closed

Feature #40907: mgr/dashboard: REST API improvements

mgr/dashboard: Automatic generation of REST API documentation based on Python docstrings

Added by Ricardo Dias almost 6 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
General
Target version:
% Done:

100%

Source:
Tags:
dashboard, swagger, openAPI, python
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

In the current implementation of the Ceph-Dashboard we already generate a Swagger-UI page with the available REST API endpoints that are implemented in the dashboard backend. This generation is automatic and it's done when the dashboard module starts.

The REST API endpoints correspond to Python class methods decorated with `@Endpoint`, and, in the special case of the REST controllers, correspond to the following class methods: `list`, `create`, `get`, `set`, `delete`, `bulk_set`, `bulk_delete`.

The objective of this feature is to parse the docstrings of the endpoint methods and add these to the Swagger-UI page to document each endpoint.
We could also agree on a particular python docstring format to allow the specification of the parameters types and return types and add also add that information to the Swagger-UI page.


Related issues 1 (0 open1 closed)

Related to Dashboard - Bug #40027: mgr/dashboard: REST API: OpenAPI docs require internet connectionClosedPatrick Seidensal

Actions
Actions #1

Updated by Lenz Grimmer almost 6 years ago

  • Assignee deleted (Lenz Grimmer)
Actions #2

Updated by Lenz Grimmer over 5 years ago

  • Assignee set to Tina Kallio
  • Target version set to v14.0.0
Actions #3

Updated by Tina Kallio over 5 years ago

There is no suitable off-the-shelf parser that can be used to accomplish this.

Another way to obtain information for the documentation directly from the code is to use annotations and decorators. This approach will be used instead.

However, function annotations can not be used since it is not compatible with Python2.

It is desirable but not mandatory that the solution includes responses.

Actions #5

Updated by Lenz Grimmer about 5 years ago

  • Pull request ID set to 26227
Actions #6

Updated by Lenz Grimmer about 5 years ago

  • Status changed from New to Fix Under Review
Actions #7

Updated by Lenz Grimmer about 5 years ago

  • Subject changed from dashboard: Automatic generation of REST API documentation based on Python docstrings to mgr/dashboard: Automatic generation of REST API documentation based on Python docstrings
Actions #8

Updated by Tina Kallio about 5 years ago

  • Status changed from Fix Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Lenz Grimmer almost 5 years ago

  • Related to Bug #40027: mgr/dashboard: REST API: OpenAPI docs require internet connection added
Actions #10

Updated by Alfonso Martínez over 3 years ago

  • Parent task set to #40907
Actions #11

Updated by Ernesto Puerta about 3 years ago

  • Project changed from mgr to Dashboard
  • Category changed from 132 to General
Actions

Also available in: Atom PDF