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

GET /search with bbox and intersects returned status code 200 #463

Closed
philvarner opened this issue Sep 26, 2022 · 3 comments
Closed

GET /search with bbox and intersects returned status code 200 #463

philvarner opened this issue Sep 26, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@philvarner
Copy link
Collaborator

Per the Item Search spec, /search called with a bbox and intersects should return a 400. When running against Planetary Computer, this returns a 200.

@gadomski gadomski self-assigned this Jan 31, 2023
@gadomski gadomski added the bug Something isn't working label Jan 31, 2023
@gadomski gadomski added this to the 2.4.4 milestone Jan 31, 2023
@gadomski
Copy link
Member

gadomski commented Feb 1, 2023

@philvarner I think this is fixed, can you confirm from your end? Here's how I checked:

$ curl -i --json @query.json https://planetarycomputer.microsoft.com/api/stac/v1/search
HTTP/2 400 
content-length: 124
content-type: text/plain; charset=utf-8
strict-transport-security: max-age=15724800; includeSubDomains
access-control-allow-origin: *
access-control-allow-credentials: true
x-cache: CONFIG_NOCACHE
x-azure-ref: 0UNLaYwAAAADvTHj17Z8kSZvAjSBV+G7DV1NURURHRTA4MTUAOTI3YWJmYTYtMTlmNi00YWYxLWEwOWQtYzk1OWQ5YTFlNjQ0
date: Wed, 01 Feb 2023 20:57:52 GMT

1 validation error for Request
body -> intersects
  intersects and bbox parameters are mutually exclusive (type=value_error)

query.json:

{
    "bbox": [
        -180,
        -90,
        180,
        90
    ],
    "intersects": {
        "type": "Point",
        "coordinates": [
            -105.1019,
            40.1672
        ]
    },
    "limit": 1,
    "collections": [
        "aster-l1t"
    ]
}

@philvarner
Copy link
Collaborator Author

Looks good, that's the expected 400. One other issue that should be filed is that the response to that should be a JSON object matching this https://github.com/radiantearth/stac-api-spec/blob/main/core/commons.yaml#L15 rather than plaintext

@gadomski
Copy link
Member

gadomski commented Feb 2, 2023

With latest main of stac-fastapi, the response is a JSON object:

$ curl -si --json @query.json http://localhost:8080/search
HTTP/1.1 400 Bad Request
date: Thu, 02 Feb 2023 14:32:46 GMT
server: uvicorn
content-length: 176
content-type: application/json

{"code":"RequestValidationError","description":"1 validation error for Request\nbody -> intersects\n  intersects and bbox parameters are mutually exclusive (type=value_error)"}

The Planetary Computer API is pinned to 25879af of this repo, which also has the correct JSON response. It looks like the PC is opting to return plain text responses, so I've opened an issue over there to capture: microsoft/planetary-computer-apis#151. Closing this one as complete.

@gadomski gadomski closed this as completed Feb 2, 2023
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

2 participants