Apicraft generates types.gen.ts through @hey-api/openapi-ts, and a schema named Error is emitted as _Error. This happens because Error is treated as a reserved/global TypeScript identifier by the generator.
The problem is that apicraft’s own plugins do not consistently use the same escaping logic. For example, the faker plugin builds schema type names with capitalize(normalizeName(name)), so for an OpenAPI schema named Error it tries to import/use Error, while types.gen.ts only exports _Error.
As a result, generated files can reference a type that does not exist, causing TypeScript errors when schemas have names like Error, Array, Date, Promise, etc. Apicraft should either mirror @hey-api/openapi-ts identifier escaping in its plugins or expose/pass through a consistent naming strategy so all generated files agree on schema type names.
Apicraft generates
types.gen.tsthrough@hey-api/openapi-ts, and a schema namedErroris emitted as_Error. This happens becauseErroris treated as a reserved/global TypeScript identifier by the generator.The problem is that apicraft’s own plugins do not consistently use the same escaping logic. For example, the faker plugin builds schema type names with
capitalize(normalizeName(name)), so for an OpenAPI schema namedErrorit tries to import/useError, whiletypes.gen.tsonly exports_Error.As a result, generated files can reference a type that does not exist, causing TypeScript errors when schemas have names like
Error,Array,Date,Promise, etc. Apicraft should either mirror@hey-api/openapi-tsidentifier escaping in its plugins or expose/pass through a consistent naming strategy so all generated files agree on schema type names.