Skip to content

Commit 4bebd12

Browse files
committed
added SerializationType.Html (#62)
1 parent 644037b commit 4bebd12

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Synapse.Core/Classes/Enums/SerializationType.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,28 @@ public enum SerializationType
77
Yaml,
88
Xml,
99
Json,
10+
Html,
1011
Unspecified
1112
}
13+
14+
public struct SerializationContentType
15+
{
16+
public const string Yaml = "application/yaml";
17+
public const string Xml = "application/xml";
18+
public const string Json = "application/json";
19+
public const string Html = "text/html";
20+
public const string Unspecified = "text/plain";
21+
22+
public static string GetContentType(SerializationType serializationType)
23+
{
24+
switch(serializationType)
25+
{
26+
case SerializationType.Xml: { return Xml; }
27+
case SerializationType.Json: { return Json; }
28+
case SerializationType.Html: { return Html; }
29+
case SerializationType.Unspecified: { return Unspecified; }
30+
default: { return Yaml; }
31+
}
32+
}
33+
}
1234
}

0 commit comments

Comments
 (0)