mik-laj commented on a change in pull request #9431:
URL: https://github.com/apache/airflow/pull/9431#discussion_r444272559
##########
File path: airflow/api_connexion/parameters.py
##########
@@ -48,6 +46,21 @@ def format_datetime(value: str):
)
+def check_limit(value: int):
+ """
+ This checks the limit passed to view and raises BadRequest if
+ limit exceed user configured value
+ """
+ max_val = conf.getint("api", "maximum_page_limit")
+
+ if value > max_val:
Review comment:
```
Request messages for collections should define an int32 page_size field,
allowing users to specify the maximum number of results to return.
If the user does not specify page_size (or specifies 0), the API chooses an
appropriate default, which the API should document.
If the user specifies page_size greater than the maximum permitted by the
API, the API should coerce down to the maximum permitted page size.
If the user specifies a negative value for page_size, the API must send an
INVALID_ARGUMENT error.
The API may return fewer results than the number requested (including zero
results), even if not at the end of the collection.
```
https://google.aip.dev/158
I looked more closely at how it implements Google. What do you think? In my
opinion this makes sense and it is behavior that is close to the previous one.
Coerce down to the maximum permitted page size allows us to fetching the
maximum number of items without checking the current application configuration.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]