Skip to content

Conversation

shoummu1
Copy link
Collaborator

📌 Summary
This PR resolves Issue #620 by updating the Test Tool UI to correctly handle array-type inputs using schema-aware logic. It ensures that structured arrays (e.g., arrays of objects) are parsed and validated properly before submission.

🐞 Root Cause
The UI was treating array inputs as raw strings from text fields, and passing them as single stringified values instead of structured arrays. This broke validation for tools expecting array or other structured formats.

🔁 Reproduction Steps
Refer to: #620

💡 Fix Description

  • Removed static text input logic for array types.
  • Used formData.getAll(key) to retrieve all user inputs for array fields.
  • Dynamically parsed values based on items. Type:
    • object: Parsed with JSON.parse, validated for structure.
    • number: Mapped to numeric values.
    • boolean: Converted to true/false.
    • Fallback: Used raw input as string.
  • Improved error handling and validation messages.
  • Set empty required array inputs to [] where appropriate.

Copy link
Member

@crivetimihai crivetimihai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@crivetimihai crivetimihai merged commit ccfc45e into main Jul 30, 2025
37 checks passed
@crivetimihai crivetimihai deleted the fix_tool_input branch July 30, 2025 18:34
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.

3 participants