diff --git a/MaLoIdentModels/MaLoIdentModels/Address.cs b/MaLoIdentModels/MaLoIdentModels/Address.cs index c390d4c..c31af15 100644 --- a/MaLoIdentModels/MaLoIdentModels/Address.cs +++ b/MaLoIdentModels/MaLoIdentModels/Address.cs @@ -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; @@ -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; } } diff --git a/MaLoIdentModels/MaLoIdentModels/GeographicCoordinates.cs b/MaLoIdentModels/MaLoIdentModels/GeographicCoordinates.cs index 08f0f61..7300167 100644 --- a/MaLoIdentModels/MaLoIdentModels/GeographicCoordinates.cs +++ b/MaLoIdentModels/MaLoIdentModels/GeographicCoordinates.cs @@ -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; } } diff --git a/MaLoIdentModels/MaLoIdentModels/MarketLocationDateTime.cs b/MaLoIdentModels/MaLoIdentModels/MarketLocationDateTime.cs index 4bab89f..851168d 100644 --- a/MaLoIdentModels/MaLoIdentModels/MarketLocationDateTime.cs +++ b/MaLoIdentModels/MaLoIdentModels/MarketLocationDateTime.cs @@ -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")] diff --git a/MaLoIdentModels/MaLoIdentModelsTests/RoundTripTests.cs b/MaLoIdentModels/MaLoIdentModelsTests/RoundTripTests.cs index c9508a8..7111ff5 100644 --- a/MaLoIdentModels/MaLoIdentModelsTests/RoundTripTests.cs +++ b/MaLoIdentModels/MaLoIdentModelsTests/RoundTripTests.cs @@ -1,6 +1,5 @@ using FluentAssertions; using MaLoIdentModels; -using MaLoIdentModels.JsonSettings; namespace MaLoIdentModelsTests;