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:
@@ -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: '消息序列号' }),
|
||||
|
||||
@@ -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: '图片子类型' })),
|
||||
|
||||
Reference in New Issue
Block a user