tgstation-server
6.12.3
The /tg/station 13 server suite
Loading...
Searching...
No Matches
src
Tgstation.Server.Client.GraphQL
Serializers
SemverSerializer.cs
Go to the documentation of this file.
1
using
System;
2
3
using
StrawberryShake.Serialization;
4
5
using
Tgstation.Server.Common.Extensions
;
6
7
#pragma warning disable CA1812
// not detecting usage via annotation in schema.extensions.graphql
8
9
namespace
Tgstation.Server.Client.GraphQL.Serializers
10
{
14
sealed
class
SemverSerializer
:
ScalarSerializer
<string, Version>
15
{
19
public
SemverSerializer
()
20
: base(
"Semver"
)
21
{
22
}
23
25
public
override
Version
Parse
(
string
serializedValue)
26
=> Version.Parse(serializedValue ??
throw
new
ArgumentNullException(nameof(serializedValue)));
27
29
protected
override
string
Format
(Version runtimeValue)
30
{
31
ArgumentNullException.ThrowIfNull(runtimeValue);
32
return
runtimeValue.Semver().ToString();
33
}
34
}
35
}
ScalarSerializer
Tgstation.Server.Client.GraphQL.Serializers.SemverSerializer
ScalarSerializer<TSerialized, TRuntime> for Versions.
Definition
SemverSerializer.cs:15
Tgstation.Server.Client.GraphQL.Serializers.SemverSerializer.SemverSerializer
SemverSerializer()
Initializes a new instance of the SemverSerializer class.
Definition
SemverSerializer.cs:19
Tgstation.Server.Client.GraphQL.Serializers.SemverSerializer.Format
override string Format(Version runtimeValue)
Definition
SemverSerializer.cs:29
Tgstation.Server.Client.GraphQL.Serializers.SemverSerializer.Parse
override Version Parse(string serializedValue)
Tgstation.Server.Client.GraphQL.Serializers
Definition
JwtSerializer.cs:10
Tgstation.Server.Common.Extensions
Definition
ValueTaskExtensions.cs:7
Generated by
1.9.8