-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Move inline css and js to external files for SwaggerUI and ReDoc #2965
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
Move inline css and js to external files for SwaggerUI and ReDoc #2965
Conversation
src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj
Outdated
Show resolved
Hide resolved
test/Swashbuckle.AspNetCore.IntegrationTests/ReDocIntegrationTests.cs
Outdated
Show resolved
Hide resolved
test/Swashbuckle.AspNetCore.IntegrationTests/ReDocIntegrationTests.cs
Outdated
Show resolved
Hide resolved
test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerUIIntegrationTests.cs
Outdated
Show resolved
Hide resolved
test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerUIIntegrationTests.cs
Outdated
Show resolved
Hide resolved
src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj
Outdated
Show resolved
Hide resolved
- Add/improve unit tests - Define charset when serving js files - Tidy up code
src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Martin Costello <[email protected]>
|
||
// Apply mandatory parameters | ||
configObject.dom_id = "#swagger-ui"; | ||
configObject.presets = [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset]; |
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.
The default config file also sets plugins: [SwaggerUIBundle.plugins.DownloadUrl]
. I don't know what that does, but maybe it should be set here too?
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 suggest we leave it as is, particularly if we don't know why it isn't there already.
|
||
// Apply mandatory parameters | ||
configObject.dom_id = "#swagger-ui"; | ||
configObject.presets = [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset]; |
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 suggest we leave it as is, particularly if we don't know why it isn't there already.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2965 +/- ##
==========================================
+ Coverage 90.34% 90.44% +0.10%
==========================================
Files 72 74 +2
Lines 2839 2869 +30
Branches 446 452 +6
==========================================
+ Hits 2565 2595 +30
Misses 274 274
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Martin Costello <[email protected]>
Pull Request
The issue or feature being addressed
Resolves #2881.
Details on the issue fix or feature implementation
Moved inline javascript to separate files
ReDoc: Moved inline CSS to separate file
SwaggerUi: Reused CSS file from the package
Middleware changes to respond with corresponding files