Skip to content

Commit d3caff7

Browse files
Merge branch 'main' into v028
2 parents 10eff8a + a05e85d commit d3caff7

File tree

3 files changed

+11
-198
lines changed

3 files changed

+11
-198
lines changed

dev-proxy-plugins/Mocks/GraphConnectorNotificationPlugin.cs

Lines changed: 0 additions & 195 deletions
This file was deleted.

dev-proxy-plugins/TypeSpec/Http.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

schemas/v0.28.0/rc.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@
184184
"plugins"
185185
],
186186
"additionalProperties": true
187-
}
187+
}

0 commit comments

Comments
 (0)