stac-fastapi icon indicating copy to clipboard operation
stac-fastapi copied to clipboard

Response Schema undefined and not represented in Swagger

Open martys opened this issue 3 years ago • 1 comments

This should display a sample result and specify the schema of the model being returned

image

martys avatar Oct 18 '22 11:10 martys

Pydantic response models are disabled by default, but may be enabled through the Settings object (https://github.com/stac-utils/stac-fastapi/blob/master/stac_fastapi/types/stac_fastapi/types/config.py#L27). They are disabled because pydantic validation on very large STAC returns (ex. ItemCollection) may take a very long time to run, slowing down API performance drastically.

Enabling response models will automatically generate return schemas, but at the cost of performance.

geospatial-jeff avatar Oct 18 '22 14:10 geospatial-jeff

Closing as not-an-issue, since response schemas may be generated.

gadomski avatar Jan 31 '23 15:01 gadomski

Pydantic response models are disabled by default, but may be enabled through the Settings object (https://github.com/stac-utils/stac-fastapi/blob/master/stac_fastapi/types/stac_fastapi/types/config.py#L27). They are disabled because pydantic validation on very large STAC returns (ex. ItemCollection) may take a very long time to run, slowing down API performance drastically.

Enabling response models will automatically generate return schemas but at the cost of performance.

@geospatial-jeff - could You please clarify how to enable that through settings exactly, as I fail to find any specific properties regarding it? (this might be due to my lack of experience with Python, that I can find my way around on my own)

martys avatar Oct 24 '23 13:10 martys