prefect.runner.utils
¶
inject_schemas_into_openapi
¶
Augments the webserver's OpenAPI schema with additional schemas from deployments / flows / tasks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
webserver |
FastAPI
|
The FastAPI instance representing the webserver. |
required |
schemas_to_inject |
Dict[str, Any]
|
A dictionary of OpenAPI schemas to integrate. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The augmented OpenAPI schema dictionary. |
Source code in prefect/runner/utils.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
merge_definitions
¶
Integrates definitions from injected schemas into the OpenAPI components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
injected_schemas |
Dict[str, Any]
|
A dictionary of deployment-specific schemas. |
required |
openapi_schema |
Dict[str, Any]
|
The base OpenAPI schema to update. |
required |
Source code in prefect/runner/utils.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
update_refs_in_schema
¶
Recursively replaces $ref
with a new reference base in a schema item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schema_item |
Any
|
A schema or part of a schema to update references in. |
required |
new_ref |
str
|
The new base string to replace in |
required |
Source code in prefect/runner/utils.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
update_refs_to_components
¶
Updates all $ref
fields in the OpenAPI schema to reference the components section.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openapi_schema |
Dict[str, Any]
|
The OpenAPI schema to modify |
required |
Source code in prefect/runner/utils.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|