-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response Status and Headers #3557
Comments
@ahbagheri in NSwag client config set The result of client methods will be warpped with ApiResponse, which contains StatusCode and Headers. |
Where can I set that configuration? |
If you are using NSwagStudio (I'm using v1315.5.0), then the option is in the |
I have noticed if I add the ControllerName.MethodName no SwaggerResponse objects are generated. If I leave blank then all are generated |
That's unfortunately a bit ugly... you need to set them inside an <OpenApiReference Include="..\api\swagger-v1.json">
<Namespace>Weather</Namespace>
<ClassName>"{controller}Client"</ClassName>
<Options>/WrapResponses:true /ResponseClass:"ApiResponse"</Options>
</OpenApiReference> Space separated, just as you would pass it to the CLI. |
What's the difference (functionally or with intent) between |
I think it's mostly a branding thing - Swagger was the name of the early specification/tooling; but now it has become OpenAPI, so it makes sense to rename the response class in line with that. |
I am using NSwag Extension in VS2019 to generate the client code. Everything work well except:
I cannot get the http response headers.
I want to know the http response status.
Any ideas how to do resolve it?
The text was updated successfully, but these errors were encountered: