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

SWR/React Query: Custom error type model is not imported when mock: true #1273

Closed
AllieJonsson opened this issue Mar 20, 2024 · 0 comments · Fixed by #1274
Closed

SWR/React Query: Custom error type model is not imported when mock: true #1273

AllieJonsson opened this issue Mar 20, 2024 · 0 comments · Fixed by #1274
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AllieJonsson
Copy link
Contributor

What are the steps to reproduce this issue?

  1. Change petstore.yaml and rename components/schemas/Error to components/schemas/ErrorX (make sure to also change the name of the component in the bottom of the file)
  2. yarn generate:swr
  3. See that generated code is export type ListPetsQueryError = AxiosError<ErrorX>, which is correct, but ErrorX is not imported from ./model

What happens?

Compile error, it seems like it used to import the ts default Error interface instead of the actual error model.

What were you expecting to happen?

The error model should be imported

Any logs, error output, etc?

image

What versions are you using?

Package Version: 6.25.0

@melloware melloware added the bug Something isn't working label Mar 20, 2024
@AllieJonsson AllieJonsson changed the title SWR/React Query: Custom error type model is not imported SWR/React Query: Custom error type model is not imported when mocking: true Mar 20, 2024
@AllieJonsson AllieJonsson changed the title SWR/React Query: Custom error type model is not imported when mocking: true SWR/React Query: Custom error type model is not imported when mock: true Mar 20, 2024
@melloware melloware added this to the 6.26.0 milestone Mar 20, 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

Successfully merging a pull request may close this issue.

2 participants