Skip to content

Commit

Permalink
suggestion to improve geopython#581
Browse files Browse the repository at this point in the history
itemType as an array of types
  • Loading branch information
Paul committed Nov 28, 2020
1 parent 48d00d6 commit 7cec942
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pygeoapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ def describe_collections(self, headers_, format_, dataset=None):
self.config['server']['url'], k)
})

collection['itemType'] = []

if collection_data_type == 'feature':
collection['itemType'] = collection_data_type.capitalize()
collection['itemType'].append(collection_data_type.capitalize())
LOGGER.debug('Adding feature based links')
collection['links'].append({
'type': 'application/json',
Expand Down Expand Up @@ -451,6 +453,7 @@ def describe_collections(self, headers_, format_, dataset=None):
})

elif collection_data_type == 'coverage':
collection['itemType'].append(collection_data_type.capitalize())
LOGGER.debug('Adding coverage based links')
collection['links'].append({
'type': 'application/json',
Expand Down Expand Up @@ -536,6 +539,7 @@ def describe_collections(self, headers_, format_, dataset=None):

if tile:
LOGGER.debug('Adding tile links')
collection['itemType'].append("TILE")
collection['links'].append({
'type': 'application/json',
'rel': 'tiles',
Expand Down

0 comments on commit 7cec942

Please sign in to comment.