You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Endpoints with multiple results are ignored and appropriate code is not generated. No (reason/warning) message is showed, it's very confusing.
Nice solution is used by nswag. For response 200 generate correct result (function result type) and typed exception for others (any exception with json object is welcomed).
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Source>>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
{
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Error>>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<System.Collections.Generic.ICollection<Error>>("Processing error (unexpected)", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
---------- the end -----------------------
The text was updated successfully, but these errors were encountered:
Endpoints with multiple results are ignored and appropriate code is not generated. No (reason/warning) message is showed, it's very confusing.
Nice solution is used by nswag. For response 200 generate correct result (function result type) and typed exception for others (any exception with json object is welcomed).
------------ sample: json multiple responses ----------------
------------- sample: nswag implementation -----------------
---------- the end -----------------------
The text was updated successfully, but these errors were encountered: