Skip to content

fix(event_handler): fix OpenAPI schema response for disabled validation #6720

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

Merged
merged 1 commit into from
May 26, 2025

Conversation

leandrodamascena
Copy link
Contributor

Issue number: #6435

Summary

This PR fixes an issue where the OpenAPI schema incorrectly includes a 422 validation error response when validation is disabled. This ensures the API documentation accurately reflects the actual behavior of the application.

Additionally, I've ADDED noqa ruff PLR0912 because this method is critical and requires more than 16 branches, which is something we configure to keep the maintenance well.

Changes

  • Updated the schema generation to conditionally include the 422 response only when validation is enabled
  • Added a test case to verify this behavior

User experience

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

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 May 26, 2025 10:56
@leandrodamascena leandrodamascena self-assigned this May 26, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 26, 2025
@leandrodamascena leandrodamascena requested review from dreamorosi and removed request for anafalcao May 26, 2025 10:56
@github-actions github-actions bot added the bug Something isn't working label May 26, 2025
Copy link

Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.09%. Comparing base (da8b9e6) to head (7b25461).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6720   +/-   ##
========================================
  Coverage    96.09%   96.09%           
========================================
  Files          254      254           
  Lines        12177    12178    +1     
  Branches       904      905    +1     
========================================
+ Hits         11702    11703    +1     
  Misses         373      373           
  Partials       102      102           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena leandrodamascena requested review from anafalcao and removed request for dreamorosi May 26, 2025 12:16
@leandrodamascena leandrodamascena merged commit 818ad49 into develop May 26, 2025
20 checks passed
@leandrodamascena leandrodamascena deleted the fix/disable-validation branch May 26, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 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(openapi): 422 response added to operations when validation is off
2 participants