fastmcp/tests/deprecated
Jeremiah Lowin caeaa86394
Simplify .key as computed property (#2648)
* Simplify .key as computed property

Keep .key as the standard lookup interface for all components but
implement it as a computed property instead of a stored field.

- Remove _key private attribute and custom model_copy(key=...)
- .key returns .name for tools/prompts, str(.uri) for resources,
  .uri_template for templates
- Use .key universally for component lookups in managers
- MountedProvider: prefix URIs only for resources/templates, not names
- Docket registration: tools/prompts use .key, resources use .name
  (matches fn.__name__ for function lookup)

* Simplify .key as computed property

Keep .key as the standard lookup interface for all components but
implement it as a computed property instead of a stored field.

- Remove _key private attribute and custom model_copy(key=...)
- .key returns .name for tools/prompts, str(.uri) for resources,
  .uri_template for templates
- Use .key universally for component lookups and Docket registration
- MountedProvider: prefix URIs only for resources/templates, not names
- Add _backend_* fields to proxy classes to preserve original identifiers
  for backend calls when prefixed via import_server

* Standardize .key as computed property

- .key is now a read-only computed property:
  - Tools/Prompts: returns .name
  - Resources: returns str(.uri)
  - Templates: returns .uri_template
- Prefixing uses model_copy(update={...}) to change underlying field
- Resource/template names are NOT prefixed, only URIs
- Move import_server tests to tests/deprecated/
2025-12-18 14:48:47 -05:00
..
__init__.py Simplify .key as computed property (#2648) 2025-12-18 14:48:47 -05:00
conftest.py Simplify .key as computed property (#2648) 2025-12-18 14:48:47 -05:00
test_deprecated.py 2.14 deprecation removals (#2329) 2025-12-01 14:11:00 -05:00
test_exclude_args.py Deprecate exclude_args in favor of Depends() (#2621) 2025-12-14 21:24:08 -05:00
test_import_server.py Simplify .key as computed property (#2648) 2025-12-18 14:48:47 -05:00
test_openapi_deprecations.py Switch to new OpenAPI parser as default (#2513) 2025-12-01 20:29:18 -05:00
test_settings.py Remove deprecated from fastmcp.settings import settings (#2581) 2025-12-09 13:39:34 -05:00