Skip to content
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

Single select field use enum name as title instead of provided parameter (since Pydantic 2.9.0) #356

Open
elio2t opened this issue Oct 14, 2024 · 0 comments

Comments

@elio2t
Copy link

elio2t commented Oct 14, 2024

Description

After upgrading to Pydantic version 2.9, I encountered an issue where single select fields in FastUI are using the enum name as the title, rather than the custom title provided as a parameter:
Screenshot 2024-10-14 at 18 38 10

It seems to be linked to this update: pydantic/pydantic#10029

Schema before:

{
   "select_single": {
    "allOf": [{ "$ref": "#/$defs/ToolEnum" }],
    "title": "Select Single"
  },
  ...
}

Schema after:

{
  "select_single": { "$ref": "#/$defs/ToolEnum", "title": "Select Single" },
  ...
}

This seems to cause a different behaviour in the deference_json_schema function and results in the title being overwritten.

Environment

FastUI version: 0.7.0
Pydantic version: 2.9.0
Python version: 3.12.4

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

No branches or pull requests

1 participant