Closed vitorcamachoo closed 3 months ago
kubb
2.19.6
MacOs
@tanstack-query
MSW
React
Vue
"@kubb/cli": "^2.19.6", "@kubb/core": "^2.19.6", "@kubb/plugin-oas": "2.19.6", "@kubb/swagger": "2.19.6", "@kubb/swagger-client": "2.19.6", "@kubb/swagger-tanstack-query": "2.19.6", "@kubb/swagger-ts": "2.19.6",
// Kubb config
const transformers = { name(name: string, type?: "function" | "type" | "file" | undefined) { if (type === 'file') return `${name[0].toLowerCase() + name.slice(1)}`; return name; }, }; export default defineConfig({ root: '.', input: { path: './api/schema.yaml' }, output: { path: './src/api', clean: true, }, plugins: [ pluginOas({ output: false }), pluginTs({ output: { path: './model' }, enumType: 'asConst', transformers, }), pluginClient({ client: { importPath: '../../axios/custom-instance' }, output: { path: './api/index.ts' }, }), ], });
Based on this configuration, I was expecting that the @kubb/swagger-client would be aware of the name transformation. What is happening is that when importing the model types, the suffix "Schema" is not being added to the import:
@kubb/swagger-client
Every time
No response
Will be fixed as part of https://github.com/kubb-labs/kubb/issues/1031
What version of
kubb
is running?2.19.6
What platform is your computer?
MacOs
What version of external packages are you using(
@tanstack-query
,MSW
,React
,Vue
, ...)"@kubb/cli": "^2.19.6", "@kubb/core": "^2.19.6", "@kubb/plugin-oas": "2.19.6", "@kubb/swagger": "2.19.6", "@kubb/swagger-client": "2.19.6", "@kubb/swagger-tanstack-query": "2.19.6", "@kubb/swagger-ts": "2.19.6",
What steps can reproduce the bug?
// Kubb config
Based on this configuration, I was expecting that the
@kubb/swagger-client
would be aware of the name transformation. What is happening is that when importing the model types, the suffix "Schema" is not being added to the import:How often does this bug happen?
Every time
What is the expected behavior?
No response
Swagger/OpenAPI file?
No response
Additional information
No response