Skip to content

Conversation

@Matthijsy
Copy link

I am just starting to use rigging, in combination with the fabric-rti-mcp. Using this crashed the _process_field since it returns a schema like this:

{'additionalProperties': True, 'type': 'object'}

This results in trying to process True as a dict. This PR first checks if the additionalProperties value actually is a dict before processing.

Please let me know if there is any feedback.

@Matthijsy Matthijsy requested a review from a team as a code owner November 4, 2025 14:16
@l50
Copy link
Contributor

l50 commented Jan 13, 2026

Thanks for catching this bug and providing the fix! The isinstance(additional_schema, dict) check definitely prevents the crash.

One thing to consider: according to JSON Schema spec, additionalProperties: true means "allow any additional properties of any type," which should map to dict[str, Any] in Python.

Your current fix prevents the crash but causes additionalProperties: true to fall through to the nested model case, which might not be the intended behavior.

Here's a more complete fix:

if additional_schema:
    if additional_schema is True:
        return dict[str, t.Any], field_info
    elif isinstance(additional_schema, dict):
        dict_type, _ = _process_field(f"{field_name}Item", additional_schema)
        return dict[str, dict_type], field_info

This way:

  • additionalProperties: {schema} → typed dict (your original case)
  • additionalProperties: truedict[str, Any] (fabric-rti-mcp case)
  • additionalProperties: false or missing → nested model

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.

2 participants