Skip to content

Conversation

@vincentsarago
Copy link
Member

@vincentsarago vincentsarago commented Oct 15, 2024

closes #761

This PR adds a stac_api_version attribute in the stac.LandingPage model, returned by / endpoint.

This is not in the specification, in fact it's not clear to me what is in the specification for the landing page response!

{
  "type": "Catalog",
  "id": "stac-fastapi",
  "title": "stac-fastapi",
  "description": "stac-fastapi",
  "stac_version": "1.0.0",
  "stac_api_version": "1.0.0",
  "conformsTo": [
    ...
  ],
  "links": [
    ...
  ],
  "stac_extensions": []
}

The pydantic model from stac-pydantic, allows extra attribute so this addition should not break any thing, and I don't think we need to add this in the model as well. It will be specific to stac-fastapi applications

@jonhealy1
Copy link
Collaborator

Should there be a field(s) that can be set to say like 'stac-fastapi-pgstac' and version '3.0.0' or something to specify the backend type/version?

@m-mohr
Copy link
Contributor

m-mohr commented Oct 15, 2024

This is a misunderstanding, I never intended to have a separate property. You can parse the STAC API Version from the conformance classes, so we don't need a separate property. I was more thinking that it might be useful to make stac-fastapi more configurable towards supporting multiple versions and that users may want to choose which they want to host.

@vincentsarago
Copy link
Member Author

Should there be a field(s) that can be set to say like 'stac-fastapi-pgstac' and version '3.0.0' or something to specify the backend type/version?

@jonhealy1, there is already

stac_fastapi_title: str = "stac-fastapi"
stac_fastapi_description: str = "stac-fastapi"
stac_fastapi_version: str = "0.1"
stac_fastapi_landing_id: str = "stac-fastapi"

which is then used in openAPI

openapi_schema = get_openapi(
title=self.title,
version=self.api_version,
description=self.description,
routes=self.app.routes,
servers=self.app.servers,
)

@vincentsarago
Copy link
Member Author

This is a misunderstanding, I never intended to have a separate property. You can parse the STAC API Version from the conformance classes, so we don't need a separate property. I was more thinking that it might be useful to make stac-fastapi more configurable towards supporting multiple versions and that users may want to choose which they want to host.

@m-mohr ah!

well stac_version should be set anyway to reflect the stac spec version so #762 was 👍

I was more thinking that it might be useful to make stac-fastapi more configurable towards supporting multiple versions and that users may want to choose which they want to host.

I'm not even sure what supporting multiple versions means to you. Items retrieved from backend can be of multiple version, but stac-fastapi application is designed with models (stac-pydantic) which are for a specific version, which gets advertised with stac_version in the landing page

@vincentsarago
Copy link
Member Author

I feel we don't really need this then!

If the stac-api change and add this property we will add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add STAC_API_VERSION in landing page

4 participants