toJson method
Returns a JSON presentation of the object.
Implementation
@override
Map<String, Object> toJson({ClientUriConverter? clientUriConverter}) {
var result = <String, Object>{};
result['severity'] = severity.toJson(
clientUriConverter: clientUriConverter,
);
result['type'] = type.toJson(clientUriConverter: clientUriConverter);
result['location'] = location.toJson(
clientUriConverter: clientUriConverter,
);
result['message'] = message;
var correction = this.correction;
if (correction != null) {
result['correction'] = correction;
}
result['code'] = code;
var url = this.url;
if (url != null) {
result['url'] = url;
}
var contextMessages = this.contextMessages;
if (contextMessages != null) {
result['contextMessages'] =
contextMessages
.map(
(DiagnosticMessage value) =>
value.toJson(clientUriConverter: clientUriConverter),
)
.toList();
}
var hasFix = this.hasFix;
if (hasFix != null) {
result['hasFix'] = hasFix;
}
return result;
}