Map<String, dynamic> toJson() => { 'type': type, 'properties': properties.map((k, v) => MapEntry(k, v.toJson())), 'required': required, };