Skip to content
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

Request to /collection/<missing>/items returns 200 #7

Open
duckontheweb opened this issue Aug 6, 2022 · 0 comments
Open

Request to /collection/<missing>/items returns 200 #7

duckontheweb opened this issue Aug 6, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@duckontheweb
Copy link
Contributor

Ported from stac-utils/stac-fastapi#120.

Original Issue:

If I make a request to an endpoint for a collection that doesn't exists, I get a 404

In [14]: import requests

In [19]: r = requests.get("https://pct-pqe-staging.westeurope.cloudapp.azure.com/stac/v1/collections/not-a-collection")

In [20]: r.status_code
Out[20]: 404

But if I make a request to that collection's /items I get a 200, and the response includes an empty FeatureCollection.

In [21]: r = requests.get("https://pct-pqe-staging.westeurope.cloudapp.azure.com/stac/v1/collections/not-a-collection/items")

In [22]: r.status_code
Out[22]: 200

In [23]: r.json()
Out[23]:
{'type': 'FeatureCollection',
 'features': [],
 'links': [],
 'context': {'returned': 0, 'matched': 0}}

I wanted to verify that this is the expected behavior. I didn't find anything in the API spec, but I admittedly didn't look too closely.

Reported in TomAugspurger/stac-dask-discussion#1

@duckontheweb duckontheweb added the bug Something isn't working label Aug 6, 2022
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

No branches or pull requests

1 participant