Skip to content

Commit 6ddfcb1

Browse files
committed
model [nfc]: Clarify how to add new fields to ZulipStream
1 parent 98b4b2b commit 6ddfcb1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/api/model/model.dart

+8
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@ enum UserRole{
312312
/// in <https://zulip.com/api/register-queue>.
313313
@JsonSerializable(fieldRename: FieldRename.snake)
314314
class ZulipStream {
315+
// When adding a field to this class:
316+
// * If a [ChannelUpdateEvent] can update it, be sure to add
317+
// that case as a field of [ChannelUpdateEvent] or as a new value to
318+
// [ChannelPropertyName] enum; based on what the stream-update API suggests.
319+
// * If the field can never change for a given Zulip stream, mark it final.
320+
// * (If it can change but [ChannelUpdateEvent] doesn't cover that,
321+
// then that's a bug in the API; raise it in `#api design`.)
322+
315323
final int streamId;
316324
String name;
317325
String description;

0 commit comments

Comments
 (0)