Use Type.Omit(..., []) in schema intersections & fix: #1674

Replace direct schema references inside Type.Intersect with Type.Omit(schema, []) in two places (OB11MessageSchema and OB11MessageImageSchema). This avoids reusing the original schema metadata/$id when intersecting, preventing duplicate-id or type-merging issues with TypeBox/OpenAPI generation.
This commit is contained in:
手瓜一十雪
2026-03-05 14:36:48 +08:00
parent 6758825895
commit 7fc70bc5ce
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ export const lastestMessageSchema = Type.Object({
}, { $id: 'OB11LatestMessage', description: '最后一条消息' });
export const OB11MessageSchema = Type.Intersect([
lastestMessageSchema,
Type.Omit(lastestMessageSchema, []),
Type.Object({
message_id: Type.Number({ description: '消息ID' }),
message_seq: Type.Number({ description: '消息序列号' }),
+1 -1
View File
@@ -94,7 +94,7 @@ export const OB11MessageFileBaseSchema = Type.Object({
export const OB11MessageImageSchema = Type.Object({
type: Type.Literal(OB11MessageDataType.image),
data: Type.Intersect([
FileBaseDataSchema,
Type.Omit(FileBaseDataSchema, []),
Type.Object({
summary: Type.Optional(Type.String({ description: '图片摘要' })),
sub_type: Type.Optional(Type.Number({ description: '图片子类型' })),