openipam / django-openipam

Django refactor of openipam foo
5 stars 14 forks source link

Auto-generated API Documentation #129

Open rmedlyn opened 4 years ago

rmedlyn commented 4 years ago

WIP on APIDocs-Swagger branch.

Swagger is a specification for API Documentation.

This uses drf-yasg to generate documentation for all api endpoints based on a docstring placed after the class declaration of the view in the following format.

class Test(APIView):
    """
        Description of what the endpoint does

        * All required and optional arguments, query parameters and filters in the form `param` -- Description of param
        * Can be a list or part of a list

For Example:
        **Required Query Parameters:**
        * ONE of the following:
            * `registered_ip` -- IP address registered to an address
            * `ip_address` -- Either a registered IP or a leased IP
    """
    pass
rmedlyn commented 4 years ago

At the very minimum, the comments on API views in this branch would be nice to have.