toJson method
Implementation
Map<String, dynamic> toJson() => {
'code': code,
'severity': severity.name,
'message': message,
if (schemaName != null) 'schemaName': schemaName,
if (canonicalField != null) 'canonicalField': canonicalField,
if (jsonPath != null) 'jsonPath': jsonPath,
if (jsonPointer != null) 'jsonPointer': jsonPointer,
if (valueKey != null) 'valueKey': valueKey,
if (hasValue) 'value': JsonValue.clone(value),
if (validation != null) 'validation': validation!.toJson(),
};