AnalysisSetContextRootsParams.fromJson constructor
AnalysisSetContextRootsParams.fromJson(})
Implementation
factory AnalysisSetContextRootsParams.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
List<ContextRoot> roots;
if (json.containsKey('roots')) {
roots = jsonDecoder.decodeList(
'$jsonPath.roots',
json['roots'],
(String jsonPath, Object? json) => ContextRoot.fromJson(
jsonDecoder,
jsonPath,
json,
clientUriConverter: clientUriConverter,
),
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'roots');
}
return AnalysisSetContextRootsParams(roots);
} else {
throw jsonDecoder.mismatch(
jsonPath,
'analysis.setContextRoots params',
json,
);
}
}