fix(ui): handle object types in anyOf/oneOf schemas - #6421
Open
bogdanmariusc10 wants to merge 1 commit into
Open
fix(ui): handle object types in anyOf/oneOf schemas#6421bogdanmariusc10 wants to merge 1 commit into
bogdanmariusc10 wants to merge 1 commit into
Conversation
Admin UI form generator now correctly detects object types wrapped in anyOf/oneOf JSON Schema constructs. Previously, these were treated as plain text fields, causing dict parameters to be sent as strings and triggering validation errors. Updated both form generation and submission logic in tools.js to check for object types nested within anyOf/oneOf arrays. Fixes issue where MCP tools with nullable object parameters (using anyOf with object and null types) failed when invoked from Admin UI. Signed-off-by: Bogdan-Marius-Catanus <bogdan-marius.catanus@ibm.com>
bogdanmariusc10
requested review from
Lang-Akshay,
brian-hussey,
crivetimihai,
ja8zyjits and
msureshkumar88
as code owners
August 26, 2026 11:30
7 tasks
Collaborator
Author
|
@ja8zyjits @msureshkumar88 Could you please help me review this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
🔗 Related Issue
Closes #6420
📝 Summary
Fixes Admin UI bug where object-type parameters wrapped in
anyOf/oneOfJSON Schema constructs were treated as plain text, causing dict parameters to be sent as strings and triggering validation errors.Updated
mcpgateway/admin_ui/tools.jsto detect object types insideanyOf/oneOfarrays in both form generation and submission logic.📏 Reviewability
triage🏷️ Type of Change
🧪 Verification
Reproduction: MCP tools with schemas like
{"anyOf": [{"type": "object"}, {"type": "null"}]}failed from Admin UI with "Input should be a valid dictionary" error.Fix verification: Test scripts demonstrate before/after behavior:
test_ui_bug_reproduction.sh- reproduces bug (params sent as string)test_ui_fix_verification.sh- verifies fix (params sent as dict)make lintmake testmake coverage✅ Checklist
make black isort pre-commit)📓 Notes (optional)
Changed lines: 2 locations in
tools.jsImpact: Affects any MCP tool using nullable object parameters with proper JSON Schema validation.