-
Notifications
You must be signed in to change notification settings - Fork 57
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 Endpoint #451
base: main
Are you sure you want to change the base?
Adding Swagger Endpoint #451
Conversation
…Kumarage/spdx-online-tools into Swagger-API-Documentation
@@ -2,6 +2,7 @@ Django==3.2.18 | |||
jpype1==1.3.0 | |||
numpy==1.22.0 | |||
djangorestframework==3.12.2 | |||
drf-yasg==1.21.5 |
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.
I think we were not able to generate the required swagger specs using this last time in #104. Can you please have a look at what all is generated right now and is in the correct shape. Post a screenshot of the swagger specs generated as well.
Or I would suggest to dig into other libraries which can do the same.
Just an idea - If we have swagger specs generated in some yaml format, we can host it in github pages/wiki/io website.
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.
Currently, the swagger endpoint can be accessed with all the API endpoints in the api/swagger
endpoint. I'm working on generating the yaml. So far it's working with the endpoint. Will generate the yaml and update the PR. If the issue raises, I will try another library.
@rtgdk needs clarification. Why does the API documentation need to be hosted on GitHub pages? With this implementation, we can access the documentation with the endpoint.
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.
@BanulaKumarage Yeah hosting swagger specs directly where the site is hosted is fine.
I remember seeing this when we did the last implementation of drf-yasg, we saw some issues with the generation of documentation for fields in the api.
Can you check if every api has defined doc for every field? The actual documentation is currently hosted here - https://github.com/spdx/spdx-online-tools/wiki/REST-API-Fields-Request-and-Response - but is hard to find and also hard to track and update. Integrating directly into the website as a separate page looks perfect.
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.
@BanulaKumarage Also, looks like some extra apis are generated as well. We should limit ourselves to api related only
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.
@BanulaKumarage Yeah hosting swagger specs directly where the site is hosted is fine. I remember seeing this when we did the last implementation of drf-yasg, we saw some issues with the generation of documentation for fields in the api. Can you check if every api has defined doc for every field? The actual documentation is currently hosted here - https://github.com/spdx/spdx-online-tools/wiki/REST-API-Fields-Request-and-Response - but is hard to find and also hard to track and update. Integrating directly into the website as a separate page looks perfect.
Hi @rtgdk I made this as an initial step I will check every field. And update you regarding this
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.
@BanulaKumarage Also, looks like some extra apis are generated as well. We should limit ourselves to api related only
@rtgdk is it the auth apis? which are the extra ones? There should be a way to avoid those. I will try to make it clean.
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.
@BanulaKumarage Yes, auth apis and api2
seems weird. Can you confirm if these are even needed for swagger specs?
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.
@rtgdk parameters are available in api2 but not in API endpoints. I have tried multiple libraries but I got the same output. I am trying to figure out a way of resolving this.
@rtgdk I have added a swagger point and it contains all the API endpoints as the first step of #91. Need suggestions.