-
Notifications
You must be signed in to change notification settings - Fork 441
fix(event_handler): split OpenAPI validation to respect middleware returns #7050
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7050 +/- ##
===========================================
+ Coverage 96.26% 96.33% +0.07%
===========================================
Files 275 275
Lines 12917 12921 +4
Branches 955 953 -2
===========================================
+ Hits 12435 12448 +13
+ Misses 376 367 -9
Partials 106 106 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hey @m-walmsley! I'd love to have your review and opinion here. |
Sure - but that's not the real me (need to remove that one - it was for internal Accenture projects) |
Yes, sorry for that! It was the autocomplete. Thanks. |
@walmsles and I met today to discuss this change and the impact it may have on customers who already use Middleware and Data Validation. I'd like to highlight a few points for clarity: 1/ Customers who use Middleware but do not use Data Validation will not be impacted. 2/ Customers who use Data Validation but do not use Middleware will not be impacted. 3/ Customers who use Middleware + Data Validation but do not use early return with Middleware will not be impacted. 4/ Customers who use Middleware + Data Validation + Early Return and use the exception handler to intercept We're also looking to the future, and it makes sense for customers to have full control over the execution of the middleware stack. So, I'll open an issue to expose |
|
Issue number: #5228
Discussion: #4656
Summary
Fixes middleware validation issues by splitting OpenAPI validation into separate request and response validation middlewares.
Changes
New Middleware Architecture
Split the
OpenAPIValidationMiddleware
into two separate middlewares:OpenAPIRequestValidationMiddleware
- Validates incoming requests onlyOpenAPIResponseValidationMiddleware
- Validates outgoing responses onlyExecution Order
User experience
Breaking change consideration
RequestValidationError
exceptions from middleware responses. However, this was unintended behavior that needed to be corrected.Why this change is necessary:
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
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.