diff --git a/CHANGES.md b/CHANGES.md index f043635c..2cda0a75 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +* Fixed warnings.warn deprecation syntax for response class and the context extension ([#660](https://github.com/stac-utils/stac-fastapi/pull/660)) + ## [2.5.0] - 2024-04-12 ### Added diff --git a/stac_fastapi/api/stac_fastapi/api/routes.py b/stac_fastapi/api/stac_fastapi/api/routes.py index 66b76d2d..df4a136e 100644 --- a/stac_fastapi/api/stac_fastapi/api/routes.py +++ b/stac_fastapi/api/stac_fastapi/api/routes.py @@ -45,7 +45,7 @@ def create_async_endpoint( """ if response_class: - warnings.warns( + warnings.warn( "`response_class` option is deprecated, please set the Response class directly in the endpoint.", # noqa: E501 DeprecationWarning, ) diff --git a/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py b/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py index b6539487..4037ba93 100644 --- a/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py +++ b/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py @@ -28,7 +28,7 @@ class ContextExtension(ApiExtension): def __attrs_post_init__(self): """init.""" - warnings.warm( + warnings.warn( "The ContextExtension is deprecated and will be removed in 3.0.", DeprecationWarning, stacklevel=1,