astahmer / typed-openapi

Generate a headless Typescript API client from an OpenAPI spec
https://typed-openapi-web.vercel.app/
200 stars 23 forks source link

Wrong codegen for `additionalProperties` #57

Open Kiskae opened 1 week ago

Kiskae commented 1 week ago

The current implementation defines the typescript type as: https://github.com/astahmer/typed-openapi/blob/146f110d71fb0cd41d1e0021c7f482c3120fbee0/packages/typed-openapi/src/openapi-schema-to-ts.ts#L122

But that is equivalent to:

{
  `${t.string().value} (aka 'string')`: additionalPropertiesType;
}

not

{
  [index: string]: additionalPropertiesType;
}