Skip to content

fix: allow for self-referencing pydantic schema #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonvet
Copy link

@jonvet jonvet commented Jun 1, 2025

Describe your changes

This PR introduces a new field related_products in the Products fixture which replicates the failure case mentioned in #155 and makes existing tests fail with a RecursionError as expected. Then we add a new seen set to the function resolve_schema_references which resolves the error and makes the tests pass again.

Issue ticket number and link (if applicable)

Fixes #155

Checklist before requesting a review

  • Added relevant tests
  • Run ruff & mypy
  • All tests pass

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.

[BUG]RecursionError with Self-Referencing Pydantic Models in fastapi-mcp 0.3.3
1 participant