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

refactor(event-handler): Inject CSS and JS files into SwaggerUI route when no custom CDN is used. #3562

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

leandrodamascena
Copy link
Contributor

@leandrodamascena leandrodamascena commented Dec 26, 2023

Issue number: #3552

Summary

Changes

This pull request introduces the inclusion of SwaggerUI CSS and JS directly into HTML files when no custom CDN is utilized. This enhances the standalone functionality of the project, ensuring a seamless experience for users without additional HTTP requests. Also, we are removing the unnecessary sourceMappingURL configuration.

User experience

No changes in the use experience.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@leandrodamascena leandrodamascena requested a review from a team as a code owner December 26, 2023 16:20
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation event_handlers labels Dec 26, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 26, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (035cf88) 95.78% compared to head (73cd2a2) 95.78%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3562      +/-   ##
===========================================
- Coverage    95.78%   95.78%   -0.01%     
===========================================
  Files          210      210              
  Lines         9688     9684       -4     
  Branches      1775     1773       -2     
===========================================
- Hits          9280     9276       -4     
  Misses         294      294              
  Partials       114      114              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

rubenfonseca
rubenfonseca previously approved these changes Jan 9, 2024
@boring-cyborg boring-cyborg bot added the tests label Jan 9, 2024
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 9, 2024
@leandrodamascena leandrodamascena changed the title docs(event-handler): add section about problems when using SwaggerUI and cache refactor(event-handler): inject CSS and JS SwaggerUI into HTML files when not using custom CDN Jan 9, 2024
@leandrodamascena leandrodamascena changed the title refactor(event-handler): inject CSS and JS SwaggerUI into HTML files when not using custom CDN refactor(event-handler): add SwaggerUI CSS and JS into HTML files in the absence of a custom CDN Jan 9, 2024
Copy link
Contributor

@rubenfonseca rubenfonseca left a comment

Choose a reason for hiding this comment

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

I believe we also need to update the docs to remove the references to swagger.css and swagger.js?

@rubenfonseca rubenfonseca dismissed their stale review January 9, 2024 16:49

Wrong review

@rubenfonseca rubenfonseca self-requested a review January 9, 2024 16:50
rubenfonseca
rubenfonseca previously approved these changes Jan 9, 2024
@leandrodamascena
Copy link
Contributor Author

I believe we also need to update the docs to remove the references to swagger.css and swagger.js?

You're right, Ruben! There was some reference to /swagger.js and CSS.. I removed it completely.

@leandrodamascena leandrodamascena requested review from rubenfonseca and removed request for heitorlessa January 9, 2024 17:00
Copy link
Contributor

@rubenfonseca rubenfonseca left a comment

Choose a reason for hiding this comment

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

Sorry, just a small thing

docs/core/event_handler/api_gateway.md Outdated Show resolved Hide resolved
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@leandrodamascena leandrodamascena changed the title refactor(event-handler): add SwaggerUI CSS and JS into HTML files in the absence of a custom CDN refactor(event-handler): add SwaggerUI CSS and JS into HTML file in the absence of a custom CDN Jan 10, 2024
@leandrodamascena
Copy link
Contributor Author

Sorry, just a small thing

Ready to review.

@leandrodamascena leandrodamascena changed the title refactor(event-handler): add SwaggerUI CSS and JS into HTML file in the absence of a custom CDN refactor(event-handler): Inject SwaggerUI CSS and JS files into HTML when no custom CDN is used. Jan 10, 2024
@leandrodamascena leandrodamascena changed the title refactor(event-handler): Inject SwaggerUI CSS and JS files into HTML when no custom CDN is used. refactor(event-handler): Inject CSS and JS files into SwaggerUI route when no custom CDN is used. Jan 10, 2024
@leandrodamascena leandrodamascena merged commit 2acdcc4 into aws-powertools:develop Jan 10, 2024
19 checks passed
@leandrodamascena leandrodamascena deleted the openapi/doc branch January 10, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation event_handlers size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Swagger UI doesn't load : Loading... with Uncaught SyntaxError
3 participants