fastmcp/tests/utilities
Jeremiah Lowin 0a6a3a3859
[3.x] Inline schemas whose pointers pass through alias definitions (#5439)
`dereference_refs` checks the size of a schema before inlining it. That check walked the raw schema, so a pointer such as `#/$defs/Alias/properties/value`, where `Alias` is only a `$ref` to another definition, could not be resolved and the schema was returned with its `$ref`s in place, even though it is small and `jsonref` inlines it correctly. The pointer walk now continues through local `$ref` nodes the way `jsonref` does, with a limit on how many references one lookup follows, so alias chains resolve, cycles and dangling references still keep the compact form, and the check stays bounded.

```python
schema = {
    "type": "object",
    "properties": {"v": {"$ref": "#/$defs/Alias/properties/value"}},
    "$defs": {
        "Alias": {"$ref": "#/$defs/Actual"},
        "Actual": {"type": "object", "properties": {"value": {"type": "string"}}},
    },
}
dereference_refs(schema)["properties"]["v"]  # {"type": "string"}
```

Co-authored-by: Bill Easton <williamseaston@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-10-04 10:51:38 -04:00
..
json_schema_type [3.x] Build client schema types with create_model and bounded caches (#5414) 2026-10-04 10:39:31 -04:00
openapi Serialize deep object query parameters (#4523) (#4664) 2026-07-27 13:10:57 -04:00
__init__.py restore 1.x code 2025-04-09 11:54:42 -04:00
test_async_utils.py Add targeted coverage tests (#4230) 2026-05-25 18:57:28 -04:00
test_auth.py feat: option to add upstream claims to the FastMCP proxy JWT (#2997) 2026-01-28 15:57:24 -05:00
test_cli.py Fix path resolution in install commands (#1951) 2025-09-29 20:04:12 -04:00
test_components.py Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
test_docstring_parsing.py Extract parameter descriptions from docstrings (#3872) 2026-04-12 13:43:48 -04:00
test_http.py Add targeted coverage tests (#4230) 2026-05-25 18:57:28 -04:00
test_inspect.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_inspect_icons.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_json_schema.py [3.x] Keep $ref pointers when inlining would produce an oversized schema (#5422) 2026-10-04 10:39:39 -04:00
test_json_schema_expansion.py [3.x] Inline schemas whose pointers pass through alias definitions (#5439) 2026-10-04 10:51:38 -04:00
test_logging.py Add enable_rich_logging setting to disable rich formatting (#2893) 2026-01-16 20:29:29 -05:00
test_skills.py Add targeted coverage tests (#4230) 2026-05-25 18:57:28 -04:00
test_tests.py fix(openapi): keep blank values in parse_qs (refs #4056) (#4076) 2026-05-04 12:44:06 -04:00
test_timeout.py Add targeted coverage tests (#4230) 2026-05-25 18:57:28 -04:00
test_token_cache.py Extract TokenCache utility, add caching to GitHubTokenVerifier (#3547) 2026-03-18 15:26:09 -04:00
test_typeadapter.py Fix method-bound tools (#1360) 2025-08-04 09:41:05 -04:00
test_types.py Preserve kw-only defaults when rebuilding functions for resolved annotations (#3429) 2026-03-07 12:10:01 -05:00
test_version_check.py Add CLI update notifications (#2840) 2026-01-10 18:27:03 -05:00