Skip to content

fix: validate if value is dict before recursion in _filter_to_supported_schema#2477

Open
dechantoine wants to merge 1 commit into
googleapis:mainfrom
dechantoine:fix/additional_properties
Open

fix: validate if value is dict before recursion in _filter_to_supported_schema#2477
dechantoine wants to merge 1 commit into
googleapis:mainfrom
dechantoine:fix/additional_properties

Conversation

@dechantoine
Copy link
Copy Markdown
Contributor

Hey! 👋

This is a fix for #2476.

What changed: Added an isinstance(field_value, dict) guard in _filter_to_supported_schema before recursing into schema_field_names entries (specifically additionalProperties).

Why it crashed: The https://json-schema.org/understanding-json-schema/reference/object#additionalproperties allows additionalProperties to be either a boolean or a schema object. FastMCP (and other MCP SDKs) emit "additionalProperties": false by default, which triggered an AttributeError: 'bool' object has no attribute 'items'.

Testing: Verified against the repro script in the linked issue — old behavior is preserved for dict values, booleans now pass through correctly.

Happy to adjust if needed!
Antoine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant