File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
dev-proxy-plugins/TypeSpec Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ override public string ToString()
180180 sb . AppendLine ( $ "@useAuth({ Auth . ToString ( ) } )") ;
181181 }
182182 sb . Append ( $ "op { Name } (") ;
183- sb . AppendJoin ( ", " , Parameters . Select ( p => p . ToString ( ) ) ) ;
183+ sb . AppendJoin ( ", " , Parameters . Select ( p => p . ToString ( this ) ) ) ;
184184 sb . Append ( "): " ) ;
185185 sb . AppendJoin ( " | " , Responses . Select ( r => r . GetModelName ( ) ) ) ;
186186 sb . Append ( ';' ) ;
@@ -266,11 +266,19 @@ internal class Parameter
266266 public required string Name { get ; init ; }
267267 public string ? Value { get ; init ; }
268268
269- override public string ToString ( )
269+ public override string ToString ( )
270+ {
271+ throw new NotImplementedException ( "Use ToString(Operation op) instead." ) ;
272+ }
273+
274+ public string ToString ( Operation op )
270275 {
271276 var value = Value ? . IndexOfAny ( [ ' ' , '/' , '-' , ';' ] ) == - 1
272277 ? Value
273278 : $ "\" { Value } \" ";
279+ value = op . Method == HttpVerb . Patch && In == ParameterLocation . Body
280+ ? $ "MergePatchUpdate<{ value } >"
281+ : value ;
274282 if ( Name . IndexOf ( '-' ) > - 1 )
275283 {
276284 var target = Name ;
You can’t perform that action at this time.
0 commit comments