Skip to content

Commit 39b7372

Browse files
authored
Use DateTimeOffset everywhere instead of string (#525)
1 parent 5d268df commit 39b7372

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public sealed record WorkflowJob
6060
public string? RunnerGroupName { get; init; }
6161

6262
[JsonPropertyName("started_at")]
63-
public string StartedAt { get; init; } = null!;
63+
[JsonConverter(typeof(DateTimeOffsetConverter))]
64+
public DateTimeOffset StartedAt { get; init; }
6465

6566
[JsonPropertyName("completed_at")]
6667
public string? CompletedAt { get; init; }
@@ -72,5 +73,6 @@ public sealed record WorkflowJob
7273
public string? HeadBranch { get; init; }
7374

7475
[JsonPropertyName("created_at")]
75-
public string CreatedAt { get; init; } = null!;
76+
[JsonConverter(typeof(DateTimeOffsetConverter))]
77+
public DateTimeOffset CreatedAt { get; init; }
7678
}

src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJobStep.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public sealed record WorkflowJobStep
1818
public long Number { get; init; }
1919

2020
[JsonPropertyName("started_at")]
21-
public string StartedAt { get; init; } = null!;
21+
[JsonConverter(typeof(DateTimeOffsetConverter))]
22+
public DateTimeOffset StartedAt { get; init; }
2223

2324
[JsonPropertyName("completed_at")]
2425
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]

0 commit comments

Comments
 (0)