Open csehatt741 opened 2 years ago
I have the same kind of warning using an equivalent configuration:
Command: openapi2csclient JsonLibrary: Newtonsoft.Json NSwag version: 13.15.10.0
I have a route responding a text/plain
content-type, I have this code generated :
if (status_ == 200)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string)); // [CS8600] Converting null literal or possible null value to non-nullable type.
return result_;
}
and this is giving me this warning : [CS8600] Converting null literal or possible null value to non-nullable type.
Still the same with NSwag.MSBuild 13.16.1
Still seeing this in 13.18.0
When the request body is required and nullable reference types are allowed in the project containing the generated code, warnings are raised in the generated client.
Command: openapi2csclient JsonLibrary: SystemTextJson NSwag version: 13.15.10.0
OpenAPI:
Required fixes:
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
->