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

Http 400 error on Item Search with SortBy specified #402

Closed
juliayun23 opened this issue Jan 15, 2024 · 5 comments · Fixed by #406
Closed

Http 400 error on Item Search with SortBy specified #402

juliayun23 opened this issue Jan 15, 2024 · 5 comments · Fixed by #406
Labels
bug Something isn't working
Milestone

Comments

@juliayun23
Copy link
Contributor

We are using stac-browser on top of stac-fastapi. Recently during testing, I noticed that when doing item search, if I specify an option (any option apart from Default) in "Sort" dropdown list, it returns 400

Screenshot 2024-01-12 at 2 39 58 pm

The response is:

{
    "code": "RequestValidationError",
    "description": "[{'loc': ('body', 'sortby'), 'msg': 'value is not a valid list', 'type': 'type_error.list'}]"
}
@juliayun23
Copy link
Contributor Author

juliayun23 commented Jan 15, 2024

It can be reproduced here: https://radiantearth.github.io/stac-browser/#/search/external/planetarycomputer.microsoft.com/api/stac/v1/

Happy to submit a PR if this is confirmed as a bug.

@m-mohr
Copy link
Collaborator

m-mohr commented Jan 25, 2024

Yes, this is a bug.

STAC Browser sends:
"sortby":"properties.title"

It should be:

    "sortby": [
        {
            "field": "properties.title",
            "direction": "asc"
        }
    ]

A PR would be very welcome.

@m-mohr m-mohr added the bug Something isn't working label Jan 25, 2024
@m-mohr m-mohr added this to the 3.1.1 milestone Jan 25, 2024
@juliayun23
Copy link
Contributor Author

Yes, this is a bug.

STAC Browser sends: "sortby":"properties.title"

It should be:

    "sortby": [
        {
            "field": "properties.title",
            "direction": "asc"
        }
    ]

A PR would be very welcome.

@m-mohr May I pls have write access to the repository to push my dev branch and create the PR? Thanks.

@m-mohr
Copy link
Collaborator

m-mohr commented Feb 5, 2024

You don't need write access to this repository. Please create a fork and submit the PR based on your fork.

juliayun23 added a commit to juliayun23/stac-browser that referenced this issue Feb 5, 2024
@juliayun23
Copy link
Contributor Author

@m-mohr Thanks. PR ready for your review #406.

m-mohr pushed a commit that referenced this issue Feb 6, 2024
@m-mohr m-mohr modified the milestones: 3.1.1, 3.2.0 Mar 7, 2024
silvester-pari pushed a commit to EOEPCA/open-science-catalog-stac-browser that referenced this issue May 29, 2024
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

Successfully merging a pull request may close this issue.

2 participants