Skip to content

Commit 72c5117

Browse files
authored
generator: Sort keys in JSON metadata files (#171)
This change makes it possible to compare generated SDKs using recursive diff, without having to account for spurious differences cause by the order of keys in JSON metadata files.
1 parent 84d62bf commit 72c5117

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Metadata.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import class Foundation.JSONEncoder
1616

1717
private let encoder: JSONEncoder = {
1818
let encoder = JSONEncoder()
19-
encoder.outputFormatting = [.prettyPrinted, .withoutEscapingSlashes]
19+
encoder.outputFormatting = [.prettyPrinted, .withoutEscapingSlashes, .sortedKeys]
2020
return encoder
2121
}()
2222

0 commit comments

Comments
 (0)