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
When returning the ApiResponse, the method ToDictionary is used to construct a response object from a raw API response. The method ToDictionary will expect only unique keys, but this is not always the case. For example, headers could repeat which would cause the code to end in an exception.
Here is an example from the generated code:
returnnewApiResponse<KeycloakTokenResponse>(localVarStatusCode,localVarResponse.Headers.ToDictionary(x =>x.Name, x =>string.Join(",",x.Value)),(KeycloakTokenResponse)this.Configuration.ApiClient.Deserialize(localVarResponse,typeof(KeycloakTokenResponse)));nResponse)this.Configuration.ApiClient.Deserialize(localVarResponse,typeof(KeycloakTokenResponse)));
and here is the modification I had to make:
returnnewApiResponse<KeycloakTokenResponse>(localVarStatusCode,localVarResponse.Headers.GroupBy(x =>x.Name).ToDictionary(g =>g.Key, g =>g.Select(x =>x.Value).ToString()),(KeycloakTokenResponse)this.Configuration.ApiClient.Deserialize(localVarResponse,typeof(KeycloakTokenResponse)));
This workaround means that duplicates are allowed in the response headers. I believe this should be part of the generated code, but I am asking for any contrasting opinion.
The text was updated successfully, but these errors were encountered:
When returning the ApiResponse, the method ToDictionary is used to construct a response object from a raw API response. The method ToDictionary will expect only unique keys, but this is not always the case. For example, headers could repeat which would cause the code to end in an exception.
Here is an example from the generated code:
and here is the modification I had to make:
This workaround means that duplicates are allowed in the response headers. I believe this should be part of the generated code, but I am asking for any contrasting opinion.
The text was updated successfully, but these errors were encountered: