diff --git a/pygeoapi/api.py b/pygeoapi/api.py index fbd0fb2..ae3af61 100644 --- a/pygeoapi/api.py +++ b/pygeoapi/api.py @@ -330,20 +330,21 @@ class API(object): fcm['collections'].append(collection) - fcm['links'].append({ - 'type': 'application/json', - 'rel': 'self', - 'title': 'This document as JSON', - 'href': '{}/collections?f=json'.format( - self.config['server']['url']) - }) - fcm['links'].append({ - 'type': 'text/html', - 'rel': 'alternate', - 'title': 'This document as HTML', - 'href': '{}/collections?f=html'.format( - self.config['server']['url']) - }) + if dataset is None: + fcm['links'].append({ + 'type': 'application/json', + 'rel': 'self', + 'title': 'This document as JSON', + 'href': '{}/collections?f=json'.format( + self.config['server']['url']) + }) + fcm['links'].append({ + 'type': 'text/html', + 'rel': 'alternate', + 'title': 'This document as HTML', + 'href': '{}/collections?f=html'.format( + self.config['server']['url']) + }) if format_ == 'html': # render fcm['links'][0]['rel'] = 'alternate' diff --git a/tests/test_api.py b/tests/test_api.py index a5cd36f..7f72f5e 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -166,7 +166,7 @@ def test_describe_collections(config, api_): assert collection['name'] == 'obs' assert collection['title'] == 'Observations' assert collection['description'] == 'Observations' - assert len(collection['links']) == 8 + assert len(collection['links']) == 6 rsp_headers, code, response = api_.describe_collections( req_headers, {'f': 'html'}, 'obs')