UrlMapValidationResult.fromJson constructor

UrlMapValidationResult.fromJson(
  1. Object? j
)

Implementation

factory UrlMapValidationResult.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return UrlMapValidationResult(
    loadErrors: switch (json['loadErrors']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"loadErrors" is not a list'),
    },
    loadSucceeded: switch (json['loadSucceeded']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    testFailures: switch (json['testFailures']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) TestFailure.fromJson(i)],
      _ => throw const FormatException('"testFailures" is not a list'),
    },
    testPassed: switch (json['testPassed']) {
      null => null,
      Object $1 => decodeBool($1),
    },
  );
}