Skip to content

BUGFIX: invalid landing page link when filter-extension is enabled #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions stac_fastapi/api/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def test_client_openapi(TestCoreClient):
assert component in test_app.app.openapi_schema["components"]["schemas"]


def test_filter_extension(TestCoreClient, item_dict):
@pytest.mark.parametrize("validate", [True, False])
def test_filter_extension(validate, TestCoreClient, item_dict):
"""Test if Filter Parameters are passed correctly."""

class FilterClient(TestCoreClient):
Expand Down Expand Up @@ -159,13 +160,15 @@ def get_search(
post_request_model = create_post_request_model([FilterExtension()])

test_app = app.StacApi(
settings=ApiSettings(),
settings=ApiSettings(enable_response_models=validate),
client=FilterClient(post_request_model=post_request_model),
search_get_request_model=create_get_request_model([FilterExtension()]),
search_post_request_model=post_request_model,
extensions=[FilterExtension()],
)

with TestClient(test_app.app) as client:
landing = client.get("/")
get_search = client.get(
"/search",
params={
Expand All @@ -184,5 +187,6 @@ def get_search(
},
)

assert landing.status_code == 200, landing.text
assert get_search.status_code == 200, get_search.text
assert post_search.status_code == 200, post_search.text
1 change: 0 additions & 1 deletion stac_fastapi/types/stac_fastapi/types/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ def landing_page(self, **kwargs) -> stac.LandingPage:
"type": MimeTypes.jsonschema.value,
"title": "Queryables",
"href": urljoin(base_url, "queryables"),
"method": "GET",
}
)

Expand Down