Skip to content

Commit

Permalink
- updated the way we test if a key exists in resources
Browse files Browse the repository at this point in the history
  • Loading branch information
doublebyte1 committed Nov 22, 2024
1 parent e8acb18 commit 3f4fbd3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pygeoapi/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@

THISDIR = os.path.dirname(os.path.realpath(__file__))


def get_ogc_schemas_location(server_config: dict) -> str:
"""
Determine OGC schemas location
Expand Down Expand Up @@ -751,7 +750,7 @@ def get_post_resource(cfg: dict) -> dict:

collection = gen_collection_name()

if (len(cfg['resources']) < 1 or cfg['resources'].get('obs') is None):
if (len(cfg['resources']) < 1 or 'obs' not in cfg['resources'].keys()):
return ''

post = {collection: {}}
Expand All @@ -775,9 +774,9 @@ def get_put_resource(cfg: dict) -> dict:
:returns: dict of OpenAPI definition
"""

if (len(cfg['resources']) < 1 or cfg['resources']['obs'] is None):
if (len(cfg['resources']) < 1 or 'obs' not in cfg['resources'].keys()):
return ''

put = deepcopy(cfg['resources']['obs'])

if 'temporal' in put['extents'].keys():
Expand All @@ -798,7 +797,7 @@ def get_patch_resource(cfg: dict) -> dict:
:returns: dict of OpenAPI definition
"""

if (len(cfg['resources']) < 1 or cfg['resources']['obs'] is None):
if (len(cfg['resources']) < 1 or 'obs' not in cfg['resources'].keys()):
return ''

patch = deepcopy(cfg['resources']['obs'])
Expand Down

0 comments on commit 3f4fbd3

Please sign in to comment.