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

Closed
lossyrob opened this issue Jul 2, 2021 · 1 comment
Closed

pgstac client can return null links #167

lossyrob opened this issue Jul 2, 2021 · 1 comment
Labels

Comments

@lossyrob
Copy link
Member

lossyrob commented Jul 2, 2021

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.

@duckontheweb
Copy link
Contributor

This issue is being tracked by stac-utils/stac-fastapi-pgstac#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants