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.18k stars 336 forks source link

How to modify generated types for custom fetch client? #1707

Closed SamyZog closed 3 days ago

SamyZog commented 3 days ago

What are the steps to reproduce this issue?

Types are generated in a certain structure when using the fetch client instead of axios

{ data, status }, is there a way to return it as only data

example

export type userRigsListResponse = {
  data: PaginatedRigListUserListDTO;
  status: number;
};

What happens?

What were you expecting to happen?

Any logs, error output, etc?

Any other comments?

What versions are you using?

Please execute npx envinfo --system --npmPackages orval,zod,axios,msw,swr,@tanstack/react-query,@tanstack/vue-query,react,vue and paste the results here.

melloware commented 3 days ago

Yes see this answer for 7.2.0: https://gurubase.io/g/orval/orval-fetch-client-return-only-data

On 7.3.0 its includeHttpResponseReturnType

SamyZog commented 3 days ago

Thank you!