@override Map<String, dynamic> toJson() { Map<String, dynamic> asMap = {'feature-type': featureType.value, 'id': id}; if (roles != null && roles!.isNotEmpty) { asMap['roles'] = roles; } return asMap; }