diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Models.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Models.swift index e9b0269c..22e8134f 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Models.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Models.swift @@ -4173,7 +4173,7 @@ public class JSONNull: Codable, Hashable { } } -class JSONCodingKey: CodingKey { +final class JSONCodingKey: CodingKey, Sendable { let key: String required init?(intValue: Int) { diff --git a/protocol/scripts/generate_models.mjs b/protocol/scripts/generate_models.mjs index cf90f861..383a963d 100755 --- a/protocol/scripts/generate_models.mjs +++ b/protocol/scripts/generate_models.mjs @@ -332,7 +332,21 @@ async function generateSwift(specDir, output) { output, ]); - await normalizeGeneratedFile(output); + await normalizeGeneratedFile(output, (source) => { + // quicktype's --sendable option marks generated models as Sendable, but quicktype 23.2.6 + // still emits the dynamic JSON coding key helper as a non-final, non-Sendable class. + // Removing --swift-5-support does not change this output, so normalize the helper here. + const result = source.replace( + /^class JSONCodingKey: CodingKey \{/m, + "final class JSONCodingKey: CodingKey, Sendable {", + ); + + if (result === source) { + throw new Error("JSONCodingKey Sendable normalization failed; quicktype output may have changed"); + } + + return result; + }); } async function generateTypescript(specDir, output) {