Skip to content

Commit 5f8a2f0

Browse files
committed
fix(feishu): replace empty Type.Any() with non-empty FlexibleValue in bitable schemas
- Type.Any() and Type.Unknown() serialize to {} in TypeBox 1.1.x, producing empty patternProperties sub-schemas that AWS Bedrock rejects - Replace with Type.Unsafe<unknown>({description: ...}) that generates a non-empty JSON Schema while still accepting any JSON-compatible value - Applied to create_record fields, update_record fields, and create_field property schemas Fixes #94547
1 parent 37962aa commit 5f8a2f0

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

extensions/feishu/src/bitable.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,19 @@ const GetRecordSchema = Type.Object({
525525
record_id: Type.String({ description: "Record ID to retrieve" }),
526526
});
527527

528+
// FIX #94547: Type.Any() / Type.Unknown() serialize to {} in TypeBox 1.1.x,
529+
// producing an empty sub-schema that AWS Bedrock rejects. Use a non-empty
530+
// flexible-value schema that accepts any JSON-compatible value.
531+
const FlexibleValue = Type.Unsafe<unknown>({
532+
description: "Any JSON-compatible value (string, number, boolean, array, or object)",
533+
});
534+
528535
const CreateRecordSchema = Type.Object({
529536
app_token: Type.String({
530537
description: "Bitable app token (use feishu_bitable_get_meta to get from URL)",
531538
}),
532539
table_id: Type.String({ description: "Table ID (from URL: ?table=YYY)" }),
533-
fields: Type.Record(Type.String(), Type.Any(), {
540+
fields: Type.Record(Type.String(), FlexibleValue, {
534541
description:
535542
"Field values keyed by field name. Format by type: Text='string', Number=123, SingleSelect='Option', MultiSelect=['A','B'], DateTime=timestamp_ms, User=[{id:'ou_xxx'}], URL={text:'Display',link:'https://...'}",
536543
}),
@@ -560,7 +567,7 @@ const CreateFieldSchema = Type.Object({
560567
minimum: 1,
561568
}),
562569
property: Type.Optional(
563-
Type.Record(Type.String(), Type.Any(), {
570+
Type.Record(Type.String(), FlexibleValue, {
564571
description: "Field-specific properties (e.g., options for SingleSelect, format for Number)",
565572
}),
566573
),
@@ -572,7 +579,7 @@ const UpdateRecordSchema = Type.Object({
572579
}),
573580
table_id: Type.String({ description: "Table ID (from URL: ?table=YYY)" }),
574581
record_id: Type.String({ description: "Record ID to update" }),
575-
fields: Type.Record(Type.String(), Type.Any(), {
582+
fields: Type.Record(Type.String(), FlexibleValue, {
576583
description: "Field values to update (same format as create_record)",
577584
}),
578585
});

0 commit comments

Comments
 (0)