-
-
Notifications
You must be signed in to change notification settings - Fork 275
Open
Labels
bug π₯Something isn't workingSomething isn't workingjavascriptPull requests that update Javascript codePull requests that update Javascript code
Description
Description
When having a basic object type, the produced Zod validator is missing a keyParam
It is generating
z.record(z.unknown())
When it should be
z.record(z.string(), z.unknown())
Reproducible example or configuration
For some reason I can't get this to work in stackblitz, but this is roughly the minimal requirement:
export default defineConfig({
input: {
openapi: '3.1.0',
info: {
title: 'Eample',
version: '1.0.0',
},
components: {
schemas: {
example: {
properties: {
_meta: {
additionalProperties: {},
description: 'hi',
type: ['object', 'null'],
},
},
type: 'object',
},
},
},
},
output: {
path: './src/schema',
},
plugins: ['@hey-api/transformers', '@hey-api/typescript', 'zod'],
});
OpenAPI specification (optional)
No response
System information (optional)
No response
Metadata
Metadata
Assignees
Labels
bug π₯Something isn't workingSomething isn't workingjavascriptPull requests that update Javascript codePull requests that update Javascript code