Skip to content

Conversation

@willowrimlinger
Copy link
Contributor

When adding async support for Flask-Parameter-Validation, the ValidateParameters decorator would always return an async coroutine, whether the Flask view function was async or not. This resulted in unexpected behavior when adding decorators that wrapped ValidateParameters as they may not have been expecting an async function that must be awaited.

To fix this, ValidateParameters now only returns an async coroutine to any decorators upstream if it recieved an async coroutine. Otherwise, it will return a function.

I've added a good few tests to make sure async and sync decorators are handled predictably across types and parameter types.

@Ge0rg3
Copy link
Owner

Ge0rg3 commented Feb 27, 2024

Nice find @maxwrimlinger and many thanks for the thorough PR! Will get this merged and released asap 🙌

@Ge0rg3 Ge0rg3 added the bug Something isn't working label Feb 27, 2024
@Ge0rg3 Ge0rg3 merged commit 7b99414 into Ge0rg3:master Feb 28, 2024
@Ge0rg3
Copy link
Owner

Ge0rg3 commented Feb 28, 2024

Just deployed this as a hotfix, current version is 2.3.1, thanks again 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants