Hello! First, let me thank you for writing this library! Please enjoy a cup of coffee on me!
We use your library for a project at my company and it's made our lives a lot easier! We've been using v0.5.3 for a while, but as part of another effort, I'm updating to v1.4.1. I noticed that some of our OAPI documents are tripping up the react query codegen and wanted to investigate.
I forked your repo and built it locally (which btw required some liberal use of any casting to get the project to build on my M3 mac--node 20, TS 5.5.x--but I removed all of those before committing my fix). I threw in some console.logs in createUseMutation, and in the methodParameters section, refParam.type.getText(param) was returning something in the following shape (paths, param names and type names edited, of course):
As you can see, it's setting type1's type to Type3, which is incorrect. I discovered that the wildcard in getShortType was greedy, and that making it non-greedy would indeed fix the problem. I included a test with data in the same shape as my case.
Barring any issues with the PR, it would be very helpful for us if we could get this releases ASAP. Please let me know if there's anything further you need from me!
Hello! First, let me thank you for writing this library! Please enjoy a cup of coffee on me!
We use your library for a project at my company and it's made our lives a lot easier! We've been using
v0.5.3
for a while, but as part of another effort, I'm updating tov1.4.1
. I noticed that some of our OAPI documents are tripping up the react query codegen and wanted to investigate.I forked your repo and built it locally (which btw required some liberal use of
any
casting to get the project to build on my M3 mac--node 20, TS 5.5.x--but I removed all of those before committing my fix). I threw in someconsole.logs
increateUseMutation
, and in themethodParameters
section,refParam.type.getText(param)
was returning something in the following shape (paths, param names and type names edited, of course):This was producing a mutation type signature that looked like this:
As you can see, it's setting
type1
's type toType3
, which is incorrect. I discovered that the wildcard ingetShortType
was greedy, and that making it non-greedy would indeed fix the problem. I included a test with data in the same shape as my case.Barring any issues with the PR, it would be very helpful for us if we could get this releases ASAP. Please let me know if there's anything further you need from me!