fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2118 from hey-api/fix/transformers-skip-warn

chore: do not warn on primitive values in transformers

authored by

Lubos and committed by
GitHub
142db661 8ae09612

+10 -2
+1 -1
packages/openapi-ts-tests/test/openapi-ts.config.ts
··· 29 29 // '/^[A-Z]+ /v1//', 30 30 ], 31 31 }, 32 - orphans: false, 32 + // orphans: false, 33 33 // preserveOrder: true, 34 34 // tags: { 35 35 // exclude: ['bar'],
+9 -1
packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts
··· 435 435 436 436 // assume enums do not contain transformable values 437 437 if (schema.type !== 'enum') { 438 - if (!schema.items.every((item) => item.type === 'number')) { 438 + if ( 439 + !(schema.items ?? []).every((item) => 440 + ( 441 + ['boolean', 'integer', 'null', 'number', 'string'] as ReadonlyArray< 442 + typeof item.type 443 + > 444 + ).includes(item.type), 445 + ) 446 + ) { 439 447 console.warn( 440 448 `❗️ Transformers warning: schema ${JSON.stringify(schema)} is too complex and won't be currently processed. This will likely produce an incomplete transformer which is not what you want. Please open an issue if you'd like this improved https://github.com/hey-api/openapi-ts/issues`, 441 449 );