Skip to content

Client.get_items has surprising recursive behaviour when using the /search endpoint #798

@mishaschwartz

Description

@mishaschwartz

The Client.get_items function may get items using the /search endpoint if the server conforms to the ITEM_SEARCH conformance class.

If it does so, the search is always recursive (looks for items in sub-catalogs and sub-collections) even if the recursive=False argument is passed.

I would expect that it would make a non-recursive search instead and only return items that are the immediate child of the current catalog.

Note that the spec recommends that items have a collection as a parent (not a catalog) but catalog parents of items are supported:

Additionally, some APIs require that the collections argument be used when using the /search endpoint. This means that this

search = self.search(ids=ids)

will always raise an APIError for these APIs. This is notably the case for the STAC API at https://planetarycomputer.microsoft.com/api/stac/v1/ which is used in the tests for pystac-client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions