Skip to content

Commit

Permalink
Use .sortedKeys for JSONEncoder, so output is stable
Browse files Browse the repository at this point in the history
  • Loading branch information
m4p committed Oct 30, 2023
1 parent ef3c05e commit 6a23d06
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct JSONGenerator: OutputGenerator {

private let jsonEncoder: JSONEncoder = {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
encoder.outputFormatting = .sortedKeys
return encoder
}()

Expand Down

0 comments on commit 6a23d06

Please sign in to comment.