mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-30 05:46:30 +01:00
Merge pull request #4735 from crobibero/json-recursion
Fix JsonConverter recursion
(cherry picked from commit 94d805d03d)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua M. Boniface
parent
24e4fcc3b7
commit
126753a1fe
@@ -19,5 +19,16 @@ namespace Jellyfin.Common.Tests.Json
|
||||
var value = JsonSerializer.Deserialize<bool>(input, options);
|
||||
Assert.Equal(value, output);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true, "true")]
|
||||
[InlineData(false, "false")]
|
||||
public static void Serialize_Bool_Success(bool input, string output)
|
||||
{
|
||||
var options = new JsonSerializerOptions();
|
||||
options.Converters.Add(new JsonBoolNumberConverter());
|
||||
var value = JsonSerializer.Serialize(input, options);
|
||||
Assert.Equal(value, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user