geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
460 stars 250 forks source link

Error Generating OpenAPI document with EDR Provider #1617

Closed webb-ben closed 2 months ago

webb-ben commented 2 months ago

Description When I run pygeoapi configured for an EDR provider, the OpenAPI document fails to generate and errors out the creation of the server.

Steps to Reproduce Steps to reproduce the behavior: Run pygeoapi with just the EDR provider.

Expected behavior pygeoapi is able to generate the OpenAPI document even if there are no processes configured.

Screenshots/Tracebacks If applicable, add screenshots to help explain your problem.

2024-04-08 15:04:37 START /entrypoint.sh
2024-04-08 15:04:37 Trying to generate openapi.yml
2024-04-08 15:04:49 ERROR: openapi.yml could not be generated ERROR
2024-04-08 15:04:49 Traceback (most recent call last):
2024-04-08 15:04:49   File "/usr/local/bin/pygeoapi", line 33, in <module>
2024-04-08 15:04:49     sys.exit(load_entry_point('pygeoapi', 'console_scripts', 'pygeoapi')())
2024-04-08 15:04:49   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
2024-04-08 15:04:49     return self.main(*args, **kwargs)
2024-04-08 15:04:49   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
2024-04-08 15:04:49     rv = self.invoke(ctx)
2024-04-08 15:04:49   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
2024-04-08 15:04:49     return _process_result(sub_ctx.command.invoke(sub_ctx))
2024-04-08 15:04:49   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
2024-04-08 15:04:49     return _process_result(sub_ctx.command.invoke(sub_ctx))
2024-04-08 15:04:49   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
2024-04-08 15:04:49     return ctx.invoke(self.callback, **ctx.params)
2024-04-08 15:04:49   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
2024-04-08 15:04:49     return __callback(*args, **kwargs)
2024-04-08 15:04:49   File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 33, in new_func
2024-04-08 15:04:49     return f(get_current_context(), *args, **kwargs)
2024-04-08 15:04:49   File "/pygeoapi/pygeoapi/openapi.py", line 937, in generate
2024-04-08 15:04:49     content = generate_openapi_document(
2024-04-08 15:04:49   File "/pygeoapi/pygeoapi/openapi.py", line 888, in generate_openapi_document
2024-04-08 15:04:49     oas = get_oas(s, fail_on_invalid_collection=fail_on_invalid_collection)
2024-04-08 15:04:49   File "/pygeoapi/pygeoapi/openapi.py", line 838, in get_oas
2024-04-08 15:04:49     return get_oas_30(
2024-04-08 15:04:49   File "/pygeoapi/pygeoapi/openapi.py", line 457, in get_oas_30
2024-04-08 15:04:49     sub_tags, sub_paths = api_module.get_oas_30(cfg, locale_)
2024-04-08 15:04:49   File "/pygeoapi/pygeoapi/api/processes.py", line 696, in get_oas_30
2024-04-08 15:04:49     name_in_path,
2024-04-08 15:04:49 UnboundLocalError: local variable 'name_in_path' referenced before assignment

Environment

Additional context Add any other context about the problem here.

tomkralidis commented 2 months ago

Thanks @webb-ben!