langchain.utilities.openapi.OpenAPISpec¶
class langchain.utilities.openapi.OpenAPISpec[source]¶
OpenAPI Model that removes mis-formatted parts of the spec.
Attributes
base_url
Get the base url.
Methods
__init__()
from_file(path)
Get an OpenAPI spec from a file path.
from_spec_dict(spec_dict)
Get an OpenAPI spec from a dict.
from_text(text)
Get an OpenAPI spec from a text.
from_url(url)
Get an OpenAPI spec from a URL.
get_cleaned_operation_id(operation, path, method)
Get a cleaned operation id from an operation id.
get_methods_for_path(path)
Return a list of valid methods for the specified path.
get_operation(path, method)
Get the operation object for a given path and HTTP method.
get_parameters_for_operation(operation)
Get the components for a given operation.
get_parameters_for_path(path)
get_referenced_schema(ref)
Get a schema (or nested reference) or err.
get_request_body_for_operation(operation)
Get the request body for a given operation.
get_schema(schema)
parse_obj(obj)
__init__()¶
classmethod from_file(path: Union[str, Path]) → OpenAPISpec[source]¶
Get an OpenAPI spec from a file path.
classmethod from_spec_dict(spec_dict: dict) → OpenAPISpec[source]¶
Get an OpenAPI spec from a dict.
classmethod from_text(text: str) → OpenAPISpec[source]¶
Get an OpenAPI spec from a text.
classmethod from_url(url: str) → OpenAPISpec[source]¶
Get an OpenAPI spec from a URL.
static get_cleaned_operation_id(operation: Operation, path: str, method: str) → str[source]¶