Skip to content

Commit

Permalink
fix: added Pop field support.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xc3u committed May 7, 2024
1 parent 238ea88 commit 70387a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Indiko.OpenWeatherClient/Models/Day.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,12 @@ public sealed class Day : Weather
[JsonPropertyName("snow")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public float? Snow { get; init; }

/// <summary>
/// Gets the Probability Of Precipitation for the specific hour unit specified.
/// This property will be ignored when writing to JSON if the value is null.
/// </summary>
[JsonPropertyName("pop")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public float? ProbabilityOfPrecipitation { get; init; }
}
8 changes: 8 additions & 0 deletions src/Indiko.OpenWeatherClient/Models/Hour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ public sealed class Hour : Weather
[JsonPropertyName("snow")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OneHour Snow { get; init; }

/// <summary>
/// Gets the Probability Of Precipitation for the specific hour unit specified.
/// This property will be ignored when writing to JSON if the value is null.
/// </summary>
[JsonPropertyName("pop")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public float? ProbabilityOfPrecipitation { get; init; }
}

0 comments on commit 70387a1

Please sign in to comment.