Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import attr
from fastapi import APIRouter, FastAPI
from starlette.responses import Response
from starlette.responses import JSONResponse, Response
from stac_pydantic.api.collections import Collections

from stac_fastapi.api.models import JSONSchemaResponse
Expand Down Expand Up @@ -67,8 +67,7 @@ class CollectionSearchExtension(ApiExtension):
]
)
router: APIRouter = attr.ib(factory=APIRouter)
response_class: Type[Response] = attr.ib(default=JSONSchemaResponse)

response_class: Type[Response] = attr.ib(default=JSONResponse)

def register(self, app: FastAPI) -> None:
"""Register the extension with a FastAPI application.
Expand All @@ -83,7 +82,7 @@ def register(self, app: FastAPI) -> None:
self.router.add_api_route(
name="Collection Search",
path="/collection-search",
response_model=Collections,
response_model=None,
response_class=self.response_class,
response_model_exclude_unset=True,
response_model_exclude_none=True,
Expand All @@ -96,7 +95,7 @@ def register(self, app: FastAPI) -> None:
self.router.add_api_route(
name="Collection Search",
path="/collection-search",
response_model=Collections,
response_model=None,
response_class=self.response_class,
response_model_exclude_unset=True,
response_model_exclude_none=True,
Expand Down