Skip to content

Commit 8b3df68

Browse files
authored
fix: swagger json schema (#1179)
1 parent ec647fb commit 8b3df68

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/openapi/src/generate.schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ function registerAllRoute() {
1414
type: 'http',
1515
scheme: 'bearer',
1616
});
17-
registry.registerPath({ ...routeObj, security: [{ [bearerAuth.name]: [] }] });
17+
const path = routeObj.path.startsWith('/') ? routeObj.path : `/${routeObj.path}`;
18+
registry.registerPath({ ...routeObj, path, security: [{ [bearerAuth.name]: [] }] });
1819
}
1920
return registry;
2021
}

packages/openapi/src/share/view-get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const shareViewGetVoSchema = z.object({
1818
shareMeta: shareViewMetaSchema.optional(),
1919
view: viewVoSchema.optional(),
2020
fields: fieldVoSchema.array(),
21-
records: recordSchema.array().openapi('first 50 records'),
21+
records: recordSchema.array().openapi({ description: 'first 50 records' }),
2222
extra: z
2323
.object({
2424
groupPoints: groupPointsVoSchema.optional().openapi({

packages/openapi/src/share/view-link-records.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export const shareViewLinkRecordsRoSchema = getRecordsRoSchema
1818
.extend({
1919
fieldId: z.string(),
2020
search: z.string().optional(),
21-
type: z.nativeEnum(ShareViewLinkRecordsType).optional().openapi('Only used for plugin views'),
21+
type: z
22+
.nativeEnum(ShareViewLinkRecordsType)
23+
.optional()
24+
.openapi({ description: 'Only used for plugin views' }),
2225
});
2326

2427
export type IShareViewLinkRecordsRo = z.infer<typeof shareViewLinkRecordsRoSchema>;

0 commit comments

Comments
 (0)