You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d046cb4
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: migrate modular block converter template to System.Text.Json
- Update CreateHelperClass()'s emitted FieldExists signature from
JObject to JsonObject
- Rewrite CreateModularBlockConverter()'s emitted converter from
Newtonsoft's ReadJson()/WriteJson()/serializer.Populate() to STJ's
Read()/Write(), using a parse-then-deserialize-and-replace pattern
that restores the BlockType discriminator after re-deserializing
the concrete block type
sb.AppendLine(" var token = jObject[ContentstackHelper.GetDescription(target.BlockType)];");
1194
+
sb.AppendLine(" if (token != null)");
1195
+
sb.AppendLine(" {");
1196
+
sb.AppendLine($" var filled = JsonSerializer.Deserialize(token.ToJsonString(), target.GetType(), new JsonSerializerOptions {{ PropertyNameCaseInsensitive = true }}) as {className};");
0 commit comments