From 3490b5e18dd1cfb85481ea05841b809573e9c5af Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Wed, 20 Jul 2022 13:11:18 -0400 Subject: [PATCH] [WIP] preserve predefined links for item responses (#941) * preserve predefined links for item responses * Update api.py --- pygeoapi/api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pygeoapi/api.py b/pygeoapi/api.py index 196c24e..d5cc391 100644 --- a/pygeoapi/api.py +++ b/pygeoapi/api.py @@ -1912,7 +1912,10 @@ class API: '{}/{}/items/{}'.format( self.get_collections_url(), dataset, identifier) - content['links'] = [{ + if 'links' not in content: + content['links'] = [] + + content['links'].extend([{ 'rel': request.get_linkrel(F_JSON), 'type': 'application/geo+json', 'title': 'This document as GeoJSON', @@ -1934,7 +1937,7 @@ class API: request.locale), 'href': '{}/{}'.format( self.get_collections_url(), dataset) - }] + }]) if 'prev' in content: content['links'].append({