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

add numberMatched/Returned properties in model #759

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## [Unreleased]

### Removed

* Remove deprecated `context` property in `types.stac.ItemCollection` model

### Added

* Add `numberMatched` and `numberReturned` properties in `types.stac.ItemCollection` model

## [3.0.3] - 2024-10-09

### Removed
Expand Down
17 changes: 0 additions & 17 deletions docs/src/tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,6 @@ middlewares=[lambda app: CORSMiddleware(app, allow_origins=["*"])]

If needed, you can edit the `allow_origins` parameter to only allow CORS requests from specific origins.

## Enable the Context extension

!!! Warning

The `ContextExtension` is deprecated and will be removed in 3.0. See https://github.com/radiantearth/stac-api-spec/issues/396

The Context STAC extension provides information on the number of items matched and returned from a STAC search.
This is required by various other STAC-related tools, such as the pystac command-line client.
To enable the extension, edit your backend's `app.py` and add the following import:

```python
from stac_fastapi.extensions.core.context import ContextExtension
```


and then edit the `api = StacApi(...` call to add `ContextExtension()` to the list given as the `extensions` parameter.

## Set API title, description and version

For the landing page, you can set the API title, description and version using environment variables.
Expand Down
3 changes: 2 additions & 1 deletion stac_fastapi/types/stac_fastapi/types/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class ItemCollection(TypedDict, total=False):
type: Literal["FeatureCollection"]
features: List[Item]
links: List[Dict[str, Any]]
context: Optional[Dict[str, int]]
numberMatched: Optional[int]
numberReturned: Optional[int]


class Collections(TypedDict, total=False):
Expand Down