Add OAuth config and rework URL config - #25
Merged
Conversation
This is simpler and more robust. The regexp solution, for instance, served up 'index.html' if you ask for 'index.htmlnotreally'. The early 404 if the regexp doesn't match is not necessary - the swaggerFiles handler will return 404 if the filename doesn't match any swaggerUI content. Setting the prefix on the handler is also not necessary, as we are already passing in the filename, so the prefix doesn't need to be stripped.
This makes it more clear that this config option should only be set if the Swagger spec document is not expected to be hosted by this middleware but instead by an external website or service. It also fixes the link to the JSON document under the base path on the Swagger UI. Also set the swaggerFiles handler prefix again, as this is required.
Codecov Report
@@ Coverage Diff @@
## master #25 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 75 78 +3
=========================================
+ Hits 75 78 +3
Continue to review full report at Codecov.
|
Contributor
|
@drewsilcock, Would you mind fixing the conflicts so we can go forward with it. |
|
When will this branch be merge into master? |
drewsilcock
force-pushed
the
add-oauth-config
branch
2 times, most recently
from
May 30, 2022 10:01
e5ac771 to
1f4b3dd
Compare
drewsilcock
force-pushed
the
add-oauth-config
branch
from
May 30, 2022 10:01
1f4b3dd to
3acf681
Compare
Contributor
Author
|
Hi @ubogdan thanks for your patience, I've resolved the merge conflicts now. |
Contributor
|
@drewsilcock Thanks for your contribution. |
putnap
pushed a commit
to putnap/http-swagger
that referenced
this pull request
Nov 29, 2024
Adding 0Auth config values based on this PR from echo-swagger: swaggo/echo-swagger#25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for configuring the Swagger UI OAuth2 integration, as per docs here: https://swagger.io/docs/open-source-tools/swagger-ui/usage/oauth2/.
This also slightly reworks the Swagger specification JSON document location configuration. The default value is
nilinstead ofdoc.json(this is to make it more clear what the configuration parameter is for and to make it work with the additional field in the config). This fixes the link to the Swagger spec when the path is local on the Swagger UI page (just below the "Base Path").