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 #2098 from hey-api/chore/transformers-no-warn-const-number

chore(transformers): don't warn when schema is one of multiple numbers

authored by

Lubos and committed by
GitHub
bb2b1e0c 84ea5f8e

+14 -12
+9 -9
packages/openapi-ts-tests/test/openapi-ts.config.ts
··· 44 44 // openapi: '3.1.0', 45 45 // paths: {}, 46 46 // }, 47 - path: path.resolve(__dirname, 'spec', '2.0.x', 'full.json'), 47 + path: path.resolve(__dirname, 'spec', '3.1.x', 'full.json'), 48 48 // path: 'http://localhost:4000/', 49 49 // path: 'https://get.heyapi.dev/', 50 50 // path: 'https://get.heyapi.dev/hey-api/backend?branch=main&version=1.0.0', ··· 79 79 // bundle: true, 80 80 // bundleSource_EXPERIMENTAL: true, 81 81 // exportFromIndex: true, 82 - name: '@hey-api/client-next', 82 + name: '@hey-api/client-fetch', 83 83 // strictBaseUrl: true, 84 84 }, 85 85 { ··· 96 96 // serviceNameBuilder: '^Parameters', 97 97 // throwOnError: true, 98 98 // transformer: '@hey-api/transformers', 99 - // transformer: true, 100 - validator: 'zod', 99 + transformer: true, 100 + // validator: 'zod', 101 101 }, 102 102 { 103 - bigInt: true, 103 + // bigInt: true, 104 104 dates: true, 105 - // name: '@hey-api/transformers', 105 + name: '@hey-api/transformers', 106 106 }, 107 107 { 108 108 // enums: 'typescript+namespace', 109 109 enums: 'javascript', 110 110 // enumsCase: 'camelCase', 111 - enumsConstantsIgnoreNull: true, 112 - exportInlineEnums: true, 111 + // enumsConstantsIgnoreNull: true, 112 + // exportInlineEnums: true, 113 113 // identifierCase: 'preserve', 114 114 name: '@hey-api/typescript', 115 115 // readOnlyWriteOnlyBehavior: 'off', ··· 122 122 }, 123 123 { 124 124 exportFromIndex: true, 125 - name: '@tanstack/react-query', 125 + name: '@tanstack/vue-query', 126 126 }, 127 127 { 128 128 // comments: false,
+5 -3
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 - console.warn( 439 - `❗️ 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`, 440 - ); 438 + if (!schema.items.every((item) => item.type === 'number')) { 439 + console.warn( 440 + `❗️ 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 + ); 442 + } 441 443 } 442 444 } 443 445