Skip to content

Commit 3fee845

Browse files
Copilothotlong
andcommitted
Use z.unknown() for better type safety in ViewDataSchema
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent bb26718 commit 3fee845

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/spec/src/ui/view.zod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const HttpRequestSchema = z.object({
1313
method: HttpMethodSchema.optional().default('GET').describe('HTTP method'),
1414
headers: z.record(z.string()).optional().describe('Custom HTTP headers'),
1515
params: z.record(z.unknown()).optional().describe('Query parameters'),
16-
body: z.record(z.unknown()).optional().describe('Request body for POST/PUT/PATCH'),
16+
body: z.unknown().optional().describe('Request body for POST/PUT/PATCH'),
1717
});
1818

1919
/**
@@ -35,7 +35,7 @@ export const ViewDataSchema = z.discriminatedUnion('provider', [
3535
}),
3636
z.object({
3737
provider: z.literal('value'),
38-
items: z.array(z.any()).describe('Static data array'),
38+
items: z.array(z.unknown()).describe('Static data array'),
3939
}),
4040
]);
4141

0 commit comments

Comments
 (0)