Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Allow extra properties iff they are null
Browse files Browse the repository at this point in the history
  • Loading branch information
Porges authored Sep 1, 2022
1 parent 9c810d0 commit db6c955
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ApiService/ApiService/onefuzzlib/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ public static async Async.Task<OneFuzzResult<T>> ParseRequest<T>(HttpRequestData
// properties set:
if (t.ExtensionData != null) {
var errors = new List<string>();
foreach (var property in t.ExtensionData.Keys) {
errors.Add($"Unexpected property: \"{property}\"");
foreach (var (name, value) in t.ExtensionData) {
// allow additional properties if they are null,
// otherwise produce an error
if (value.ValueKind != JsonValueKind.Null) {
errors.Add($"Unexpected property: \"{name}\"");
}
}

return new Error(
Expand Down

0 comments on commit db6c955

Please sign in to comment.