Skip to content

Commit

Permalink
add numberMatched/Returned properties in model
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Oct 10, 2024
1 parent 8ed4e8b commit 36c4389
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
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

0 comments on commit 36c4389

Please sign in to comment.