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

pgstac client can return null links #8

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

pgstac client can return null links #8

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#167.

Original Issue:

The logic in stac_fastapi.pgstac.models.links.BaseLinks.get_links uses some implicit naming to gather link via subclass naming conventions. However, if link_* methods return (which the PaginationLinks.link_next or link_prev can despite their type declarations), this can end up with None in this link and therefore null in the eventual response.

Fix is to filter for Nones in the linked method.

I think there's not enough logic in these models to warrant a implicit method-naming trick like this, and took me a good bit of time to track down the cause of this, so I'd also recommend a refactor that uses a more straightforward approach.

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