diff --git a/src/ReportingApi/Models/CspReport.cs b/src/ReportingApi/Models/CspReport.cs index 23713a9..e5ddb05 100644 --- a/src/ReportingApi/Models/CspReport.cs +++ b/src/ReportingApi/Models/CspReport.cs @@ -2,7 +2,7 @@ namespace ReportingApi.Models; -public class CspReport : IReportBody +public sealed record CspReport : IReportBody { [JsonPropertyName("blockedURL")] public string BlockedUri { get; set; } = null!; diff --git a/src/ReportingApi/Models/ReportRequest.cs b/src/ReportingApi/Models/ReportRequest.cs index 7480ced..f4f252b 100644 --- a/src/ReportingApi/Models/ReportRequest.cs +++ b/src/ReportingApi/Models/ReportRequest.cs @@ -4,7 +4,7 @@ namespace ReportingApi.Models; [JsonConverter(typeof(ReportRequestConverter))] -public class ReportRequest +public record ReportRequest { [JsonPropertyName("age")] public int Age { get; set; } @@ -16,7 +16,7 @@ public class ReportRequest public string UserAgent { get; set; } = null!; } -public class ReportRequest : ReportRequest +public sealed record ReportRequest : ReportRequest where TBody : class, IReportBody { [JsonPropertyName("body")]