Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Commit 2fc5be5

Browse files
committed
Make JsonSerializer content type static (#118)
1 parent 7f1abc3 commit 2fc5be5

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/FlowCtl.Infrastructure/Serialization/JsonSerializer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ namespace FlowCtl.Infrastructure.Serialization;
77

88
public class JsonSerializer : IJsonSerializer
99
{
10-
public string ContentMineType => "application/json";
10+
/// <summary>
11+
/// Static JSON content type reference that callers can reuse without instantiating the serializer.
12+
/// </summary>
13+
public static string ContentMineType => "application/json";
1114

1215
public string Serialize(object? input)
1316
{

tests/FlowCtl.Infrastructure.UnitTests/Serialization/JsonSerializerTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ namespace FlowCtl.Infrastructure.UnitTests.Serialization;
66

77
public class JsonSerializerTests
88
{
9+
[Fact]
10+
public void ContentMineType_ShouldExposeJsonMimeTypeWithoutInstance()
11+
{
12+
// Act
13+
var mimeType = JsonSerializer.ContentMineType;
14+
15+
// Assert
16+
Assert.Equal("application/json", mimeType);
17+
}
18+
919
[Fact]
1020
public void Serialize_ShouldThrowFlowSynxException_WhenInputIsNull()
1121
{

0 commit comments

Comments
 (0)