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

The plugin "@kubb/plugin-client" is not respecting the "include" option by generating files for all endpoints. #1525

Closed
lucivaldo opened this issue Jan 20, 2025 · 1 comment
Labels
bug Something isn't working @kubb/plugin-client

Comments

@lucivaldo
Copy link

What version of kubb is running?

3.5.1

What kind of platform do you use?

None

How does your kubb.config.ts config look like

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

export default defineConfig({
  root: '.',
  input: {
    path: './.tmp/myproject-swagger-api.json',
  },
  output: {
    path: './src/lib/myproject-client/gen',
    clean: true,
  },
  plugins: [
    pluginOas({ generators: [] }),
    pluginTs({}),
    pluginClient({
      include: [
        {
          type: 'operationId',
          pattern:
            /operation_a_list|operation_b_list/,
        },
      ],
    }),
    pluginReactQuery({
      suspense: false,
      mutation: {
        methods: ['get', 'delete', 'patch', 'post', 'put'],
      },
    }),
  ],
})

Swagger/OpenAPI file?

I can't provide

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

"@tanstack/react-query": "^5.64.2"
"react": "^18"

What steps can reproduce the bug?

  1. Set up kubb with version 3.5.1 on a Linux platform.
  2. Configure the plugin @kubb/plugin-client and include the include option in the settings.
  3. Run the kubb command to generate the files.
  4. Note that the files generated in the "client" directory are not only those listed in "include", but all client files from all endpoints.

How often does this bug happen?

Every time

What is the expected behavior?

Only the files specified in the "include" option should be generated as part of the output for the directory "client".

Additional information

No response

@lucivaldo lucivaldo added the bug Something isn't working label Jan 20, 2025
@lucivaldo
Copy link
Author

Note: doing other tests I noticed that the plugin only doesn't work when the "type" option is set to "operationId".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working @kubb/plugin-client
Projects
None yet
Development

No branches or pull requests

2 participants