Skip to content

Commit f91c99b

Browse files
authored
Set content type for OpenAPI JSON document (#56097)
1 parent f36ba39 commit f91c99b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/OpenApi/src/Extensions/OpenApiEndpointRouteBuilderExtensions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public static IEndpointConventionBuilder MapOpenApi(this IEndpointRouteBuilder e
5050
try
5151
{
5252
document.Serialize(new OpenApiJsonWriter(writer), documentOptions.OpenApiVersion);
53+
context.Response.ContentType = "application/json;charset=utf-8";
5354
await context.Response.BodyWriter.WriteAsync(output.ToArray(), context.RequestAborted);
5455
await context.Response.BodyWriter.FlushAsync(context.RequestAborted);
5556
}

0 commit comments

Comments
 (0)