Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨: Added swagger for API documentation #149

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

BlackHawk0
Copy link
Contributor

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

  • drf-spectacular
  • django-rest-swagger

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

How Has This Been Tested?

CI Django & Postgres Tests

Jambo

Test Configuration:

          python manage.py migrate
          python manage.py test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Contributor,👋👋 Thank You For Opening This Pull Request 🎉🎉

Welcome to SpaceYaTech

We are the fastest growing Africa Open-Source Community Looking To Change The Way Young Africans Get Started In Technology.

JOIN US | THRIVE | GROW

SpaceYaTech Server
SpaceYaTech LinkedIn
SpaceYaTech Twitter
Website

It's great having you contribute to this project

Welcome to the community 🤓 🍿 **Fun facts** - we eat bugs 🐛🐛🐛🐛 for breakfast 🥣

This Pull request has been queued for `review`

Sit tight the maintainers are on your case.

Soon the maintainers/owner will review it and provide you with feedback suggestions.
If you think it's something urgent, feel free to reach out

Copy link
Member

@JimmyTron JimmyTron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JimmyTron JimmyTron added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 13, 2023
Copy link
Collaborator

@collinskasyoki collinskasyoki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@BlackHawk0
Copy link
Contributor Author

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/

Copy link
Collaborator

@collinskasyoki collinskasyoki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Good.

@collinskasyoki collinskasyoki added this pull request to the merge queue Sep 13, 2023
Merged via the queue into SpaceyaTech:main with commit 0ba92b0 Sep 13, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants