TobKra96 / music_led_strip_control

Audio visualization for LED strips in real-time with web interface on a raspberry pi.
https://tobkra96.github.io/music_led_strip_control/
MIT License
297 stars 64 forks source link

Define a swagger / openAPI docu #121

Closed TobKra96 closed 3 years ago

Teraskull commented 3 years ago

My implementation suggestion is to use Flasgger.

In webserver.py we initialize a Swagger instance from the flask app:

from flasgger import Swagger

Swagger(self.server)

And add a docstring to all API endpoint functions, like the followng example:

"""
Returns a dictionary of logging levels.
---
tags:
    - Settings
responses:
    200:
        description: OK
        schema:
            type: object,
            example:
                {
                    critical: str,
                    debug: str,
                    error: str,
                    info: str,
                    notset: str,
                    warning: str
                }
"""
TobKra96 commented 3 years ago

Hi,

I reviewed the new API docu. Nice job 👍 Here are some questions:

Have a great day, TobKra

TobKra96 commented 3 years ago

Done