Hi, while I suspect this is potentially a bad (or one that can be worked around/improved) openapi json service definition, this segment:
...
"responses": {
"201": {
"description": "ID of the newly created container"
},
generates the following "bad" c#:
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
...
public virtual async System.Threading.Tasks.Task MyMethodAsync(Sometype body, System.Threading.CancellationToken cancellationToken)
{
...
if (status_ == 201)
{
return default(void); // compile error here: Error CS1547 Keyword 'void' cannot be used in this context
}
...
I don't have control over the service json - it's delivered to us by an external entity over an http call. It might be automatically generated by Azure. Mentioning this to make the point that right or wrong, it's a real world scenario.
Note that we - the consumer - are on Windows, Visual Studio 2022 Pro (up-to-date), targeting latest stable nuget-s (see pic). Project settings:
Hi, while I suspect this is potentially a bad (or one that can be worked around/improved) openapi json service definition, this segment:
generates the following "bad" c#:
I don't have control over the service json - it's delivered to us by an external entity over an http call. It might be automatically generated by Azure. Mentioning this to make the point that right or wrong, it's a real world scenario.
Note that we - the consumer - are on Windows, Visual Studio 2022 Pro (up-to-date), targeting latest stable nuget-s (see pic). Project settings:
And I want to use the opportunity to thank you for your service - your work has been outstanding! Thank you!