Skip to content

Commit 6ec7814

Browse files
authored
OARec: add sensible default handling (#1116) (#1152)
1 parent 01b202e commit 6ec7814

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pycsw/ogc/api/oapi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ def gen_oapi(config, oapi_filepath, mode='ogcapi-records'):
388388
}
389389

390390
oapi['paths']['/collections/{collectionId}/queryables'] = path2
391+
oapi['components']['parameters']['collectionId']['default'] = 'metadata:main' # noqa
391392

392393
path = {
393394
'get': {

pycsw/ogc/api/records.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def items(self, headers_, json_post_data, args, collection='metadata:main'):
579579

580580
LOGGER.debug(f'Transformed args: {args}')
581581

582-
if 'filter' in args:
582+
if args.get('filter', {}):
583583
LOGGER.debug(f'CQL query specified {args["filter"]}')
584584
cql_query = args['filter']
585585
filter_lang = args.get('filter-lang')
@@ -856,7 +856,6 @@ def items(self, headers_, json_post_data, args, collection='metadata:main'):
856856
'rel': 'first',
857857
'title': 'items (first)',
858858
'href': f'{bind_url(url_)}',
859-
'href': url_,
860859
'hreflang': self.config['server']['language']
861860
})
862861

0 commit comments

Comments
 (0)