fecgov / fecfile-web-api

Back-end API for FECfile application
Other
8 stars 2 forks source link

Set up API rest endpoint online documentation #29

Closed lbeaufort closed 2 years ago

lbeaufort commented 2 years ago

Business Reason

The django-rest-swagger package is no longer supported, and is not compatible with Django 3.x. When we upgraded to Django 3.x, we broke the API documentation.

See https://fecfile-web-api-dev.app.cloud.gov/api/docs and https://github.com/marcgibbons/django-rest-swagger/issues/832 and https://github.com/marcgibbons/django-rest-swagger/issues/815

Task Install the drf-spectacular python package and configure for use in fecfile-web-api

As a developer, I will be able to get access to the fecfile REST API via my browser so that I can have access to documentation describing the REST endpoints

Acceptance Criteria

QA Notes

null

DEV Notes

null

Design

null

lbeaufort commented 2 years ago

I confirmed that the built-in API documentation that comes with Django REST framework (https://www.django-rest-framework.org/) doesn't have a user friendly built-in index of endpoints. Example index: https://restframework.herokuapp.com/ ("snippets" and "users" are the endpoints)

This tutorial demonstrates the difference between what comes out of the box for Django REST framework and what drf-spectaclar (https://drf-spectacular.readthedocs.io/en/latest/index.html) offers: https://rohitkrgupta.medium.com/swagger-with-django-made-easy-a-drf-spectacular-explainer-20b18bb4c33c

Here's what the docs look like on the UAT site: https://uat-fecfile-api.efdev.fec.gov/api/docs

WiseQA commented 2 years ago

Verified link https://fecfile-web-api-dev.app.cloud.gov/api/docs, that an UI is seen and lets me explore the fecfile API: image.png

QA review completed. Moved to Stage Ready.