SpaceyaTech / mastori

Mastori is a community-driven open-source project that aims to provide a simple and efficient blogging platform built for the Dev Community
https://www.spaceyatech.com/
22 stars 54 forks source link

✨: Added swagger for API documentation #149

Closed BlackHawk0 closed 1 year ago

BlackHawk0 commented 1 year ago

Description

Intergrated use of swagger and drf spectacular for API documentation. For an quick alternative to postman, swagger allows users to do all requests from the browser which is abit lightweight.

Dependecies

Fixes # (issue)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

CI Django & Postgres Tests

Jambo

Test Configuration:

          python manage.py migrate
          python manage.py test

Checklist:

BlackHawk0 commented 1 year ago

The /schema/docs/ path works perfectly. Details everything. However I am not sure whether the /schema/ path should return JSON or YAML. It seems to return a YAML config as indicated in the screenshot below. image

@BlackHawk0 @JimmyTron Please confirm on what the behavior should be.

That's the desired ouput when you hit the schema endpoint.

However, the swagger UI for all the API endpoints is at schema/docs/