Skip to content

pgstac client can return null links #8

Open
@duckontheweb

Description

@duckontheweb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions