validateOrThrow method
Throws VxsFormatException on the first validation issue.
Implementation
void validateOrThrow(
VxsSchema schema, {
bool allowUnknown = true,
int maxDepth = 8,
}) {
final issues = validate(
schema,
allowUnknown: allowUnknown,
maxDepth: maxDepth,
);
if (issues.isNotEmpty) {
throw VxsFormatException(
issues.first.toString(),
offset: issues.first.offset,
);
}
}