Skip to content

Commit 5025db3

Browse files
PB-1677: Advertise /search as geo+json
Just having it as `application/json` prevents the STAC Browser from making use of the search functionality. The STAC Browser only shows: > Item Search is not supported by this API And indeed, the STAC specs require the Media Type `application/geo+json` for [the /search link relation](https://github.com/radiantearth/stac-api-spec/blob/release/v1.0.0/item-search/README.md?plain=1#L62). This isn't visible on the deployed STAC Browser because on the deploy branch `geoadmin_master` there is a fix (`preprocessSTAC`) for this that replaces the `application/json` with `application/geo+json` on the browser side, see [this commit](geoadmin/stac-browser@dae6a0e). There is a branch `fix_PB-1550_remove_obsolete_preconditioning_hook` where this was removed again (see [this commit](geoadmin/stac-browser@30e708a)) but it was never merged. The browser-side fix, however, is not there on the `main` branch that I used for local testing. So I noticed that the link relation for /search is wrong and thus propose the fix here. It will anyway be probably be nessary for when we use an up-to-date version of the STAC Browser, see PB-2381. Ideally we would get rid of the `preprocessSTAC` in the old STAC browser but we can also just throw it away in the course of updating to the new browser. As I understand it, `preprocessSTAC` will work no matter what media type it gets.
1 parent cb88411 commit 5025db3

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/stac_api/serializers/general.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ def to_representation(self, instance):
110110
("href", get_url(request, 'search-list')),
111111
("rel", "search"),
112112
("method", "GET"),
113-
("type", "application/json"),
113+
("type", "application/geo+json"),
114114
("title", "Search across feature collections"),
115115
]),
116116
OrderedDict([
117117
("href", get_url(request, 'search-list')),
118118
("rel", "search"),
119119
("method", "POST"),
120-
("type", "application/json"),
120+
("type", "application/geo+json"),
121121
("title", "Search across feature collections"),
122122
]),
123123
]

spec/components/responses.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ components:
194194
title: Information about the feature collections
195195
- href: http://data.geo.admin.ch/api/stac/v1/search
196196
rel: search
197-
type: application/json
197+
type: application/geo+json
198198
title: Search across feature collections
199199
- href: http://data.geo.admin.ch/api/stac/v1/sortables
200200
rel: http://www.opengis.net/def/rel/ogc/1.0/sortables

spec/static/spec/v1/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ components:
292292
title: Information about the feature collections
293293
- href: http://data.geo.admin.ch/api/stac/v1/search
294294
rel: search
295-
type: application/json
295+
type: application/geo+json
296296
title: Search across feature collections
297297
- href: http://data.geo.admin.ch/api/stac/v1/sortables
298298
rel: http://www.opengis.net/def/rel/ogc/1.0/sortables

spec/static/spec/v1/openapitransactional.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ components:
328328
title: Information about the feature collections
329329
- href: http://data.geo.admin.ch/api/stac/v1/search
330330
rel: search
331-
type: application/json
331+
type: application/geo+json
332332
title: Search across feature collections
333333
- href: http://data.geo.admin.ch/api/stac/v1/sortables
334334
rel: http://www.opengis.net/def/rel/ogc/1.0/sortables

0 commit comments

Comments
 (0)