#5682 broke serialization in two ways:
- When a generic type was being serialized, such as List`1, the ` was being escaped by JsonSerializer.Serialize to "\u0060". The PolymorphicObjectConverter would then .Trim('"') without unescaping the `, causing "\\u0060" to be written into the final json.
- When the type is generic with one type parameter, e.g. List<T>, and also IEnumerable<T>, as List<T> is, then it would append "[]" at the end of the type name, resulting in: "System.Collections.Generic.List\\u00601[[Elsa.Workflows.IntegrationTests.Serialization.JsonSerialization.WorkflowAction, Elsa.Workflows.IntegrationTests]], System.Private.CoreLib[]" which is very invalid. It may only do that, if the typename was simplified because the elementType is in the WellKnownTypeRegistry. And even then, this is questionable, as you'd be deserializing an string[] where you've serialized a List<string> for example.