toJson method

Map<String, dynamic> toJson()

Serializes this sview into a json Map

Implementation

Map<String, dynamic> toJson() => {
      'id': id,
      'name': name,
      'type': type.backendName,
      '_links': links.toJson(),
      if (fields != null) 'fields': fields!.map((e) => e.toJson()).toList(),
      if (slotProperties != null) 'slotProperties': slotProperties,
      if (_fieldProperties != null) 'fieldProperties': _fieldProperties,
      if (properties != null) 'properties': properties,
      if (slots != null)
        '_embedded': {
          'schema': {
            'slots': slots!.map(
              (key, value) => MapEntry(
                key,
                value.toJson(),
              ),
            ),
          },
        },
      if (properties != null) 'properties': properties,
    };