Skip to content

Commit e27318f

Browse files
authored
Respected linkrel from provider (geopython#1868)
1 parent a0867d0 commit e27318f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pygeoapi/api/itemtypes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,12 @@ def get_collection_items(
509509
serialized_query_params += '='
510510
serialized_query_params += urllib.parse.quote(str(v), safe=',')
511511

512+
if 'links' not in content:
513+
content['links'] = []
514+
512515
# TODO: translate titles
513516
uri = f'{api.get_collections_url()}/{dataset}/items'
514-
content['links'] = [{
517+
content['links'].extend([{
515518
'type': 'application/geo+json',
516519
'rel': request.get_linkrel(F_JSON),
517520
'title': l10n.translate('This document as GeoJSON', request.locale),
@@ -526,7 +529,7 @@ def get_collection_items(
526529
'rel': request.get_linkrel(F_HTML),
527530
'title': l10n.translate('This document as HTML', request.locale),
528531
'href': f'{uri}?f={F_HTML}{serialized_query_params}'
529-
}]
532+
}])
530533

531534
if offset > 0:
532535
prev = max(0, offset - limit)

0 commit comments

Comments
 (0)