fix: ignore properties in google tool schema warnings

This commit is contained in:
Peter Steinberger
2026-01-16 02:35:48 +00:00
parent 2dea6bfa7e
commit 3dddbe1053
2 changed files with 11 additions and 0 deletions

View File

@@ -59,7 +59,17 @@ function findUnsupportedSchemaKeywords(schema: unknown, path: string): string[]
}
const record = schema as Record<string, unknown>;
const violations: string[] = [];
const properties =
record.properties && typeof record.properties === "object" && !Array.isArray(record.properties)
? (record.properties as Record<string, unknown>)
: undefined;
if (properties) {
for (const [key, value] of Object.entries(properties)) {
violations.push(...findUnsupportedSchemaKeywords(value, `${path}.properties.${key}`));
}
}
for (const [key, value] of Object.entries(record)) {
if (key === "properties") continue;
if (GOOGLE_SCHEMA_UNSUPPORTED_KEYWORDS.has(key)) {
violations.push(`${path}.${key}`);
}