Skip to content

Commit

Permalink
Fixes generating OpenAPI specs with duplicate response headers. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz authored Feb 23, 2024
1 parent fa0f84e commit 5b94e84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev-proxy-plugins/RequestLogs/OpenApiSpecGeneratorPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,12 @@ private void SetResponseFromSession(OpenApiOperation operation, Response respons
continue;
}

if (openApiResponse.Headers.ContainsKey(header.Name))
{
_logger?.LogDebug(" Header {headerName} already exists in response", header.Name);
continue;
}

openApiResponse.Headers.Add(header.Name, new OpenApiHeader
{
Schema = new OpenApiSchema { Type = "string" }
Expand Down

0 comments on commit 5b94e84

Please sign in to comment.