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

doc(swagger): add Swagger doc for all endpoints and reorganize routing #22

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

GMishx
Copy link
Member

@GMishx GMishx commented Dec 6, 2023

  1. Add swagger documentation to all the endpoints.
  2. Fix the status code of endpoints.
  3. Make minor changes in DB schema.

Note: Merge after #21

@GMishx GMishx requested a review from avinal December 6, 2023 12:08
@avinal
Copy link
Member

avinal commented Dec 6, 2023

Will review by this weekend.

Copy link
Member

@avinal avinal left a comment

Choose a reason for hiding this comment

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

Few comments, rest looks good to me.

pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
cmd/laas/main.go Outdated
"github.com/fossology/LicenseDb/pkg/api"
"github.com/fossology/LicenseDb/pkg/db"
"github.com/fossology/LicenseDb/pkg/models"
"log"
Copy link
Member

Choose a reason for hiding this comment

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

The log should be above only. The order is std libraries and then third-party libs. You may use goimports -l -e -w pkg cmd test to format and arrange the imports.

Copy link
Member

Choose a reason for hiding this comment

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

Afterthought: we may use a tool like golangci-lint in our CI to automatically run these checks. I can add a PR if we agree.

Copy link
Member Author

Choose a reason for hiding this comment

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

The formatting is currently done by my IDE. I think it will be a good idea if you create the CI workflow, I can update my IDE accordingly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hope new formatting looks good.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it is on point, I will add the static checks.

pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/utils/util.go Outdated Show resolved Hide resolved
@GMishx GMishx force-pushed the docs/api/swagger branch 2 times, most recently from c8ad292 to 9f7bd70 Compare December 11, 2023 10:19
Copy link
Member

@avinal avinal left a comment

Choose a reason for hiding this comment

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

Looks great to me. Awesome work 👏🏼

1. Add swagger documentation to all the endpoints.
2. Fix the status code of endpoints.
3. Make minor changes in DB schema.

Signed-off-by: Gaurav Mishra <[email protected]>
1. Check if the latest swagger docs are commited
   with the PR.
2. Check if the swagger docs are formatted.

Signed-off-by: Gaurav Mishra <[email protected]>
Copy link
Contributor

@ag4ums ag4ums left a comment

Choose a reason for hiding this comment

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

LGTM

@GMishx GMishx merged commit 0ea8010 into main Dec 12, 2023
4 checks passed
@GMishx GMishx deleted the docs/api/swagger branch December 12, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants