-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
adding swagger documentation #332
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR!
However it is really important that you read and follow the contributions guidelines.
Also please do not delete the PR template. You should compile it. Otherwise your contributions won't be considered. Everything you need to know is written there.
We need to make this autogenerate for every commit same way as readthedocs and host them publicly like: https://intelowl.readthedocs.io/api-docs. How can we achieve that, @spiderxm? |
We can use the command
This will generate open api definitions in yaml. |
Okay so what we need to do is create a GH action (or readthedocs webhook) which builds the The catch here is that this action should take place before readthedocs build gets triggered for which you should find something in readthedocs documentation. |
api_app/urls.py
Outdated
@@ -33,3 +56,4 @@ | |||
# Viewsets | |||
path(r"", include(router.urls)), | |||
] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix codefactor issue
api_app/urls.py
Outdated
# Routers provide an easy way of automatically determining the URL conf. | ||
router = routers.DefaultRouter(trailing_slash=False) | ||
router.register(r"tags", TagViewSet) | ||
router.register(r"jobs", JobViewSet) | ||
|
||
# Documentation Settings | ||
schema_view = get_schema_view( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of adding this here, we should add a new file called schemas.py
and add all this docs related code there.
Will look into it |
Added Swagger and Redoc documentation for rest apis.