             )
         }
 
+        // backwards compatibility of JSON format
+        func toLegacyJSON() -> JSON {
+            return .init([
+                "version": self.version.toJSON(),
+                "object": self.object.toLegacyJSON()
+            ])
+        }
+
         struct Container: Codable {
             var pins: [Pin]
+
+            // backwards compatibility of JSON format
+            func toLegacyJSON() -> JSON {
+                return .init([
+                    "pins": self.pins.map { $0.toLegacyJSON() },
+                ])
+            }
         }
 
         struct Pin: Codable {

                // rdar://52529014, rdar://52529011: pin file should store the original location but remap when loading
                self.repositoryURL = mirrors.originalURL(for: location) ?? location
                self.state = try .init(pin.state)
            }
        }


                    throw StringError("invalid pin state: \(state)")
                }
            }

            // backwards compatibility of JSON format
            func toLegacyJSON() -> JSON {
                return .init([
                    "revision": self.revision.toJSON(),
                    "version": self.version.toJSON(),
                    "branch": self.branch.toJSON()
                ])
            }
        }
    }

