diff --git a/Sources/SwiftPackageListCore/Output Generation/JSON/JSONGenerator.swift b/Sources/SwiftPackageListCore/Output Generation/JSON/JSONGenerator.swift index cd35bd5..01361ad 100644 --- a/Sources/SwiftPackageListCore/Output Generation/JSON/JSONGenerator.swift +++ b/Sources/SwiftPackageListCore/Output Generation/JSON/JSONGenerator.swift @@ -15,7 +15,7 @@ struct JSONGenerator: OutputGenerator { private let jsonEncoder: JSONEncoder = { let encoder = JSONEncoder() - encoder.outputFormatting = .prettyPrinted + encoder.outputFormatting = [.prettyPrinted, .sortedKeys] return encoder }() diff --git a/Tests/SwiftPackageListCoreTests/JSONGeneratorTests.swift b/Tests/SwiftPackageListCoreTests/JSONGeneratorTests.swift index 289479b..ccd3c2e 100644 --- a/Tests/SwiftPackageListCoreTests/JSONGeneratorTests.swift +++ b/Tests/SwiftPackageListCoreTests/JSONGeneratorTests.swift @@ -42,10 +42,10 @@ final class JSONGeneratorTests: XCTestCase { let expectedOutput = """ [ { - "revision" : "xxxx", "license" : "MIT", "name" : "test", "repositoryURL" : "https:\\/\\/github.com\\/test\\/test", + "revision" : "xxxx", "version" : "1.0.0" } ]