developmentseed/tipg

When Defining TIPG_MAX_FEATURES_PER_QUERY, the features limit is "less than" not "less than or equal to"

Closed this issue · 1 comments

aemonm commented

It seems like the limit should be enforced as "less than or equal to" and not "less than"

For example, TIPG_MAX_FEATURES_PER_QUERY=50000 and a request of collections/public.slick_plus/items?limit=50000, returns the error: { "detail": [ { "loc": [ "query", "limit" ], "msg": "ensure this value is less than 50000", "type": "value_error.number.not_lt", "ctx": { "limit_value": 50000 } } ] }
Possibly limit check is defined here:

lt=features_settings.max_features_per_query,

And this comment makes me think it should be treated as lte and not lt.

f"Limit can not be set higher than the `tipg_max_features_per_query` setting of {features_settings.max_features_per_query}"

👍

The spec says:

If the server has any more results available than it returns (the number it returns is less than or equal to the requested/default/maximum limit) then the server will include a link to the next set of results.

so yes it should be le