BadRequest.fromJson constructor

BadRequest.fromJson(
  1. Object? j
)

Implementation

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