FDC3 should avoid union types in contexts and other objects
Both Typescript and JSON Schema allow for a type of polymorphism in types and interfaces that is hard to represent in other languages: allowing the type of a variable to be a union of other, unrelated types. E.g.: in typescript
type Example = SomeOtherType | YetAnotherType;
Similar things are possible in JSON Schema by using the anyOf or oneOf keywords to type a field.
This can sometimes be handled via a marker interface in another language (e.g. .NET or Java), i.e having a class or interface extend/implement an interface with little or no functionality, just so it can be used as the type for the field, allowing any of the classes that 'implement' it to be set as values. However, this approach is not possible if one of the types in the union is a primitive, meaning it's not a class and can't be modifed, e.g.:
type Example2 = SomeOtherType | string;
Hence, if FDC3 is intended to be implemented in other languages it should avoid, whereever possible, the use of constructs like this cthat cannot easily be represented in other languages - particularly .NET and Java.
Add guidance/a strong recommendation to the context specification: https://fdc3.finos.org/docs/context/spec#field-type-conventions, https://fdc3.finos.org/docs/supported-platforms and https://fdc3.finos.org/docs/api/spec#desktop-agent-implementation that FDC3 SHOULD NOT use union types or other constructs that are hard to represent in languages other than TypeScript or JSON Schema to ensure ease of implementation in those other languages.
@bingenito please feel free to add anything on your experience with this to the issue. I'll add it to the next SWG meeting agenda to discuss/vote on.