const FooSchema = Struct({
identifier: Literal("foo"),
someProp: String
});
const BarSchema = Struct({
identifier: Literal("bar"),
someOtherProp: String
});
const FooOrBar = Union(FooSchema, BarSchema);
const ParentSchema = Struct({
id: String,
fooOrBar: FooOrBar
});
const FooSchema = Struct({
identifier: Literal("foo"),
someProp: String
});
const BarSchema = Struct({
identifier: Literal("bar"),
someOtherProp: String
});
const FooOrBar = Union(FooSchema, BarSchema);
const ParentSchema = Struct({
id: String,
fooOrBar: FooOrBar
});