Documentation.fromJson constructor

Documentation.fromJson(
  1. Object? j
)

Implementation

factory Documentation.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Documentation(
    summary: switch (json['summary']) {
      null => '',
      Object $1 => decodeString($1),
    },
    pages: switch (json['pages']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Page.fromJson(i)],
      _ => throw const FormatException('"pages" is not a list'),
    },
    rules: switch (json['rules']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) DocumentationRule.fromJson(i)],
      _ => throw const FormatException('"rules" is not a list'),
    },
    documentationRootUrl: switch (json['documentationRootUrl']) {
      null => '',
      Object $1 => decodeString($1),
    },
    serviceRootUrl: switch (json['serviceRootUrl']) {
      null => '',
      Object $1 => decodeString($1),
    },
    overview: switch (json['overview']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}