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
When saving workflows containing custom generic subject builder types derived from SubjectBuilder<T>, the XML serialization throws an error message complaining about duplicate types.
Digging deeper it looks like there might be a fundamental issue with XML serialization of generic types when the serialized types are not part of the default XML namespace (and thus contain qualified namespace prefix strings such as p1:CustomType , etc).
In these cases, the encoding and decoding of generic type names seems not to account for the existence of XML prefixes. For example, during serialization:
In this case, if the decoded text is a XML qualified name containing a prefix, the generic type map will not recognize the type signature, as XML prefixes are unique only within the specific document scope. The correct behavior would be to send to the lookup the fully expanded type name without the XML prefix. This would suffice as the namespace is already fully expanded in previous steps.
The expanding of typeRef.BaseType with the type namespace fails to account for the fact that the base type string value might contain a XML qualified name with a prefix, in which case the string to be encoded might end up having the format MyNamespace.p1:MyType instead of p1:MyNamespace.MyType.
The text was updated successfully, but these errors were encountered:
When saving workflows containing custom generic subject builder types derived from
SubjectBuilder<T>
, the XML serialization throws an error message complaining about duplicate types.Digging deeper it looks like there might be a fundamental issue with XML serialization of generic types when the serialized types are not part of the default XML namespace (and thus contain qualified namespace prefix strings such as
p1:CustomType
, etc).In these cases, the encoding and decoding of generic type names seems not to account for the existence of XML prefixes. For example, during serialization:
bonsai/Bonsai.Core/WorkflowBuilder.cs
Lines 1217 to 1218 in 4b52d86
In this case, if the decoded
text
is a XML qualified name containing a prefix, the generic type map will not recognize the type signature, as XML prefixes are unique only within the specific document scope. The correct behavior would be to send to the lookup the fully expanded type name without the XML prefix. This would suffice as the namespace is already fully expanded in previous steps.Conversely, during deserialization:
bonsai/Bonsai.Core/WorkflowBuilder.cs
Lines 784 to 791 in 4b52d86
The expanding of
typeRef.BaseType
with the type namespace fails to account for the fact that the base type stringvalue
might contain a XML qualified name with a prefix, in which case the string to be encoded might end up having the formatMyNamespace.p1:MyType
instead ofp1:MyNamespace.MyType
.The text was updated successfully, but these errors were encountered: