Skip to content

Commit

Permalink
fix: some datetime types should be nullable (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee authored Oct 22, 2024
1 parent ecab931 commit a284684
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ public sealed record RepositoryRuleset
public IReadOnlyCollection<Rule>? Rules { get; init; }

[JsonPropertyName("created_at")]
public string? CreatedAt { get; init; }
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]
public DateTimeOffset? CreatedAt { get; init; }

[JsonPropertyName("updated_at")]
public string? UpdatedAt { get; init; }
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]
public DateTimeOffset? UpdatedAt { get; init; }
}
7 changes: 4 additions & 3 deletions src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ public sealed record WorkflowJob
public string? RunnerGroupName { get; init; }

[JsonPropertyName("started_at")]
[JsonConverter(typeof(DateTimeOffsetConverter))]
public DateTimeOffset StartedAt { get; init; }
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]
public DateTimeOffset? StartedAt { get; init; }

[JsonPropertyName("completed_at")]
public string? CompletedAt { get; init; }
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]
public DateTimeOffset? CompletedAt { get; init; }

[JsonPropertyName("workflow_name")]
public string? WorkflowName { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public sealed record WorkflowJobStep
public long Number { get; init; }

[JsonPropertyName("started_at")]
[JsonConverter(typeof(DateTimeOffsetConverter))]
public DateTimeOffset StartedAt { get; init; }
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]
public DateTimeOffset? StartedAt { get; init; }

[JsonPropertyName("completed_at")]
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]
Expand Down

0 comments on commit a284684

Please sign in to comment.