Closed aperrin66 closed 3 years ago
you define that
StrictFilterSet
class and use it in order to receive error messageInvalid lookups found:
in your API responses. DO you use it in the downstream in some other place? or just for unifying and standardizing the error output of API you do that?
Without this StrictFilterSet
class, there is no error when there an invalid lookup in the request. Instead, the whole list of objects is returned unfiltered, which can be very confusing.
As for the usage of this class, all filtersets defined in filters.py inherit from it.
Previously, you have mentioned that StrictFilterSet
class is needed. But now you have removed that StrictFilterSet
class! What would happen if a bad api request comes in? unfiltered objects are returned in the reply?
Previously, you have mentioned that
StrictFilterSet
class is needed. But now you have removed thatStrictFilterSet
class! What would happen if a bad api request comes in? unfiltered objects are returned in the reply?
It is not strictly needed, it's just less confusing for the user to receive an error instead of unfiltered data.
Unfortunately, the StrictFilterSet
interferes with query arguments which are not lookups, so it is not usable.
Upgrade the filters by enabling Django style lookups.
For example, it is now possible to use the following request to find datasets from the VIIRS instrument:
GET <api_root>/datasets/?source__instrument__short_name=VIIRS
See the modified README for more details.
The previous version of the API is kept in the
v1
folder for now. It is not supposed to be modified, and won't be included in the CI unit tests. If needed, tests on the v1 can be run locally by using thev1/runtest.py
script.