weaver.wps_restapi.utils
¶
Module Contents¶
-
weaver.wps_restapi.utils.
wps_restapi_base_path
(container: weaver.typedefs.AnySettingsContainer) → str[source]¶
-
weaver.wps_restapi.utils.
get_wps_restapi_base_url
(container: weaver.typedefs.AnySettingsContainer) → str[source]¶
-
weaver.wps_restapi.utils.
get_schema_ref
(schema: colander.SchemaNode, container: weaver.typedefs.AnySettingsContainer, ref_type: str = '$schema', ref_name: True = True) → Dict[str, str][source]¶ Generates the JSON OpenAPI schema reference relative to the current Weaver instance.
The provided schema should be one of the items listed in
#/definitions
of the/json
endpoint. No validation is accomplished to avoid long processing of all references.If setting
weaver.schema_url
is set, this value will be used direct as fully-defined base URL. This could be used to refer to a static endpoint where schemas are hosted. Otherwise, the current Web Application resolved location is employed with JSON OpenAPI path.- Parameters
schema – schema-node instance or type for which to generate the OpenAPI reference.
container – application settings to retrieve the base URL of the schema location.
ref_type – key employed to form the reference (e.g.: “$schema”, “$ref”, “@schema”, etc.)
ref_name – indicate if the plain name should also be included under field
"schema"
.
- Returns
OpenAPI schema reference