Something went wrong. Try again.
mirror of github.com/PrefectHQ/fastmcp
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344---title: parsersidebarTitle: parser---
# `fastmcp.utilities.openapi.parser`
OpenAPI parsing logic for converting OpenAPI specs to HTTPRoute objects.
## Functions
### `parse_openapi_to_http_routes` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/openapi/parser.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
```pythonparse_openapi_to_http_routes(openapi_dict: dict[str, Any]) -> list[HTTPRoute]```
Parses an OpenAPI schema dictionary into a list of HTTPRoute objectsusing the openapi-pydantic library.
Supports both OpenAPI 3.0.x and 3.1.x versions.
## Classes
### `OpenAPIParser` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/openapi/parser.py#L109" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
Unified parser for OpenAPI schemas with generic type parameters to handle both 3.0 and 3.1.
**Methods:**
#### `parse` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/openapi/parser.py#L663" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
```pythonparse(self) -> list[HTTPRoute]```
Parse the OpenAPI schema into HTTP routes.