Closed wedi closed 3 years ago
I have the same issue.
Looks like the problem is about how we return the data from the axios:
return axios.patch<TData>( '/api/customer/${customer}', customerResource,options );
it will return not Promise<TData>
but Promise<AxiosResponse<TData>>
We just need to destruct the data field from the response
should be fixed
Works for me now! Thanks ❤️
Same for SWR
What are the steps to reproduce this issue?
Run orval with the following config using the OpenAPI specification at the bottom. N.B. Spec was generated with Orion, removed a DELETE request with body to achieve standard compliance.
Compile TypeScript:
tsc --build
with tsconfig from https://github.com/anymaniax/orval/tree/master/samples/react-app-with-react-query/ +outDir
+rootDir
.What happens?
Orval runs successfully. TypeScript result attached at the bottom.
Compilation fails with several errors (see below)
What were you expecting to happen?
Compile a working API client
Any logs, error output, etc?
What versions are you using?
Operating System:
macOS
Package Version:5.4.9
TypeScript Version:4.3.4
Browser Version:Not applicable
OpenAPI spec
TypeScript generated by Orval