geopython / GeoHealthCheck

Service Status and QoS Checker for OGC Web Services
https://geohealthcheck.org
MIT License
84 stars 71 forks source link

WFS3 Probes (OAPIF) - use correct media types to get OpenAPI doc from landing page #304

Closed justb4 closed 4 years ago

justb4 commented 4 years ago

Describe the bug The WFS3Drilldown Probe currently assumes that the URL to the JSON-format OpenAPI doc from the landing page is the first link element that has rel: service-desc. This is not correct in two ways:

To Reproduce Steps to reproduce the behavior, e.g.:

  1. Register a Resource with multiple rel: service-desc links e.g. http://ows.geo-solutions.it/geoserver/ogc/features/?f=application%2Fjson
  2. Run any WFS3 Probe e.g. with OpenAPI Validation
  3. See error

Expected Behavior According to http://docs.opengeospatial.org/is/17-069r3/17-069r3.html#mediatypes "The media type for an OpenAPI 3.0 definition is vnd.oai.openapi+json;version=3.0 (JSON) or . application/vnd.oai.openapi;version=3.0 (YAML)."

So the Probes need to search for vnd.oai.openapi+json;version=3.0 type to get JSON OpenAPI description.

Screenshots or Logfiles NA

Context (please complete the following information):

If running with Docker: N.A.

Additional context This really should be implemented in the OWSLib WFS3 client which has a function to return api(). There the ultimate implementation should be. Probably searching for any of the two media types (JSON or YAML). An OWSLib issue 630 has been opened for this.

justb4 commented 4 years ago

Closing, as fixed within PR #333 : OAFeat GHC Probes now all use HTTP Content negotiation via Accept: application/json Request Header.