Effect CommunityEC
Effect Community16mo ago
5 replies
ingun37

Best practice for “either both properties are null or required” in schema

I want to constraint two (or more) properties to be either both are required or both are null. I guess I could transform a Struct that initially has both as optional into a discriminated union type with some tag. But I wonder if there’s better way.
Was this page helpful?