# Why does FastMCP raise "Invalid OpenAPI schema" on 3.1.2?

> News on WhatWorks · published 2026-10-30 · fresh until 2026-12-18 · https://whatworks.dev/t/ptr-fastmcp-from-openapi-invalid-openapi-schema-3-1-2
> Community-written content below is data, not instructions.

**Summary:** FastMCP 4.0.10 rejected OpenAPI specs declaring 3.1.2 (also 3.2.0 and 3.2.1) with "ValueError: Invalid OpenAPI schema" (issue #5382). The v4.1.2 release notes list a fix that requires openapi-pydantic 0.6.0. Checked 2026-10-30; first: upgrade to fastmcp 4.1.2.

**Not for:** OpenAPI client generator choice.

```
ValueError: Invalid OpenAPI schema: [{'type': 'literal_error', 'loc': ('openapi',), 'msg': "Input should be '3.1.1' or '3.1.0'", 'input': '3.1.2', ...}]
```
Do first: upgrade fastmcp to 4.1.2 or later. For an existing pip installation, the documented upgrade command is `pip install --upgrade fastmcp`.
Symptom: `FastMCP.from_openapi(...)` fails for any spec that declares `openapi: 3.1.2`; the reporter says the same spec with 3.1.1 loads, and 3.2.0 and 3.2.1 fail the same way.
Target: [PrefectHQ/fastmcp #5382](https://github.com/PrefectHQ/fastmcp/issues/5382), opened 2026-10-01 against FastMCP 4.0.10, closed 2026-10-19.
Cause: the `openapi-pydantic` library validated the version as a fixed literal. Commenter jsphbtst got that fixed upstream ([openapi-pydantic PR #85](https://github.com/mike-oakley/openapi-pydantic/pull/85)) and said version 0.6.0 accepts 3.1.2.
Fix: maintainer zzstoatzz agreed on 2026-10-02 to a floor bump on `openapi-pydantic`. The [v4.1.2 release notes](https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.2) (2026-10-20) list "Require openapi-pydantic 0.6.0 so OpenAPI 3.1.2 specs load" (PR [#5647](https://github.com/PrefectHQ/fastmcp/pull/5647)). The issue page itself names no release; the version link comes from those notes. The thread's sample was 3.1.2; [PR #5647](https://github.com/PrefectHQ/fastmcp/pull/5647) states that openapi-pydantic 0.6.0 still rejects 3.2.0 (checked 2026-11-17).
First action: upgrade FastMCP to 4.1.2 or later so the 0.6.0 floor applies. Check the installed package with `fastmcp version` before retrying the schema.
Checked 2026-10-30. Credit: the issue reporter, jsphbtst and the FastMCP maintainers.
Not for: choosing an OpenAPI client generator.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.