NSwag
NSwag copied to clipboard
JSON reviver being ignored if Axios is used
I recently switched from using Fetch
to Axios
so that I could use interceptors and I noticed that my reviver function that I'm using to parse date strings into Date objects is not being used anymore. The generated code does not seem to pass it into the JSON.Parse() function.
NSwag either needs an option to disable JSON.Parse() so I can handle it in my interceptors/transformResponse within Axios, or it should use the reviver if it is specified. Or perhaps both.
Without one of these options, either the data isn't transformed or an error is thrown as both Axios and NSwag will run duplicate JSON.Parse() calls.
I believe this might address https://github.com/RicoSuter/NSwag/issues/4973, https://github.com/RicoSuter/NSwag/issues/4468, https://github.com/RicoSuter/NSwag/issues/4134, and https://github.com/RicoSuter/NSwag/issues/4112