UrlMapTest.fromJson constructor

UrlMapTest.fromJson(
  1. Object? j
)

Implementation

factory UrlMapTest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return UrlMapTest(
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    expectedOutputUrl: switch (json['expectedOutputUrl']) {
      null => null,
      Object $1 => decodeString($1),
    },
    expectedRedirectResponseCode:
        switch (json['expectedRedirectResponseCode']) {
          null => null,
          Object $1 => decodeInt($1),
        },
    headers: switch (json['headers']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) UrlMapTestHeader.fromJson(i)],
      _ => throw const FormatException('"headers" is not a list'),
    },
    host: switch (json['host']) {
      null => null,
      Object $1 => decodeString($1),
    },
    path: switch (json['path']) {
      null => null,
      Object $1 => decodeString($1),
    },
    service: switch (json['service']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}