-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Enable AppFramework dispatcher to enforce integer ranges #41578
Enable AppFramework dispatcher to enforce integer ranges #41578
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works. Fancy stuff ✨
Need to rebuild openapi with |
This comment was marked as resolved.
This comment was marked as resolved.
|
@provokateurin yeah or no? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I thought this was solved already. I opened an issue in openapi-extractor to handle the @psalm-*
annotations and there is another one already for supporting these integer ranges. So at some point this will also properly show up in the openapi docs :)
(Although I think it is debatable if 30 is a good limit since it is still quite high 🤷♀️) |
And 0 as lower limit is also not useful, maybe set it to at least 1 |
Checked by with @st3iny, he also thinks 30 is a good value. Either way, the numbers are mostly gut estimations, if necessary we can always tune them. The 0 I increase to 1. |
- allows devs to provide int ranges for API arguments Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
c0f519e
to
4827fc3
Compare
/backport to stable28 |
Summary
Psalm allows to specify an int range for integer parameters. We can consider them in the Http Dispatcher so that incoming int values are checked for their range directly in the app framework. Example use case for dashboard added.
Set 28 as milestone, but could go into 29 only.
Checklist