CustomErrorResponsePolicy.fromJson constructor

CustomErrorResponsePolicy.fromJson(
  1. Object? j
)

Implementation

factory CustomErrorResponsePolicy.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return CustomErrorResponsePolicy(
    errorResponseRules: switch (json['errorResponseRules']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1)
          CustomErrorResponsePolicyCustomErrorResponseRule.fromJson(i),
      ],
      _ => throw const FormatException('"errorResponseRules" is not a list'),
    },
    errorService: switch (json['errorService']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}