Strip parens in Path parameter (#138)

This commit is contained in:
Patrick Stevens
2024-05-24 20:36:12 +01:00
committed by GitHub
parent 61b07ad802
commit e80ed51498
4 changed files with 41 additions and 3 deletions

View File

@@ -763,7 +763,7 @@ module internal HttpClientGenerator =
| "WoofWare.Myriad.Plugins.RestEase.PathAttribute"
| "Path"
| "PathAttribute" ->
match attr.ArgExpr with
match attr.ArgExpr |> SynExpr.stripOptionalParen with
| SynExpr.Const (SynConst.String (s, SynStringKind.Regular, _), _) ->
Some (HttpAttribute.Path (PathSpec.Verbatim s))
| SynExpr.Const (SynConst.Unit, _) -> Some (HttpAttribute.Path PathSpec.MatchArgName)