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

Kubb loses the path to the files if $ref is used #990

Closed
aaronb-reach opened this issue May 9, 2024 · 2 comments
Closed

Kubb loses the path to the files if $ref is used #990

aaronb-reach opened this issue May 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@aaronb-reach
Copy link

aaronb-reach commented May 9, 2024

What version of kubb is running?

kubb/2.18.1 linux-x64 node-v20.11.0

What platform is your computer?

Linux/MacOS

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

{
  "name": "kubb",
  "version": "1.0.0",
  "scripts": {
    "generate": "kubb generate --config kubb.config.js"
  },
  "devDependencies": {
    "@kubb/cli": "^2.18.1",
    "@kubb/core": "^2.18.1",
    "@kubb/swagger": "^2.18.1",
    "@kubb/swagger-ts": "^2.18.1",
    "@kubb/swagger-zod": "^2.18.1"
  }
}

What steps can reproduce the bug?

When trying to generate types for yml docs that include a $ref to a relative path, the file at the relative path is not found

Screenshot 2024-05-09 at 12 14 01

This seems similar to #859 which states v2.14.0 fixed this, but i am still seeing this with v2.18.1. Am i missing something?

Many thanks!

Reproduction of issue: https://github.com/burt202/kubb-test
Line where $ref is used: https://github.com/burt202/kubb-test/blob/master/docs/main.yml#L30

To recreate:

  • clone repo above
  • npm ci
  • npm run generate

How often does this bug happen?

Every time

What is the expected behavior?

It should import from path of input not path of kubb config

Swagger/OpenAPI file?

Included in linked test repo

Additional information

No response

@aaronb-reach aaronb-reach added the bug Something isn't working label May 9, 2024
@stijnvanhulle
Copy link
Collaborator

@aaronb-reach Replaced the bundle logic by the one of @redocly/openapi-core and that one seems to do the trick. v2.18.2 will resolve your issue :)

@aaronb-reach
Copy link
Author

aaronb-reach commented May 10, 2024

Wow that was quick! Much appreciated! I can confirm v2.18.2 fixed the issue

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

2 participants