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

fix(event_handler): escape OpenAPI schema on Swagger UI #3606

Merged
merged 3 commits into from Jan 9, 2024

Conversation

rubenfonseca
Copy link
Contributor

Issue number: #3599

Summary

Changes

Please provide a summary of what's being changed

Certain characters in the OpenAPI schema where breaking the Swagger UI.

Example:

@app.get("/todos/{todo_id}", description="Gets a Todo by `todo_id`")
def todo(todo_id: int):
  ...

User experience

Please share what the user experience looks like before and after this change

After this change, we escape the JSON generated before injecting it into the page.

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.

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 9, 2024
@rubenfonseca rubenfonseca linked an issue Jan 9, 2024 that may be closed by this pull request
1 task
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (083468d) 95.78% compared to head (978325f) 95.78%.
Report is 5 commits behind head on develop.

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

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3606   +/-   ##
========================================
  Coverage    95.78%   95.78%           
========================================
  Files          210      210           
  Lines         9683     9686    +3     
  Branches      1774     1774           
========================================
+ Hits          9275     9278    +3     
  Misses         294      294           
  Partials       114      114           

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

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 9, 2024
@rubenfonseca rubenfonseca marked this pull request as ready for review January 9, 2024 12:55
@rubenfonseca rubenfonseca requested a review from a team as a code owner January 9, 2024 12:55
Copy link

sonarcloud bot commented Jan 9, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Nice work @rubenfonseca!!! APPROVED!

@leandrodamascena leandrodamascena merged commit e34f719 into develop Jan 9, 2024
16 checks passed
@leandrodamascena leandrodamascena deleted the rf/fix-spec-injection branch January 9, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_handlers size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Swagger UI is breaking with certain characters
3 participants