Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7623,17 +7623,13 @@ func newJSONEncoder() -> JSONEncoder {

// MARK: - Encode/decode helpers

public class JSONNull: Codable, Hashable {
public final class JSONNull: Codable, Hashable, Sendable {
public static func == (_: JSONNull, _: JSONNull) -> Bool {
return true
}

public var hashValue: Int {
return 0
}

public func hash(into _: inout Hasher) {
// No-op
public func hash(into hasher: inout Hasher) {
hasher.combine(0)
}

public init() {}
Expand Down Expand Up @@ -7671,7 +7667,7 @@ final class JSONCodingKey: CodingKey, Sendable {
}
}

public class JSONAny: Codable {
public final class JSONAny: Codable, @unchecked Sendable {
public let value: Any

static func decodingError(forCodingPath codingPath: [CodingKey]) -> DecodingError {
Expand Down
5 changes: 4 additions & 1 deletion protocol/scripts/generate_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ case "$LANG" in
OUTPUT="${REPO_ROOT}/platforms/swift/Sources/ShopifyCheckoutProtocol/Generated/Models.swift"
quicktype \
--lang swift \
--swift-5-support \
--access-level public \
--sendable \
--src-lang schema \
Expand All @@ -233,7 +232,11 @@ case "$LANG" in
sed -i '' -E \
-e 's/[[:<:]]Binding[[:>:]]/TokenBinding/g' \
-e 's/[[:<:]]ColorScheme[[:>:]]/EmbeddedColorScheme/g' \
-e 's/^public class JSONNull: Codable, Hashable {/public final class JSONNull: Codable, Hashable, Sendable {/' \
-e 's/^ public func hash\(into _: inout Hasher\) {/ public func hash(into hasher: inout Hasher) {/' \
-e 's/^ \/\/ No-op$/ hasher.combine(0)/' \
-e 's/^class JSONCodingKey: CodingKey {/final class JSONCodingKey: CodingKey, Sendable {/' \
-e 's/^public class JSONAny: Codable {/public final class JSONAny: Codable, @unchecked Sendable {/' \
"${OUTPUT}"

prepend_license "swift" "${OUTPUT}"
Expand Down
Loading