Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_file(path: Union[str, Path]) → OpenAPISpec[source]¶
Get an OpenAPI spec from a file path.
classmethod from_orm(obj: Any) → Model¶
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]¶
Get a cleaned operation id from an operation id.
get_methods_for_path(path: str) → List[str][source]¶
Return a list of valid methods for the specified path.
get_operation(path: str, method: str) → Operation[source]¶
Get the operation object for a given path and HTTP method.
get_parameters_for_operation(operation: Operation) → List[Parameter][source]¶
Get the components for a given operation.
get_parameters_for_path(path: str) → List[Parameter][source]¶
get_referenced_schema(ref: Reference) → Schema[source]¶
Get a schema (or nested reference) or err.
get_request_body_for_operation(operation: Operation) → Optional[RequestBody][source]¶
Get the request body for a given operation.
get_schema(schema: Union[Reference, Schema]) → Schema[source]¶