Decode a JSON object that is expected to be a string.
String decodeString(String jsonPath, Object? json) { if (json is String) { return json; } else { throw mismatch(jsonPath, 'String', json); } }