Fix broken code examples in docs (#3869)

* Fix broken code examples in docs

- Tag error output blocks as ```text instead of ```python (anthropic,
  openai integration docs + v2 mirrors)
- Quote unquoted URL in Descope config example (+ v2 mirror)
- Fix GoogleGenAISamplingHandler → GoogleGenaiSamplingHandler casing
  in sampling docs
- Fix import path: handlers.GoogleGenaiSamplingHandler →
  handlers.google_genai.GoogleGenaiSamplingHandler in v3-features

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix remaining broken doc examples and add skip tags for false positives

- BearerTokenAuth → StaticTokenVerifier in deployment/http.mdx
- providers.oauth → server.auth import in authentication.mdx
- ListToolsNext → updated list_tools API in v3-features.mdx
- OAuthClientProvider → OAuth in v2/storage-backends.mdx
- Add test="skip" for upgrade guides, contrib placeholders, f-string backticks

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Ratchet doc example baselines to zero

All 1444 examples now pass syntax and import checks.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add pytest-examples dev dep, fix client_id in StaticTokenVerifier example, commit missed openapi fixes

- Add pytest-examples to dev dependencies (fixes CI ModuleNotFoundError)
- Include required client_id in StaticTokenVerifier token payload
- Commit previously unstaged HTTPRoute import fixes in openapi.mdx

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update deprecated import paths across docs

- fastmcp.server.openapi → fastmcp.server.providers.openapi
- fastmcp.server.proxy → fastmcp.server.providers.proxy
- fastmcp.server.apps → fastmcp.apps
- Tag upgrade guide "Before" examples with test="skip"

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bill Easton 2026-04-12 11:53:04 -05:00 committed by GitHub
commit 901453902f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 337 additions and 72 deletions

View file

@ -19,11 +19,11 @@ The experimental OpenAPI parser is now the standard implementation. The legacy p
**If you were using the experimental parser:** Update your imports from the experimental module to the standard location:
<CodeGroup>
```python Before
```python test="skip" Before
from fastmcp.experimental.server.openapi import FastMCPOpenAPI, RouteMap, MCPType
```
```python After
```python test="skip" After
from fastmcp.server.openapi import FastMCPOpenAPI, RouteMap, MCPType
```
</CodeGroup>
@ -36,7 +36,7 @@ The following deprecated features have been removed in v2.14.0:
**BearerAuthProvider** (deprecated in v2.11):
<CodeGroup>
```python Before
```python test="skip" Before
from fastmcp.server.auth.providers.bearer import BearerAuthProvider
```
@ -47,7 +47,7 @@ from fastmcp.server.auth.providers.jwt import JWTVerifier
**Context.get_http_request()** (deprecated in v2.2.11):
<CodeGroup>
```python Before
```python test="skip" Before
request = context.get_http_request()
```
@ -59,7 +59,7 @@ request = get_http_request()
**Top-level Image import** (deprecated in v2.8.1):
<CodeGroup>
```python Before
```python test="skip" Before
from fastmcp import Image
```