What is Schema Validation
Schema validation checks if your JSON document follows the correct Joyfill document structure before creating a form.Enabling/Disabling Schema Validation
Schema validation is enabled by default inrememberDocumentEditor:
How It Works
WhenvalidateSchema = true:
- Document is validated against the Joyfill schema during editor creation
- If validation fails, an error is set and the
onErrorcallback is triggered - If validation passes, the editor is created normally
Schema Error Types
| Error Type | Code | When It Happens | Example |
|---|---|---|---|
| SchemaError.Assertion | ERROR_SCHEMA_VALIDATION | Document structure doesn’t match schema rules | Missing required properties like files or fields |
| SchemaError.Format | ERROR_SCHEMA_FORMAT | JSON format is invalid | Empty/blank string or malformed JSON |
| SchemaError.Version | ERROR_SCHEMA_VERSION | Document version incompatible with SDK | Document created with newer SDK version |
Error Monitoring
Monitor schema errors reactively:Things to know
Schema validation is enabled by default (validateSchema = true). Disabling schema validation can lead to crashes and should only be used for testing. Schema errors include both user-friendly messages and technical details. Validation happens during editor creation, not during form interaction.