Skip to content

Commit

Permalink
Disallow trailing commas when uploading options lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ErlingHauan committed Jan 16, 2025
1 parent 0e9be78 commit 0df6271
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public async Task<List<Option>> UploadNewOption(string org, string repo, string
cancellationToken.ThrowIfCancellationRequested();

List<Option> deserializedOptions = JsonSerializer.Deserialize<List<Option>>(payload.OpenReadStream(),
new JsonSerializerOptions { WriteIndented = true, AllowTrailingCommas = true });
new JsonSerializerOptions { WriteIndented = true });

bool optionListHasInvalidNullFields = deserializedOptions.Exists(option => option.Value == null || option.Label == null);
if (optionListHasInvalidNullFields)
Expand Down

0 comments on commit 0df6271

Please sign in to comment.