Skip to content

Commit 26713df

Browse files
committed
fix: Added local oneOf for swagger fix
1 parent 3afd850 commit 26713df

File tree

1 file changed

+38
-26
lines changed

1 file changed

+38
-26
lines changed

apps/meteor/app/api/server/v1/groups.ts

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,32 +57,44 @@ type GroupsHistoryProps = PaginatedRequest<
5757
showThreadMessages?: string;
5858
}
5959
>;
60-
const groupsHistoryPropsSchema = withGroupBaseProperties({
61-
latest: {
62-
type: 'string',
63-
},
64-
oldest: {
65-
type: 'string',
66-
},
67-
inclusive: {
68-
type: 'string',
69-
},
70-
unreads: {
71-
type: 'string',
72-
},
73-
showThreadMessages: {
74-
type: 'string',
75-
},
76-
count: {
77-
type: 'integer',
78-
},
79-
offset: {
80-
type: 'integer',
81-
},
82-
sort: {
83-
type: 'string',
84-
},
85-
});
60+
const groupsHistoryPropsSchema = {
61+
type: 'object',
62+
oneOf: [
63+
{
64+
type: 'object',
65+
properties: {
66+
roomId: { type: 'string' },
67+
latest: { type: 'string' },
68+
oldest: { type: 'string' },
69+
inclusive: { type: 'string' },
70+
unreads: { type: 'string' },
71+
showThreadMessages: { type: 'string' },
72+
count: { type: 'string' },
73+
offset: { type: 'string' },
74+
sort: { type: 'string' },
75+
},
76+
required: ['roomId'],
77+
additionalProperties: false,
78+
},
79+
{
80+
type: 'object',
81+
properties: {
82+
roomName: { type: 'string' },
83+
latest: { type: 'string' },
84+
oldest: { type: 'string' },
85+
inclusive: { type: 'string' },
86+
unreads: { type: 'string' },
87+
showThreadMessages: { type: 'string' },
88+
count: { type: 'string' },
89+
offset: { type: 'string' },
90+
sort: { type: 'string' },
91+
},
92+
required: ['roomName'],
93+
additionalProperties: false,
94+
},
95+
],
96+
} as const;
97+
8698
const isGroupsHistoryProps = ajv.compile<GroupsHistoryProps>(groupsHistoryPropsSchema);
8799

88100
const isGroupsHistoryResponse = ajv.compile({

0 commit comments

Comments
 (0)