mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
* Switch to new OpenAPI parser as default Remove the legacy OpenAPI parser and make the experimental parser the default. The experimental parser (introduced in 2.11) offers better performance, improved compatibility, and a more maintainable architecture. - Delete legacy parser (server/openapi.py, utilities/openapi.py) - Move experimental parser to main locations - Remove enable_new_openapi_parser feature flag - Update documentation to remove experimental references * Add deprecation stubs for experimental OpenAPI imports * Add deprecated enable_new_openapi_parser setting and deprecation tests * SDK docs * REview comments * Fix docstrings * Update docstring * Review comments * Fix broken links
43 lines
1.2 KiB
Text
43 lines
1.2 KiB
Text
---
|
|
title: parser
|
|
sidebarTitle: 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/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi/parser.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
```python
|
|
parse_openapi_to_http_routes(openapi_dict: dict[str, Any]) -> list[HTTPRoute]
|
|
```
|
|
|
|
|
|
Parses an OpenAPI schema dictionary into a list of HTTPRoute objects
|
|
using the openapi-pydantic library.
|
|
|
|
Supports both OpenAPI 3.0.x and 3.1.x versions.
|
|
|
|
|
|
## Classes
|
|
|
|
### `OpenAPIParser` <sup><a href="https://github.com/jlowin/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/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi/parser.py#L659" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
```python
|
|
parse(self) -> list[HTTPRoute]
|
|
```
|
|
|
|
Parse the OpenAPI schema into HTTP routes.
|
|
|