Skip to content

Commit 51c6a95

Browse files
authored
OARec: add autodiscovery link relation (#1908)
1 parent 29b507f commit 51c6a95

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

pygeoapi/api/__init__.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Colin Blackburn <colb@bgs.ac.uk>
88
# Ricardo Garcia Silva <ricardo.garcia.silva@geobeyond.it>
99
#
10-
# Copyright (c) 2024 Tom Kralidis
10+
# Copyright (c) 2025 Tom Kralidis
1111
# Copyright (c) 2022 Francesco Bartoli
1212
# Copyright (c) 2022 John A Stevenson and Colin Blackburn
1313
# Copyright (c) 2023 Ricardo Garcia Silva
@@ -1064,6 +1064,20 @@ def describe_collections(api: API, request: APIRequest,
10641064
'href': f'{api.get_collections_url()}/{k}?f={F_HTML}'
10651065
})
10661066

1067+
if collection_data_type == 'record':
1068+
collection['links'].append({
1069+
'type': FORMAT_TYPES[F_JSON],
1070+
'rel': 'http://www.opengis.net/def/rel/ogc/1.0/ogc-catalog',
1071+
'title': l10n.translate('Record catalogue as JSON', request.locale), # noqa
1072+
'href': f'{api.get_collections_url()}/{k}?f={F_JSON}'
1073+
})
1074+
collection['links'].append({
1075+
'type': FORMAT_TYPES[F_HTML],
1076+
'rel': 'http://www.opengis.net/def/rel/ogc/1.0/ogc-catalog',
1077+
'title': l10n.translate('Record catalogue as HTML', request.locale), # noqa
1078+
'href': f'{api.get_collections_url()}/{k}?f={F_HTML}'
1079+
})
1080+
10671081
if collection_data_type in ['feature', 'coverage', 'record']:
10681082
collection['links'].append({
10691083
'type': FORMAT_TYPES[F_JSON],

0 commit comments

Comments
 (0)