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

/collections route returns array #108

Closed
jisantuc opened this issue Mar 18, 2021 · 1 comment
Closed

/collections route returns array #108

jisantuc opened this issue Mar 18, 2021 · 1 comment

Comments

@jisantuc
Copy link

The /collections route according to the API spec returns an object with collections and links keys --

The deployed version of the API that I saw this on was based on this branch so I don't know if this is also true on master. If not I won't be offended by a quick close.

@lossyrob
Copy link
Member

This was fixed, but a regression that was introduced in a recent refactor.

The response model for the collections endpoint is Collections, which is the correct format; however, all_collections on the backends and the base class (

def all_collections(self, **kwargs) -> List[stac_types.Collection]:
) return a list of TypeDict Collection objects.

This should instead construct a stac-pydantic Collections object or a TypedDict with the appropriate entries, and return with the appropriate links (see the PC endpoint for reference)

This could either be solved by changing the all_collections signature and modifying the backend core clients, or translating the list of collections at the API level so that all backends use the same logic to construct the Collections response

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

No branches or pull requests

3 participants