Skip to content

Alignment on implementation of config, openapi, and asyncapi #2377

Description

@webb-ben

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

Metadata

Metadata

Assignees

Labels

OpenAPIOpenAPIenhancementNew feature or requestquestionFurther information is requested

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions