geopython / geopython/pygeoapi

Alignment on implementation of config, openapi, and asyncapi

Open
#2,377 2 comments 0 reactions 1 assignee Claimed by @tomkralidis View on GitHub
enhancement OpenAPI question
Dominant language
Python
Stars
624
Forks
326
Avg merge
8h 25m
Merged PRs (30d)
2

Description

**Description**
The pygeoapi implementation for `pygeoapi.config`, `pygeoapi.openapi`, and `pygeoapi.asyncapi` seem to be closely implemented with confusing differences.

**Steps to Reproduce**
n/a

**Expected behavior**
That these modules would have clear and unified implementation logic that is consistent across the utilities. That functions are re-used instead re-defined. That functions share naming conventions and behavior patterns.

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

**Environment**
- OS: All
- Python version: 3.12
- pygeoapi version: 0.24.dev0

**Additional context**
- `pygeoapi.openapi` and `pygeoapi.asyncapi` define the function validate_openapi_document and validate_asyncapi_document respectively. `pygeoapi.config` names this function validate_config
- `pygeoapi.openapi` and `pygeoapi.asyncapi` define the function load_openapi_document and load_asyncapi_document respectively. `pygeoapi.config` names this function get_config
- None of the CLI utilities use the environment variables even though they are required to run pygeoapi.
- The openapi and async api doc are tied to `.yaml` and will not write a file to `.yml`
- `pygeoapi.config` implements the function get_config_schema. `pygeoapi.openapi` implements the function get_config_schema but does not implement the function get_openapi_schema (which is bundled inside the validate function). `pygeoapi.asyncapi` does not implement any publicd function to get the schema similar to openapi, but retrieves the document using os instead of the SCHEMASDIR path object.
- `pygeoapi.openapi` and `pygeoapi.asyncapi` implement the CLI utility to generate the document from the pygeoapi configuration. Both of these require setting the CLI args for --output-file (see env variable) and --format (which must align but is not validated against the output file type)
- CLI implementations do not properly register options as required
- None of these run tests against the expected CLI behavior

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.