Skip to content

Commit

Permalink
add numberMatched/Returned properties in model (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago authored Oct 11, 2024
1 parent 8ed4e8b commit 3c4ce2e
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 3c4ce2e

Please sign in to comment.