OpenApiParser Class
NOTE: SK Python only supports the OpenAPI Spec >=3.0.
Import an OpenAPI file.
Constructor
OpenApiParser()
Parameters
| Name | Description |
|---|---|
|
openapi_file
Required
|
The path to the OpenAPI file which can be local or a URL. |
|
openapi_file
Required
|
The path to the OpenAPI file which can be local or a URL. |
Methods
| create_rest_api_operations |
Create REST API operations from the parsed OpenAPI document. |
| parse |
Parse the OpenAPI document. |
create_rest_api_operations
Create REST API operations from the parsed OpenAPI document.
create_rest_api_operations(parsed_document: Any, execution_settings: OpenAPIFunctionExecutionParameters | None = None) -> dict[str, RestApiOperation]
Parameters
| Name | Description |
|---|---|
|
parsed_document
Required
|
The parsed OpenAPI document. |
|
execution_settings
|
The execution settings. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A dictionary of RestApiOperation instances. |
parse
Parse the OpenAPI document.
parse(openapi_document: str) -> Any | dict[str, Any] | None
Parameters
| Name | Description |
|---|---|
|
openapi_document
Required
|
|
Attributes
PAYLOAD_PROPERTIES_HIERARCHY_MAX_DEPTH
PAYLOAD_PROPERTIES_HIERARCHY_MAX_DEPTH: int = 10
SUPPORTED_MEDIA_TYPES
SUPPORTED_MEDIA_TYPES: Final[list[str]] = ['application/json', 'text/plain']