weaver.wps_restapi.api

Module Contents

weaver.wps_restapi.api.LOGGER[source]
weaver.wps_restapi.api.api_frontpage(request)[source]

Frontpage of weaver.

weaver.wps_restapi.api.api_versions(request: Request) → HTTPException[source]

Weaver versions information.

weaver.wps_restapi.api.api_conformance(request: Request) → HTTPException[source]

Weaver specification conformance information.

weaver.wps_restapi.api.get_swagger_json(http_scheme: AnyStr = 'http', http_host: AnyStr = 'localhost', base_url: Optional[AnyStr] = None, use_docstring_summary: bool = True)dict[source]

Obtains the JSON schema of weaver API from request and response views schemas.

Parameters
  • http_scheme – Protocol scheme to use for building the API base if not provided by base URL parameter.

  • http_host – Hostname to use for building the API base if not provided by base URL parameter.

  • base_url – Explicit base URL to employ of as API base instead of HTTP scheme/host parameters.

  • use_docstring_summary – Setting that controls if function docstring should be used to auto-generate the summary field of responses.

weaver.wps_restapi.api.api_swagger_json(request: Request)dict[source]

weaver REST API schema generation in JSON format.

weaver.wps_restapi.api.api_swagger_ui(request)[source]

weaver REST API swagger-ui schema documentation (this page).

weaver.wps_restapi.api.get_request_info(request: Request, detail: Optional[AnyStr] = None) → JSON[source]

Provided additional response details based on the request and execution stack on failure.

weaver.wps_restapi.api.ows_json_format(function)[source]

Decorator that adds additional detail in the response’s JSON body if this is the returned content-type.

weaver.wps_restapi.api.not_found_or_method_not_allowed(request)[source]

Overrides the default is HTTPNotFound [404] by appropriate HTTPMethodNotAllowed [405] when applicable.

Not found response can correspond to underlying process operation not finding a required item, or a completely unknown route (path did not match any existing API definition). Method not allowed is more specific to the case where the path matches an existing API route, but the specific request method (GET, POST, etc.) is not allowed on this path.

Without this fix, both situations return [404] regardless.

weaver.wps_restapi.api.unauthorized_or_forbidden(request)[source]

Overrides the default is HTTPForbidden [403] by appropriate HTTPUnauthorized [401] when applicable.

Unauthorized response is for restricted user access according to credentials and/or authorization headers. Forbidden response is for operation refused by the underlying process operations.

Without this fix, both situations return [403] regardless.