Closed alexandreleroux closed 5 years ago
Thanks @alexandreleroux. API HTML output is probably best realized by a Swagger UI. The problem is how to integrate this in the install. Any ideas @pvgenuchten / @justb4?
Another option is to have a configuration to point to an external Swagger UI like:
server:
swagger-ui: http://petstore.swagger.io/?url=
Which an API HTML handler would 301 to https://petstore.swagger.io/?url=https://geo.weather.gc.ca/geomet/features/api
Isn't this functionality what is also provided by Flasgger and https://github.com/gangverk/flask-swagger ?
@justb4 I think flasgger and Flask-swagger are bound to classes in Python? pygeoapi is not setup that way. We have an offline workflow which generates the OpenAPI Description. The value here is that we are able to scan each dataset configured in pygeoapi and report attributes as OpenAPI parameters.
ok, I see, also came bit later into the API/Swagger//PyGeoAPI game. From what I learned an external Swagger UI is "the thing"? That was probably a reason that Flask-Swagger forked from Flassger, so different approach.
But ok, so we need an external Swagger-UI? Maybe a Swagger-UI instance on a PyGeoAPI server/domain as discussed? Or we could dynamically generate annotated Flask .py Views from the configured datasets but that may be far-fetched...
There is no python library (or webservice) which generates an api-documentation-page from an openapi-specification-document? For me it makes most sense to have the interactive-api-documentation at api?f=html and not on some external location. But as a start a forward rule to https://petstore.swagger.io/?url=https://geo.weather.gc.ca/geomet/features/api would give a same experience.
Implemented in #101.
As discussed with @tomkralidis , html formatting is correctly provided for the features page
/features/?f=html
, however, the OpenAPI definition/features/api?f=html
generates a response in JSON, not html.This is true at least for the following public pygeoapi implementation: