Skip to content

Conversation

@arturfromtabnine
Copy link
Contributor

@arturfromtabnine arturfromtabnine commented Jan 13, 2026

fix for #1473
Description: (required)

  • Refactored recursivelyDeleteUnsupportedParameters in Vertex AI utils to use an allowlist approach instead of a blocklist for filtering JSON Schema fields
  • Created VERTEX_AI_SUPPORTED_SCHEMA_FIELDS Set containing all fields supported by Vertex AI's Schema API (type, format, title, description, properties, items, anyOf, enum, required, etc.)
  • Added support for converting array type definitions to anyOf format (e.g., {"type": ["string", "number"]} → {"anyOf": [{"type": "string"}, {"type": "number"}]}) since Vertex AI doesn't support type arrays
  • Improved recursive handling with filterSchemaFields function that correctly distinguishes between schema objects and property maps to avoid incorrectly filtering property names
  • Properly handles nested structures: properties maps, items schemas, anyOf arrays, and other nested schema objects

Tests Run/Test cases added: (required)

  • Removes unsupported meta fields ($schema, $id, $comment)
  • Removes additionalProperties
  • Removes unsupported composition keywords (oneOf, allOf, not, const, if/then/else)
  • Removes unsupported array keywords (uniqueItems, contains)
  • Preserves all supported Vertex AI schema fields (type, format, title, description, nullable, default, example, properties, items, enum, required, min/max constraints, pattern, etc.)
  • Recursively processes nested objects and arrays
  • Correctly handles anyOf arrays
  • Handles null and non-object values gracefully
  • Converts array type to anyOf format
  • Handles nested array types in complex schemas

Type of Change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

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.

1 participant