Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is the type name casing being transformed? #1481

Open
nicholaschiang opened this issue Dec 18, 2024 · 0 comments
Open

Why is the type name casing being transformed? #1481

nicholaschiang opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nicholaschiang
Copy link

nicholaschiang commented Dec 18, 2024

What version of kubb is running?

3.3.3

What kind of platform do you use?

None

How does your kubb.config.ts config look like

import { defineConfig } from '@kubb/core'
import { pluginOas } from '@kubb/plugin-oas'
import { pluginTs } from '@kubb/plugin-ts'
import { pluginZod } from '@kubb/plugin-zod'
import { pluginReactQuery } from '@kubb/plugin-react-query'

export default defineConfig({
  root: '.',
  input: {
    path: './openapi.json',
  },
  output: {
    path: './app/kubb',
    extension: { '.ts': '', '.tsx': '', '.js': '', '.json': '.json' },
  },
  plugins: [
    pluginOas(),
    pluginTs({
      enumType: 'enum',
      enumSuffix: '',
      unknownType: 'unknown',
    }),
    pluginZod({
      unknownType: 'unknown',
    }),
    pluginReactQuery({
      paramsType: 'object',
      paramsCasing: 'camelcase',
      client: {
        importPath: '~/client/kubb',
      },
      mutation: {
        importPath: '~/client/kubb',
      },
      suspense: false,
    }),
  ],
})

Swagger/OpenAPI file?

The full openapi.json file was too large to include in the issue text. You can find it here instead.

What version of external packages are you using(@tanstack-query, MSW, React, Vue, ...)

No response

What steps can reproduce the bug?

  1. Generate kubb.
  2. Notice how the MessageAPIResponse schema has been renamed to MessageApiResponse in the generated types. Why does this happen? Is this behavior configurable? Or can we fix the PascalCase converter used by Kubb to respect the MessageAPIResponse casing?

How often does this bug happen?

None

What is the expected behavior?

The generated type name should be MessageAPIResponse instead of MessageApiResponse.

Additional information

Potentially related to #1395.

@nicholaschiang nicholaschiang added the bug Something isn't working label Dec 18, 2024
@nicholaschiang nicholaschiang changed the title Why are type names being transformed? Why is the type name casing being transformed? Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant