Enrich generated code with status code (#927)

This commit is contained in:
Cezary Piątek
2023-05-06 09:40:41 +02:00
committed by GitHub
parent 427715a38a
commit 1214ba5108
3 changed files with 8 additions and 0 deletions

View File

@@ -125,6 +125,11 @@ internal class MappingConverter
// Response
sb.AppendLine(" .RespondWith(Response.Create()");
if (response.ResponseMessage.StatusCode is { } statusCode)
{
sb.AppendLine($" .WithStatusCode({statusCode})");
}
if (response.ResponseMessage.Headers is { })
{
foreach (var header in response.ResponseMessage.Headers)