Skip to content

Multiple type definitions behavior questions #410

@SachaG

Description

@SachaG

I would love some more details about the expected validation behavior when defining multiple types for a field (as outlined in the Multiple Definitions For One Key section).

If I define that a field can be of type Foo or type Bar, is the field validated against both types successively and passes if at least one of the type's validation passes?

Is there a way to define a function to manually indicate which type should be used? My use case is making a survey builder. Depending on the survey being filled out, the data field of my documents can be different, but I know what to expect so ideally I would be able to specify which of the multiple possible survey schemas to validate the document against. Does that make sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions