From 4a4fef830eccf0629d7cf955126f0cd78867e0ee Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 1 Apr 2025 07:43:31 +0800 Subject: Explicitly set default value for enums used in API models (#13821) Enums in response model with no nullability or default value will make the API very fragile as each extension to the enum will break the API for some clients, but a lot of enums actually do have an unknown value which should be used as a default. This set all model properties that are non-nullable using an enum that has an Unknown member in 10.10, except MediaStream.VideoRangeType which is refactored in #13277 --- MediaBrowser.Model/Search/SearchHint.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MediaBrowser.Model/Search') diff --git a/MediaBrowser.Model/Search/SearchHint.cs b/MediaBrowser.Model/Search/SearchHint.cs index 2e2979fcf0..a18a813cc5 100644 --- a/MediaBrowser.Model/Search/SearchHint.cs +++ b/MediaBrowser.Model/Search/SearchHint.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Jellyfin.Data.Enums; namespace MediaBrowser.Model.Search @@ -115,6 +116,7 @@ namespace MediaBrowser.Model.Search /// Gets or sets the type of the media. /// /// The type of the media. + [DefaultValue(MediaType.Unknown)] public MediaType MediaType { get; set; } /// -- cgit v1.2.3