Skip to content

Commit cb7d5b4

Browse files
RazorSDK: Update TagHelperDescriptorJsonConverter to handle BoundAttributeParameterDescriptor changes
1 parent 54e4ac5 commit cb7d5b4

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/sdk/src/RazorSdk/Tool/TagHelperDescriptorJsonConverter.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,13 @@ private static void WriteBoundAttributeParameter(JsonWriter writer, BoundAttribu
239239
writer.WritePropertyName(nameof(BoundAttributeParameterDescriptor.Name));
240240
writer.WriteValue(boundAttributeParameter.Name);
241241

242+
writer.WritePropertyName(nameof(BoundAttributeParameterDescriptor.PropertyName));
243+
writer.WriteValue(boundAttributeParameter.PropertyName);
244+
242245
writer.WritePropertyName(nameof(BoundAttributeParameterDescriptor.TypeName));
243246
writer.WriteValue(boundAttributeParameter.TypeName);
244247

245-
if (boundAttributeParameter.IsEnum != default)
248+
if (boundAttributeParameter.IsEnum)
246249
{
247250
writer.WritePropertyName(nameof(BoundAttributeParameterDescriptor.IsEnum));
248251
writer.WriteValue(boundAttributeParameter.IsEnum);
@@ -260,9 +263,6 @@ private static void WriteBoundAttributeParameter(JsonWriter writer, BoundAttribu
260263
serializer.Serialize(writer, boundAttributeParameter.Diagnostics);
261264
}
262265

263-
writer.WritePropertyName(nameof(BoundAttributeParameterDescriptor.Metadata));
264-
WriteMetadata(writer, boundAttributeParameter.Metadata);
265-
266266
writer.WriteEndObject();
267267
}
268268

@@ -495,9 +495,9 @@ private static void ReadBoundAttributeParameter(JsonReader reader, BoundAttribut
495495

496496
builder.BindAttributeParameter(parameter =>
497497
{
498-
reader.ReadProperties(propertyName =>
498+
reader.ReadProperties(jsonPropertyName =>
499499
{
500-
switch (propertyName)
500+
switch (jsonPropertyName)
501501
{
502502
case nameof(BoundAttributeParameterDescriptor.Name):
503503
if (reader.Read())
@@ -506,6 +506,13 @@ private static void ReadBoundAttributeParameter(JsonReader reader, BoundAttribut
506506
parameter.Name = name;
507507
}
508508
break;
509+
case nameof(BoundAttributeParameterDescriptor.PropertyName):
510+
if (reader.Read())
511+
{
512+
var propertyName = (string)reader.Value;
513+
parameter.PropertyName = propertyName;
514+
}
515+
break;
509516
case nameof(BoundAttributeParameterDescriptor.TypeName):
510517
if (reader.Read())
511518
{
@@ -527,9 +534,6 @@ private static void ReadBoundAttributeParameter(JsonReader reader, BoundAttribut
527534
parameter.SetDocumentation(documentation);
528535
}
529536
break;
530-
case nameof(BoundAttributeParameterDescriptor.Metadata):
531-
ReadMetadata(reader, parameter.Metadata);
532-
break;
533537
case nameof(BoundAttributeParameterDescriptor.Diagnostics):
534538
ReadDiagnostics(reader, parameter.Diagnostics);
535539
break;

0 commit comments

Comments
 (0)