Skip to content

Commit

Permalink
fix strict nullability in few files (#16)
Browse files Browse the repository at this point in the history
* fix strict nullability in few files

* remove unused imports

---------

Co-authored-by: Konstantin <[email protected]>
  • Loading branch information
hf-kklein and Konstantin authored Oct 11, 2024
1 parent de93f7f commit f3f2788
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
11 changes: 5 additions & 6 deletions MaLoIdentModels/MaLoIdentModels/Address.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
namespace MaLoIdentModels;

using System.ComponentModel.DataAnnotations;
Expand All @@ -8,20 +7,20 @@ public class Address
{
[JsonPropertyName("countryCode")]
[RegularExpression(@"[A-Z]{2}")]
public string CountryCode { get; set; }
public string? CountryCode { get; set; }

[JsonPropertyName("zipCode")]
public string ZipCode { get; set; }
public string? ZipCode { get; set; }

[JsonPropertyName("city")]
public string City { get; set; }
public string? City { get; set; }

[JsonPropertyName("street")]
public string Street { get; set; }
public string? Street { get; set; }

[JsonPropertyName("houseNumber")]
public int HouseNumber { get; set; }

[JsonPropertyName("houseNumberAddition")]
public string HouseNumberAddition { get; set; }
public string? HouseNumberAddition { get; set; }
}
14 changes: 7 additions & 7 deletions MaLoIdentModels/MaLoIdentModels/GeographicCoordinates.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
using System.Text.Json.Serialization;
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

namespace MaLoIdentModels;

public class GeographicCoordinates
{
[JsonPropertyName("latitude")]
public string Latitude { get; set; }
public string? Latitude { get; set; }

[JsonPropertyName("longitude")]
public string Longitude { get; set; }
public string? Longitude { get; set; }

[JsonPropertyName("east")]
public string East { get; set; }
public string? East { get; set; }

[JsonPropertyName("north")]
public string North { get; set; }
public string? North { get; set; }

[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonPropertyName("zone")]
public Zone? Zone { get; set; }

[JsonPropertyName("northing")]
public string Northing { get; set; }
public string? Northing { get; set; }

[JsonPropertyName("easting")]
public string Easting { get; set; }
public string? Easting { get; set; }
}
3 changes: 1 addition & 2 deletions MaLoIdentModels/MaLoIdentModels/MarketLocationDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
namespace MaLoIdentModels;

public class MarketLocationDateTime
{
[JsonPropertyName("maloId")]
[RegularExpression(@"\d{11}")]
public string MaloId { get; set; }
public string? MaloId { get; set; }

[JsonConverter(typeof(DateTimeOffsetWithTrailingZConverter))]
[JsonPropertyName("executionTimeFrom")]
Expand Down
1 change: 0 additions & 1 deletion MaLoIdentModels/MaLoIdentModelsTests/RoundTripTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using FluentAssertions;
using MaLoIdentModels;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModelsTests;

Expand Down

0 comments on commit f3f2788

Please sign in to comment.