Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance route #53

Open
13 of 17 tasks
fmigneault opened this issue Nov 14, 2019 · 0 comments
Open
13 of 17 tasks

Conformance route #53

fmigneault opened this issue Nov 14, 2019 · 0 comments
Assignees
Labels
ci/doc Issue related to documentation of the package triage/conformance Issue related to fixing/ensuring compliance to specifications. WIP Work in progress

Comments

@fmigneault
Copy link
Collaborator

fmigneault commented Nov 14, 2019

Conformance route should be implemented to link standards that the application conforms to and/or supports.

GET /conformance

see example:
https://github.com/opengeospatial/oapi_common/blob/master/standard/examples/conformance_response_JSON_1.adoc

Also update docs reference links to return (old pdf ref seem to be missing) :

Following is done for now:

def api_frontpage_body(settings):
# type: (SettingsType) -> JSON
"""Generates the JSON body describing the Weaver API and documentation references."""
# import here to avoid circular import errors
from weaver.config import get_weaver_configuration
from weaver.wps import get_wps_url
weaver_url = get_weaver_url(settings)
weaver_config = get_weaver_configuration(settings)
weaver_api = asbool(settings.get("weaver.wps_restapi"))
weaver_api_url = get_wps_restapi_base_url(settings) if weaver_api else None
weaver_api_def = weaver_api_url + sd.api_swagger_ui_service.path if weaver_api else None
weaver_api_spec = weaver_api_url + sd.api_swagger_json_service.path if weaver_api else None
weaver_wps = asbool(settings.get("weaver.wps"))
weaver_wps_url = get_wps_url(settings) if weaver_wps else None
weaver_conform_url = weaver_url + sd.api_conformance_service.path
weaver_process_url = weaver_url + sd.processes_service.path
weaver_links = [
{"href": weaver_url, "rel": "self", "type": CONTENT_TYPE_APP_JSON, "title": "This document"},
{"href": weaver_conform_url, "rel": "conformance", "type": CONTENT_TYPE_APP_JSON,
"title": "WPS conformance classes implemented by this service."},
]
if weaver_api:
weaver_links.extend([
{"href": weaver_api_url,
"rel": "service", "type": CONTENT_TYPE_APP_JSON,
"title": "WPS REST API endpoint of this service."},
{"href": weaver_api_def,
"rel": "swagger", "type": CONTENT_TYPE_TEXT_HTML,
"title": "WPS REST API definition of this service."},
{"href": weaver_api_spec,
"rel": "OpenAPI", "type": CONTENT_TYPE_APP_JSON,
"title": "WPS REST API specification of this service."},
{"href": "https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/develop/docs/18-062.pdf",
"rel": "documentation", "type": CONTENT_TYPE_APP_PDF,
"title": "API documentation about this service."},
{"href": "https://app.swaggerhub.com/apis/geoprocessing/WPS/",
"rel": "wps-rest-swagger", "type": CONTENT_TYPE_TEXT_HTML,
"title": "API reference specification of this service."},
{"href": weaver_process_url,
"rel": "processes", "type": CONTENT_TYPE_APP_JSON,
"title": "Processes offered by this service."}
])
if weaver_wps:
weaver_links.extend([
{"href": weaver_wps,
"rel": "wps", "type": CONTENT_TYPE_APP_XML,
"title": "WPS 1.0.0/2.0 XML endpoint of this service."},
{"href": "http://docs.opengeospatial.org/is/14-065/14-065.html",
"rel": "wps-xml-specification", "type": CONTENT_TYPE_TEXT_HTML,
"title": "WPS 1.0.0/2.0 definition of this service."},
{"href": "http://schemas.opengis.net/wps/",
"rel": "wps-xml-schema", "type": CONTENT_TYPE_APP_XML,
"title": "WPS 1.0.0/2.0 XML validation schemas."}
])
return {
"message": "Weaver Information",
"configuration": weaver_config,
"parameters": [
{"name": "api", "enabled": weaver_api,
"url": weaver_api_url,
"api": weaver_api_def},
{"name": "wps", "enabled": weaver_wps,
"url": weaver_wps_url},
],
"links": weaver_links,
}
@sd.api_versions_service.get(tags=[sd.TAG_API], renderer=OUTPUT_FORMAT_JSON,
schema=sd.VersionsEndpoint(), response_schemas=sd.get_api_versions_responses)
def api_versions(request): # noqa: F811
# type: (Request) -> HTTPException
"""Weaver versions information."""
weaver_info = {"name": "weaver", "version": __meta__.__version__, "type": "api"}
return HTTPOk(json={"versions": [weaver_info]})
@sd.api_conformance_service.get(tags=[sd.TAG_API], renderer=OUTPUT_FORMAT_JSON,
schema=sd.ConformanceEndpoint(), response_schemas=sd.get_api_conformance_responses)
def api_conformance(request): # noqa: F811
# type: (Request) -> HTTPException
"""Weaver specification conformance information."""
# TODO: follow updates with https://github.com/geopython/pygeoapi/issues/198
conformance = {"conformsTo": [
# "http://www.opengis.net/spec/wfs-1/3.0/req/core",
# "http://www.opengis.net/spec/wfs-1/3.0/req/oas30",
# "http://www.opengis.net/spec/wfs-1/3.0/req/html",
# "http://www.opengis.net/spec/wfs-1/3.0/req/geojson",
"http://schemas.opengis.net/wps/1.0.0/",
"http://schemas.opengis.net/wps/2.0/",
"http://www.opengis.net/spec/WPS/2.0/req/service/binding/rest-json/core",
# "http://www.opengis.net/spec/WPS/2.0/req/service/binding/rest-json/oas30",
# "http://www.opengis.net/spec/WPS/2.0/req/service/binding/rest-json/html"
"https://github.com/opengeospatial/wps-rest-binding",
]}
return HTTPOk(json=conformance)

Following still must be added :

Slightly more official/recent conformance definitions:
https://htmlpreview.github.io/?https://github.com/opengeospatial/ogcapi-processes/blob/master/docs/18-062.html#_conformance

@fmigneault fmigneault added ci/doc Issue related to documentation of the package triage/conformance Issue related to fixing/ensuring compliance to specifications. labels Nov 14, 2019
@fmigneault fmigneault self-assigned this Nov 14, 2019
fmigneault added a commit that referenced this issue Mar 7, 2020
fmigneault added a commit that referenced this issue Mar 25, 2020
fmigneault added a commit that referenced this issue Mar 26, 2020
fmigneault added a commit that referenced this issue Apr 6, 2020
@fmigneault fmigneault added the WIP Work in progress label May 7, 2020
fmigneault added a commit that referenced this issue May 7, 2020
fmigneault added a commit that referenced this issue Jun 30, 2020
fmigneault added a commit that referenced this issue Jun 30, 2020
fmigneault added a commit that referenced this issue Jul 22, 2020
fmigneault added a commit that referenced this issue Jul 22, 2020
fmigneault added a commit that referenced this issue Sep 4, 2020
fmigneault added a commit that referenced this issue Sep 4, 2020
fmigneault added a commit that referenced this issue Sep 21, 2020
fmigneault added a commit that referenced this issue Sep 21, 2020
fmigneault added a commit that referenced this issue Sep 22, 2020
fmigneault added a commit that referenced this issue Sep 22, 2020
fmigneault added a commit that referenced this issue Feb 20, 2021
fmigneault added a commit that referenced this issue Feb 20, 2021
fmigneault added a commit that referenced this issue Feb 26, 2021
fmigneault added a commit that referenced this issue Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/doc Issue related to documentation of the package triage/conformance Issue related to fixing/ensuring compliance to specifications. WIP Work in progress
Projects
None yet
Development

No branches or pull requests

1 participant