Skip to content

Commit 72e5295

Browse files
Copilotmrlubos
andcommitted
Fix all enum modes: check for any enum, not just JavaScript
Co-authored-by: mrlubos <[email protected]>
1 parent 42eb018 commit 72e5295

File tree

1 file changed

+3
-6
lines changed
  • packages/openapi-ts/src/plugins/@hey-api/typescript

1 file changed

+3
-6
lines changed

packages/openapi-ts/src/plugins/@hey-api/typescript/plugin.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,16 +498,13 @@ const handleComponent = ({
498498
}) => {
499499
const type = schemaToType({ plugin, schema });
500500

501-
// Don't tag JavaScript enums as 'type' since they export both values and types
502-
const isJavaScriptEnum =
503-
schema.type === 'enum' &&
504-
plugin.config.enums.enabled &&
505-
plugin.config.enums.mode === 'javascript';
501+
// Don't tag enums as 'type' since they export runtime artifacts (values)
502+
const isEnum = schema.type === 'enum' && plugin.config.enums.enabled;
506503

507504
const symbol = plugin.registerSymbol({
508505
exported: true,
509506
meta: {
510-
kind: isJavaScriptEnum ? undefined : 'type',
507+
kind: isEnum ? undefined : 'type',
511508
},
512509
name: buildName({
513510
config: plugin.config.definitions,

0 commit comments

Comments
 (0)