import SwiftUI import UniformTypeIdentifiers struct JSONFileDocument: FileDocument { static var readableContentTypes: [UTType] { [.json] } var data: Data init(_ data: Data) throws { self.data = data } init(configuration: ReadConfiguration) throws { guard let data = configuration.file.regularFileContents else { throw CocoaError(.fileReadCorruptFile) } self.data = data } func fileWrapper( configuration: WriteConfiguration // swiftlint:disable:this unused_parameter ) throws -> FileWrapper { FileWrapper(regularFileWithContents: data) } }