forked from Nexus/nexus
make enums fall back to unknown or null where possible
Futureproofing.
This commit is contained in:
parent
401b527714
commit
53d9c2b1e6
1 changed files with 28 additions and 6 deletions
|
|
@ -8,6 +8,7 @@ sealed class HistoryVisibilityContent extends Content
|
|||
with _$HistoryVisibilityContent {
|
||||
HistoryVisibilityContent._();
|
||||
factory HistoryVisibilityContent({
|
||||
@JsonKey(unknownEnumValue: HistoryVisibility.unknown)
|
||||
required HistoryVisibility historyVisibility,
|
||||
}) = _HistoryVisibilityContent;
|
||||
|
||||
|
|
@ -16,4 +17,4 @@ sealed class HistoryVisibilityContent extends Content
|
|||
}
|
||||
|
||||
@JsonEnum(fieldRename: FieldRename.snake)
|
||||
enum HistoryVisibility { invited, joined, shared, worldReadable }
|
||||
enum HistoryVisibility { invited, joined, shared, worldReadable, unknown }
|
||||
|
|
|
|||
Loading…
Reference in a new issue