Skip to content

Commit f695e4b

Browse files
committed
refactor: add JsonPropertyName attribute to Value property in IntOrString struct
1 parent 0bd43e4 commit f695e4b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/KubernetesClient/Models/IntOrString.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
using System.Globalization;
2+
13
namespace k8s.Models
24
{
35
[JsonConverter(typeof(IntOrStringJsonConverter))]
46
public struct IntOrString
57
{
6-
[JsonPropertyName("value")]
78
public string Value { get; private init; }
89

910
public static implicit operator IntOrString(int v)
@@ -30,5 +31,10 @@ public override string ToString()
3031
{
3132
return Value;
3233
}
34+
35+
public int ToInt()
36+
{
37+
return int.Parse(Value, CultureInfo.InvariantCulture);
38+
}
3339
}
3440
}

0 commit comments

Comments
 (0)