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
A union member can be marked with jsonUnknown. This is what we call the catch-all case from now on.
only one member can be marked with the trait (structurallyExclusive should do the job here)
❓ To be confirmed: only Document or any document shape? Any document shape.
The deserialization process will wrap the entire document at the cursor in the catch-all case if it doesn't find a matching tag (in tagged unions), discriminator (in discriminated unions) or if neither member matches (in untagged unions)
Serialization of the catch-all case will write the entire document back.
This will be supported in JSON and Document (de)serialization only, as the trait s protocol-specific.
This would be a runtime-only change, meaning that codegen isn't going to be aware of the trait (only the interpreters/codecs would)
If I missed something, please let me know.
The text was updated successfully, but these errors were encountered:
Currently, we have a discrepancy between:
We already support open enums, and the maintainers are in agreement that open unions should be supported in some way, as an opt-in mechanism.
The current thinking is that we should extend the
alloy#jsonUnknown
trait in Alloy to work on unions.The desired semantics are as follows:
jsonUnknown
. This is what we call the catch-all case from now on.structurallyExclusive
should do the job here)To be confirmed: only Document or any document shape?Any document shape.This would be a runtime-only change, meaning that codegen isn't going to be aware of the trait (only the interpreters/codecs would)
If I missed something, please let me know.
The text was updated successfully, but these errors were encountered: