orval-labs / orval

orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. 🍺
https://orval.dev
MIT License
3.03k stars 333 forks source link

ErrorType should be providable within the config #1613

Open maastrich opened 2 months ago

maastrich commented 2 months ago

What are the steps to reproduce this issue?

  1. create a shared file for multiple orval clients
  2. reexport all the shared elements in the customInstance.ts
  3. ErrorType is exported but not within the customInsance.ts so not taken in account

What happens?

the ErrorType does not wrap errors

What were you expecting to happen?

the ErrorType to wrap errors

Any other comments?

It could be provided with a output.overrides.mutator.errorTypeName config field instead of reading file content (i'll be happy to open a PR)

What versions are you using?

System: OS: macOS 14.6.1 CPU: (10) arm64 Apple M1 Max Memory: 175.91 MB / 32.00 GB Shell: 3.7.1 - /opt/homebrew/bin/fish npmPackages: @tanstack/react-query: ^4.29.7 => 4.29.7 orval: ^6.31.0 => 6.31.0

melloware commented 2 months ago

PR is welcome! This has been asked for in the past: https://github.com/orval-labs/orval/issues/258