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/{collection_id}/items Token Pagination broken in 3.0.0b1, 3.0.0b2 #731

Closed
captaincoordinates opened this issue Jul 12, 2024 · 3 comments

Comments

@captaincoordinates
Copy link
Contributor

captaincoordinates commented Jul 12, 2024

Minimum repro case here.

AsyncBaseCoreClient#item_collection receives a None token in 3.0.0b1 and 3.0.0b2 when token is provided as a query string parameter. The minimum repro case asserts token is not None here when hitting /collections/collection_id/items?token=query-string-token-value. The test passes in 3.0.0a4 but fails in 3.0.0b1 or 3.0.0b2.

To test execute scripts/test.sh. The test hits the same endpoint across three different versions of stac-fastapi:

  • 3.0.0a4
  • 3.0.0b1
  • 3.0.0b2

I assume this is related to one or more of #714, #717, #718, #729.

@vincentsarago
Copy link
Member

vincentsarago commented Jul 12, 2024

thanks for opening the issue @captaincoordinates

For the /items endpoint you now need to set the GET model when constructing the StacApi object

# before
stac=StacApi(
    pagination_extension=TokenPaginationExtension,
    extension=[TokenPaginationExtension]
)

# now
items_get_request_model = create_request_model(
    "ItemCollectionURI",
    base_model=ItemCollectionUri,
    mixins=[TokenPaginationExtension().GET],
)

stac=StacApi(
    extension=[TokenPaginationExtension],
    items_get_request_model=items_get_request_model,
)

Sorry for introducing this breaking change quite late in the development but I promise this is the last one 😅

@captaincoordinates
Copy link
Contributor Author

That's great, thanks @vincentsarago. Sorry for missing the docs on this, I wasn't expecting to need them from alpha to beta.

@vincentsarago
Copy link
Member

@captaincoordinates yeah sorry about that, this changed came late into the dev phase, we decided to go from alpha to beta to raise awareness about change between versions but we could have make this better I guess

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

2 participants