-
Notifications
You must be signed in to change notification settings - Fork 31
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
Update swagger-ui and bundle it directly #95
Update swagger-ui and bundle it directly #95
Conversation
Warning Rate limit exceeded@uvulpos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 20 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe recent updates introduce Swagger and Swagger UI setup instructions for a Go project, explaining the installation of Swag, generating documentation, and configuring the Swagger UI. Additionally, they modify existing code to embed Swagger UI files into the Go application. These changes enhance the ability to document and visualize APIs within the application. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
Outside diff range and nitpick comments (6)
README.md (6)
15-15
: Change 'by using' to 'to'.The preposition ‘to’ seems more likely in this position.
- go get -u github.com/swaggo/swag/cmd/swag + go get -u github.com/swaggo/swag/cmd/swag # 1.16 or newer - go install github.com/swaggo/swag/cmd/swag@latest + go install github.com/swaggo/swag/cmd/swag@latest
34-34
: Add 'the' before 'following'.You might be missing the article “the” here.
- And import following in your code: + And import the following in your code:Tools
LanguageTool
[uncategorized] ~34-~34: You might be missing the article “the” here.
Context: ...hub.com/gofiber/swaggerAnd import following in your code:
go import "github.com...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
86-86
: Replace hard tab with spaces.Hard tabs are used here; replace them with spaces for consistency.
- _ "github.com/gofiber/swagger/example/docs" + _ "github.com/gofiber/swagger/example/docs"
87-87
: Avoid bare URLs in Markdown.Use Markdown syntax for links instead of bare URLs.
- Run it, and browser to http://localhost:8080/swagger, you can see Swagger 2.0 Api documents. + Run it, and browse to [http://localhost:8080/swagger](http://localhost:8080/swagger), you can see Swagger 2.0 API documents.Tools
Markdownlint
87-87: null
Bare URL used(MD034, no-bare-urls)
89-89
: Remove trailing punctuation in heading.Trailing punctuation in the heading should be removed.
- ### Version Note: + ### Version NoteTools
Markdownlint
89-89: Punctuation: ':'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
91-91
: Fix typo and improve readability.There is a typo in 'specifications' and the format can be improved for readability.
- Swagger-UI currently runs on version 5.0.0 and supports OpenAPI sepcifications from + Swagger-UI currently runs on version 5.0.0 and supports OpenAPI specifications from:
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (20)
dist/favicon-16x16.png
is excluded by!**/dist/**
,!**/*.png
,!dist/**
,!**/*.png
dist/favicon-32x32.png
is excluded by!**/dist/**
,!**/*.png
,!dist/**
,!**/*.png
dist/index.css
is excluded by!**/dist/**
,!dist/**
dist/index.html
is excluded by!**/dist/**
,!dist/**
dist/oauth2-redirect.html
is excluded by!**/dist/**
,!dist/**
dist/swagger-initializer.js
is excluded by!**/dist/**
,!dist/**
dist/swagger-ui-bundle.js
is excluded by!**/dist/**
,!dist/**
dist/swagger-ui-bundle.js.map
is excluded by!**/dist/**
,!**/*.map
,!dist/**
,!**/*.map
dist/swagger-ui-es-bundle-core.js
is excluded by!**/dist/**
,!dist/**
dist/swagger-ui-es-bundle-core.js.map
is excluded by!**/dist/**
,!**/*.map
,!dist/**
,!**/*.map
dist/swagger-ui-es-bundle.js
is excluded by!**/dist/**
,!dist/**
dist/swagger-ui-es-bundle.js.map
is excluded by!**/dist/**
,!**/*.map
,!dist/**
,!**/*.map
dist/swagger-ui-standalone-preset.js
is excluded by!**/dist/**
,!dist/**
dist/swagger-ui-standalone-preset.js.map
is excluded by!**/dist/**
,!**/*.map
,!dist/**
,!**/*.map
dist/swagger-ui.css
is excluded by!**/dist/**
,!dist/**
dist/swagger-ui.css.map
is excluded by!**/dist/**
,!**/*.map
,!dist/**
,!**/*.map
dist/swagger-ui.js
is excluded by!**/dist/**
,!dist/**
dist/swagger-ui.js.map
is excluded by!**/dist/**
,!**/*.map
,!dist/**
,!**/*.map
go.mod
is excluded by!**/*.mod
go.sum
is excluded by!**/*.sum
,!**/*.sum
Files selected for processing (3)
- README.md (2 hunks)
- files.go (1 hunks)
- swagger.go (2 hunks)
Additional context used
LanguageTool
README.md
[uncategorized] ~14-~14: The preposition ‘to’ seems more likely in this position.
Context: ... Swag for Go by using: ```sh go get -u github.co...(AI_HYDRA_LEO_REPLACE_FOR_TO)
[uncategorized] ~34-~34: You might be missing the article “the” here.
Context: ...hub.com/gofiber/swaggerAnd import following in your code:
go import "github.com...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
Markdownlint
README.md
83-83: Column: 1
Hard tabs(MD010, no-hard-tabs)
89-89: Punctuation: ':'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
87-87: null
Bare URL used(MD034, no-bare-urls)
Additional comments not posted (2)
files.go (1)
1-1
: LGTM!The package declaration and imports look correct and appropriate for embedding files.
swagger.go (1)
Line range hint
1-1
:
LGTM!The package declaration, imports, and constants look correct. The
New
function has been updated to use the embedded Swagger files.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@uvulpos The dependency is not unmaintained, probably worth doing a PR there instead of merging all this code here. |
@gaby I made a ping comment to the abandoned pr to merge a newer version see here. Also there was just one feature pr merged last year And also by merging it to our own code, we could solve the google font api request. Should be fine in most countries, but in europe this could be an issue. There were incidents where companies and individual website hosts got fined for requesting google fonts before asking because of the GDPR. This way it would be more safety regarding legal issues |
Since swaggo/files updated their repo, this is obsolet |
The upstream dependency https://github.com/swaggo/files seems unmaintained so I decided to bundle it directly into this gofiber packages so people can use newer versions of swagger.
Origin repo uses a submodule for this, I'm not too familiar with submodules and to automate this process, but this could be a good enhancement to run this periodically via github actions.
I ran the tests command but please test it yourself again please!
fixes #91
fixes #51
Summary by CodeRabbit
Documentation
New Features
Refactor
SwaggerFileSystem
.