diff --git a/LICENSE.txt b/LICENSE.txt index c9d83a1b3..b27120226 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2020 Francis Charette-Migneault + Copyright (c) 2020 CRIM Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/weaver/__meta__.py b/weaver/__meta__.py index 704691133..611cf8985 100644 --- a/weaver/__meta__.py +++ b/weaver/__meta__.py @@ -5,8 +5,10 @@ __source_repository__ = "https://github.com/crim-ca/weaver" __docker_repository__ = "https://hub.docker.com/r/pavics/weaver" __documentation_url__ = "https://pavics-weaver.readthedocs.io/" +__license_url__ = "https://raw.githubusercontent.com/crim-ca/weaver/master/LICENSE.txt" __license_type__ = "Apache License 2.0" __license_short__ = "2020, CRIM" +__license_long__ = f"{__title__} {__license_type__}, Copyright \u24B8 {__license_short__}" __authors__ = [ "CRIM", ] diff --git a/weaver/wps_restapi/api.py b/weaver/wps_restapi/api.py index eff507be7..30d615f9e 100644 --- a/weaver/wps_restapi/api.py +++ b/weaver/wps_restapi/api.py @@ -70,7 +70,8 @@ def api_frontpage_body(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_oas_ui = weaver_api_url + sd.api_openapi_ui_service.path if weaver_api else None + weaver_api_swagger = weaver_api_url + sd.api_swagger_ui_service.path if weaver_api else None weaver_api_doc = settings.get("weaver.wps_restapi_doc", None) if weaver_api else None weaver_api_ref = settings.get("weaver.wps_restapi_ref", None) if weaver_api else None weaver_api_spec = weaver_api_url + sd.openapi_json_service.path if weaver_api else None @@ -80,21 +81,29 @@ def api_frontpage_body(settings): weaver_process_url = weaver_url + sd.processes_service.path weaver_jobs_url = weaver_url + sd.jobs_service.path weaver_links = [ - {"href": weaver_url, "rel": "self", "type": CONTENT_TYPE_APP_JSON, "title": "This document"}, + {"href": weaver_url, "rel": "self", "type": CONTENT_TYPE_APP_JSON, "title": "This landing page."}, {"href": weaver_conform_url, "rel": "http://www.opengis.net/def/rel/ogc/1.0/conformance", "type": CONTENT_TYPE_APP_JSON, "title": "Conformance classes implemented by this service."}, + {"href": __meta__.__license_url__, "rel": "license", + "type": CONTENT_TYPE_TEXT_PLAIN, "title": __meta__.__license_long__} ] 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-ui", "type": CONTENT_TYPE_TEXT_HTML, - "title": "WPS REST API definition of this service."}, + {"href": weaver_api_spec, + "rel": "service-desc", "type": CONTENT_TYPE_APP_JSON, + "title": "OpenAPI specification of this service."}, + {"href": weaver_api_oas_ui, + "rel": "service-doc", "type": CONTENT_TYPE_TEXT_HTML, + "title": "Human readable OpenAPI documentation of this service."}, {"href": weaver_api_spec, "rel": "OpenAPI", "type": CONTENT_TYPE_APP_JSON, - "title": "WPS REST API specification of this service."}, + "title": "OpenAPI specification of this service."}, + {"href": weaver_api_swagger, + "rel": "swagger-ui", "type": CONTENT_TYPE_TEXT_HTML, + "title": "WPS REST API definition of this service."}, {"href": weaver_process_url, "rel": "http://www.opengis.net/def/rel/ogc/1.0/processes", "type": CONTENT_TYPE_APP_JSON, "title": "Processes offered by this service."}, @@ -167,7 +176,7 @@ def api_frontpage_body(settings): "parameters": [ {"name": "api", "enabled": weaver_api, "url": weaver_api_url, - "api": weaver_api_def}, + "api": weaver_api_oas_ui}, {"name": "wps", "enabled": weaver_wps, "url": weaver_wps_url}, ],