Skip to content

fix: preserve tool input enum schemas#294

Open
zxyasfas wants to merge 2 commits into
open-webui:devfrom
zxyasfas:codex/preserve-openapi-enums
Open

fix: preserve tool input enum schemas#294
zxyasfas wants to merge 2 commits into
open-webui:devfrom
zxyasfas:codex/preserve-openapi-enums

Conversation

@zxyasfas

@zxyasfas zxyasfas commented May 6, 2026

Copy link
Copy Markdown

Summary

  • Preserve JSON Schema enum values when converting MCP tool input schemas into Pydantic model fields.
  • Use Literal types for primitive enum values so generated OpenAPI schemas expose allowed values and validation stays aligned with the MCP schema.
  • Keep enum schema metadata when aliased parameter fields are generated.

Fixes #245

Testing

  • uv run pytest

Changelog Entry

Fixed

  • Preserve enum constraints from MCP tool input schemas in generated OpenAPI request schemas.

Additional Information

  • No new dependencies.

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