Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    Interface DataModelValidationOptions

    interface DataModelValidationOptions {
        changes?: object;
        clean?: boolean | Omit<DataModelCleaningOptions, "partial">;
        dropInvalidElements?: boolean;
        dropInvalidEmbedded?: boolean;
        fallback?: boolean;
        model?: DataModel<object, DataModelConstructionContext>;
        strict?: boolean;
    }
    Index

    Properties

    changes?: object

    A specific set of proposed changes to validate, rather than the full source data of the model. This type of validation is redirected to DataModel#updateSource as a dry-run.

    clean?: boolean | Omit<DataModelCleaningOptions, "partial">

    Configuration of data cleaning steps applied to user input data. This can be explicitly passed as false which requires the provided data to already be clean.

    dropInvalidElements?: boolean

    For Array-like fields, control whether an invalid element is allowed to be removed from the data in lieu of fallback replacement.

    dropInvalidEmbedded?: boolean

    If true, invalid embedded documents will emit a warning and be placed in the invalidDocuments collection rather than causing the parent to be considered invalid. This option mutates the provided changes.

    fallback?: boolean

    Allow replacement of invalid values with valid defaults? This option mutates the provided changes.

    The data model instance being validated. This is automatically populated during the model validation flow.

    strict?: boolean

    Throw an error if validation fails.