toJsonWithOtherMembers method

Map<String, dynamic> toJsonWithOtherMembers()

Convert to JSON with other members included This is the compliant serialization method that includes other members as per RFC 7946 specification.

Implementation

Map<String, dynamic> toJsonWithOtherMembers() {
  final json = toJson();
  final others = otherMembers;

  if (others.isNotEmpty) {
    json.addAll(others);
  }

  return json;
}