decodeLine static method
Decode one NDJSON line into a message map.
Throws FormatException on garbage input — the host converts that
into a schema error envelope rather than dying.
Implementation
static Map<String, Object?> decodeLine(String line) {
final decoded = jsonDecode(line);
if (decoded is! Map) {
throw FormatException(
'ZAP lines are JSON objects; got '
'${decoded.runtimeType}',
);
}
return decoded.cast<String, Object?>();
}