Change in behaviour noticed between NSwagStudio 13.2.0 and 13.2.2.
With a swagger 2.0 yaml spec with this path definition:
paths:
'/my-path':
post:
tags:
- My Path
description: >-
My web api path
operationId: SomeOperation
parameters:
- $ref: '#/parameters/AuthorizationParam'
- $ref: '#/parameters/x-nlp-interaction-id-Param'
- in: body
name: MyRequestDTOBody
description: Input data
required: true
schema:
$ref: '#/definitions/MyRequestDTO'
responses:
'200':
$ref: '#/responses/200Woohoo'
an IClient is generated with "System.IO.Stream" type parameter instead of MyRequestDTO. eg
c#
System.Threading.Tasks.Task<WoohooResponse> SomeOperationAsync(string authorization, string x_nlp_interaction_id, System.IO.Stream myRequestDTOBody);
myRequestDTOBody should have type MyRequestDTO.
Can also you post the schema of MyRequestDTO?
Hi Rico, please find attached a simple test case that demonstrates the issue. I've included the two C# clients generated from the two different versions of NSwagStudio.
I also experienced this issue when attempting to generate a C# client from a swagger 2.0 JSON doc generated with Haskell and Servant for an API. It did exactly what @philmccarthy40 described. The fix was to revert to NSwag version 13.2.0.
Hmm, is it a regression of one of these?
https://github.com/RicoSuter/NSwag/commit/4fbc0ccf65750f6e5d36abb0218da0862b6b96c7
https://github.com/RicoSuter/NSwag/pull/2633/files
Any updates on this one? I'm having a swagger 2.0 json spec and since I updated NSwag from 13.0.4.0 to 13.6.0.0 I am facing the same behavior...
Looks like that makes me stuck to the version 13.2.0
We changed this behavior in 13.7/13.8 (but for OAI 3) so maybe this is fixed?
I've regenerated the test case using NSwagStudio 13.8.1; visually comparing the generated C# outputs, I can confirm the issue has been fixed. Many thanks @RicoSuter 馃憤