From 181cc79da77ad1a5165b3f8e8af9a4ad709d60c6 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Mon, 14 Oct 2024 15:47:35 +0200 Subject: [PATCH] update stac-version --- CHANGES.md | 4 ++++ stac_fastapi/api/stac_fastapi/api/app.py | 4 ++-- stac_fastapi/types/stac_fastapi/types/core.py | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1d613c7f..7ff0fe04 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ * Add `numberMatched` and `numberReturned` properties in `types.stac.ItemCollection` model * Add `numberMatched` and `numberReturned` properties in `types.stac.Collections` model +## Changed + +* use `stac_pydantic.version.STAC_VERSION` instead of `stac_pydantic.api.version.STAC_API_VERSION` as application `stac_version` + ## [3.0.3] - 2024-10-09 ### Removed diff --git a/stac_fastapi/api/stac_fastapi/api/app.py b/stac_fastapi/api/stac_fastapi/api/app.py index 5148f2ba..007dde95 100644 --- a/stac_fastapi/api/stac_fastapi/api/app.py +++ b/stac_fastapi/api/stac_fastapi/api/app.py @@ -10,8 +10,8 @@ from fastapi.params import Depends from stac_pydantic import api from stac_pydantic.api.collections import Collections -from stac_pydantic.api.version import STAC_API_VERSION from stac_pydantic.shared import MimeTypes +from stac_pydantic.version import STAC_VERSION from starlette.middleware import Middleware from starlette.responses import JSONResponse, Response @@ -93,7 +93,7 @@ class StacApi: lambda self: self.settings.stac_fastapi_version, takes_self=True ) ) - stac_version: str = attr.ib(default=STAC_API_VERSION) + stac_version: str = attr.ib(default=STAC_VERSION) description: str = attr.ib( default=attr.Factory( lambda self: self.settings.stac_fastapi_description, takes_self=True diff --git a/stac_fastapi/types/stac_fastapi/types/core.py b/stac_fastapi/types/stac_fastapi/types/core.py index 18381b7c..9f807d2c 100644 --- a/stac_fastapi/types/stac_fastapi/types/core.py +++ b/stac_fastapi/types/stac_fastapi/types/core.py @@ -8,9 +8,9 @@ from fastapi import Request from geojson_pydantic.geometries import Geometry from stac_pydantic import Collection, Item, ItemCollection -from stac_pydantic.api.version import STAC_API_VERSION from stac_pydantic.links import Relations from stac_pydantic.shared import BBox, MimeTypes +from stac_pydantic.version import STAC_VERSION from starlette.responses import Response from stac_fastapi.types import stac @@ -268,7 +268,7 @@ async def delete_collection( class LandingPageMixin(abc.ABC): """Create a STAC landing page (GET /).""" - stac_version: str = attr.ib(default=STAC_API_VERSION) + stac_version: str = attr.ib(default=STAC_VERSION) landing_page_id: str = attr.ib(default=api_settings.stac_fastapi_landing_id) title: str = attr.ib(default=api_settings.stac_fastapi_title) description: str = attr.ib(default=api_settings.stac_fastapi_description)