Skip to content

Commit

Permalink
Disambiguating ProblemDetails usages in the HTTP generated code. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Nov 14, 2023
1 parent b77c96c commit b44ba3e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Http/Wolverine.Http/HttpChain.Codegen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using JasperFx.Core;
using JasperFx.Core.Reflection;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Wolverine.Http.CodeGen;
using Wolverine.Http.Resources;
Expand Down Expand Up @@ -101,6 +102,11 @@ internal IEnumerable<Frame> DetermineFrames(GenerationRules rules)
{
result.OverrideName("result" + ++index);
}

foreach (var details in frame.Creates.Where(x => x.VariableType.CanBeCastTo<ProblemDetails>()))
{
details.OverrideName(details.Usage + ++index);
}

yield return frame;
}
Expand Down

0 comments on commit b44ba3e

Please sign in to comment.