Skip to content

Commit 2936b2f

Browse files
authored
feat!: Conceal serde types with Swift SPI (#805)
1 parent e7b994f commit 2936b2f

File tree

84 files changed

+295
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+295
-205
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ let package = Package(
103103
),
104104
.target(
105105
name: "SmithyReadWrite",
106-
dependencies: ["SmithyTimestamps"]
106+
dependencies: ["Smithy", "SmithyTimestamps"]
107107
),
108108
.target(
109109
name: "SmithyXML",

Sources/ClientRuntime/Networking/Http/HTTPResponse+WireDataProviding.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
import class SmithyHTTPAPI.HTTPResponse
99
import enum Smithy.ByteStream
10-
import protocol SmithyReadWrite.WireDataProviding
10+
@_spi(SmithyReadWrite) import protocol SmithyReadWrite.WireDataProviding
1111
import struct Foundation.Data
1212

13+
@_spi(SmithyReadWrite)
1314
extension HTTPResponse: WireDataProviding {
1415

1516
public func data() async throws -> Data {

Sources/ClientRuntime/Networking/Http/Middlewares/DeserializeMiddleware.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
import SmithyHTTPAPI
9-
import SmithyReadWrite
9+
@_spi(SmithyReadWrite) import SmithyReadWrite
1010
import class Foundation.DateFormatter
1111
import struct Foundation.Locale
1212
import struct Foundation.TimeInterval
@@ -15,6 +15,7 @@ import struct Foundation.UUID
1515
import class Smithy.Context
1616
import protocol Smithy.ResponseMessageDeserializer
1717

18+
@_spi(SmithyReadWrite)
1819
public struct DeserializeMiddleware<OperationStackOutput> {
1920
public var id: String = "Deserialize"
2021
let wireResponseClosure: WireResponseOutputClosure<HTTPResponse, OperationStackOutput>

Sources/ClientRuntime/Networking/Http/Middlewares/RequestBody/BodyMiddleware.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
import Smithy
99
import SmithyHTTPAPI
1010
import struct Foundation.Data
11-
import protocol SmithyReadWrite.SmithyWriter
12-
import typealias SmithyReadWrite.WritingClosure
11+
@_spi(SmithyReadWrite) import protocol SmithyReadWrite.SmithyWriter
12+
@_spi(SmithyReadWrite) import typealias SmithyReadWrite.WritingClosure
1313

14+
@_spi(SmithyReadWrite)
1415
public struct BodyMiddleware<OperationStackInput,
1516
OperationStackOutput,
1617
Writer: SmithyWriter> {

Sources/ClientRuntime/Networking/Http/Middlewares/RequestBody/EventStreamBodyMiddleware.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SmithyEventStreams
1111
import SmithyEventStreamsAPI
1212
import SmithyEventStreamsAuthAPI
1313
import struct Foundation.Data
14-
import typealias SmithyReadWrite.WritingClosure
14+
@_spi(SmithyReadWrite) import typealias SmithyReadWrite.WritingClosure
1515
import SmithyHTTPAPI
1616

1717
public struct EventStreamBodyMiddleware<OperationStackInput,

Sources/ClientRuntime/Networking/Http/Middlewares/RequestBody/PayloadBodyMiddleware.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import enum Smithy.ClientError
1010
import protocol Smithy.RequestMessageSerializer
1111
import class Smithy.Context
1212
import struct Foundation.Data
13-
import protocol SmithyReadWrite.SmithyWriter
14-
import typealias SmithyReadWrite.WritingClosure
13+
@_spi(SmithyReadWrite) import protocol SmithyReadWrite.SmithyWriter
14+
@_spi(SmithyReadWrite) import typealias SmithyReadWrite.WritingClosure
1515
import SmithyHTTPAPI
1616

17+
@_spi(SmithyReadWrite)
1718
public struct PayloadBodyMiddleware<OperationStackInput,
1819
OperationStackOutput,
1920
OperationStackInputPayload,

Sources/ClientRuntime/Serialization/SerializationUtils/TimestampFormatter.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import struct SmithyTimestamps.TimestampFormatter
9-
import enum SmithyTimestamps.TimestampFormat
8+
@_spi(SmithyTimestamps) import struct SmithyTimestamps.TimestampFormatter
9+
@_spi(SmithyTimestamps) import enum SmithyTimestamps.TimestampFormat
1010

11+
@_spi(SmithyTimestamps)
1112
public typealias TimestampFormatter = SmithyTimestamps.TimestampFormatter
13+
14+
@_spi(SmithyTimestamps)
1215
public typealias TimestampFormat = SmithyTimestamps.TimestampFormat

Sources/ClientRuntime/Serialization/SerializationUtils/XML/ValueWriters.swift

Lines changed: 0 additions & 23 deletions
This file was deleted.

Sources/SmithyFormURL/Writer.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import protocol SmithyReadWrite.SmithyWriter
8+
@_spi(SmithyReadWrite) import protocol SmithyReadWrite.SmithyWriter
99
import enum SmithyReadWrite.Document
10-
import enum SmithyTimestamps.TimestampFormat
11-
import struct SmithyTimestamps.TimestampFormatter
10+
@_spi(SmithyTimestamps) import enum SmithyTimestamps.TimestampFormat
11+
@_spi(SmithyTimestamps) import struct SmithyTimestamps.TimestampFormatter
1212
import struct Foundation.Data
1313
import struct Foundation.Date
1414
import struct Foundation.CharacterSet
1515

16+
@_spi(SmithyReadWrite)
1617
public final class Writer: SmithyWriter {
1718
public typealias NodeInfo = SmithyFormURL.NodeInfo
1819

Sources/SmithyJSON/Reader/Reader.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import protocol SmithyReadWrite.SmithyReader
8+
@_spi(SmithyReadWrite) import protocol SmithyReadWrite.SmithyReader
99
import enum SmithyReadWrite.Document
1010
import typealias SmithyReadWrite.ReadingClosure
1111
import enum SmithyReadWrite.ReaderError
12-
import enum SmithyTimestamps.TimestampFormat
13-
import struct SmithyTimestamps.TimestampFormatter
12+
@_spi(SmithyTimestamps) import enum SmithyTimestamps.TimestampFormat
13+
@_spi(SmithyTimestamps) import struct SmithyTimestamps.TimestampFormatter
1414
import struct Foundation.Data
1515
import struct Foundation.Date
1616
import class Foundation.NSNull
1717
import class Foundation.NSNumber
1818
import func CoreFoundation.CFGetTypeID
1919
import func CoreFoundation.CFBooleanGetTypeID
2020

21+
@_spi(SmithyReadWrite)
2122
public final class Reader: SmithyReader {
2223
public typealias NodeInfo = SmithyJSON.NodeInfo
2324

0 commit comments

Comments
 (0)