Type.fromJson constructor

Type.fromJson(
  1. Map _json
)

Implementation

Type.fromJson(core.Map _json) {
  if (_json.containsKey("fields")) {
    fields = (_json["fields"] as core.List)
        .map<Field>((value) => new Field.fromJson(value))
        .toList();
  }
  if (_json.containsKey("name")) {
    name = _json["name"];
  }
  if (_json.containsKey("oneofs")) {
    oneofs = (_json["oneofs"] as core.List).cast<core.String>();
  }
  if (_json.containsKey("options")) {
    options = (_json["options"] as core.List)
        .map<Option>((value) => new Option.fromJson(value))
        .toList();
  }
  if (_json.containsKey("sourceContext")) {
    sourceContext = new SourceContext.fromJson(_json["sourceContext"]);
  }
  if (_json.containsKey("syntax")) {
    syntax = _json["syntax"];
  }
}