Open lucianaparaschivei opened 6 months ago
Is this still an issue with v14.0.7?
/cc @paulomorgado
I am seeing this issue present in v14.0.7
edit. Disregard. It looks like in my case it was a stale template
I'm having this issue. What do you mean by stale template? How can I check if this is my problem?
I'm having this issue. What do you mean by stale template? How can I check if this is my problem?
In my case I have custom liquid templates (to return a wrapped exception instead of throwing them). Changes in the repo required me to merge those into my custom templates. It's an edge case and probably not what you're experiencing.
I'm having this issue. What do you mean by stale template? How can I check if this is my problem?
In my case I have custom liquid templates (to return a wrapped exception instead of throwing them). Changes in the repo required me to merge those into my custom templates. It's an edge case and probably not what you're experiencing.
Urg, okay. Thanks for the answer regardless! I don't think I'm using any custom templates, but once I went from NSwag v13 to v14, it's generating with an extra Append of the parameter NAME after it appends the actual VALUE of the parameter :(
@Soulfire86,
I'm having this issue. What do you mean by stale template? How can I check if this is my problem?
In my case I have custom liquid templates (to return a wrapped exception instead of throwing them). Changes in the repo required me to merge those into my custom templates. It's an edge case and probably not what you're experiencing.
Urg, okay. Thanks for the answer regardless! I don't think I'm using any custom templates, but once I went from NSwag v13 to v14, it's generating with an extra Append of the parameter NAME after it appends the actual VALUE of the parameter :(
Can you provide an example?
@paulomorgado Much to my day-long frustration, I realized I had no Parameter filter to set all route parameters to Required. Once they were required, the code generation turned out alright. So, I don't have screenshots, but that would be my example:
With optional parameters (which should not be the case for route parameters I know) the c# client was building methods where it'd append the parameter value where it should go, but then append "{parameterName}" right after it, thus making invalid URLs to my API.
Certainly my fault I suppose, but what a weird thing to happen. Clearly v13 didn't care that the parameters weren't required, it was generating appropriate code just fine.
@Soulfire86, can you provide a sample Swagger/OpenAPI doc for that?
@paulomorgado Sorry, bit crunched now to be thorough, but I actually did just come across another example, even with parameter set to required. relevant path from swagger.json:
Generated C# client method code, up until offending Append issue:
@Soulfire86, can you post the actual swagger?
with nswag 14 it looks like it is generating query string parameter append instead of replace leading to wrong url generation.
in screenshot on the left is generated with nswag 14 and on right (correct one) is with nswag 13.x same settings and open api spec was used for the generation