Skip to content

Commit 63c7857

Browse files
committed
Adopt SE-409 and SE-444
1 parent 0946588 commit 63c7857

28 files changed

+58
-54
lines changed

Package.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ import PackageDescription
1616

1717
// General Swift-settings for all targets.
1818
let swiftSettings: [SwiftSetting] = [
19-
// https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md
20-
// Require `any` for existential types.
21-
.enableUpcomingFeature("ExistentialAny")
19+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0335-existential-any.md
20+
.enableUpcomingFeature("ExistentialAny"),
21+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0409-access-level-on-imports.md
22+
.enableUpcomingFeature("InternalImportsByDefault"),
23+
.enableExperimentalFeature("AccessLevelOnImport"),
24+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
25+
.enableUpcomingFeature("MemberImportVisibility"),
2226
]
2327

2428
let package = Package(

Sources/OpenAPIRuntime/Base/UndocumentedPayload.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
15+
public import HTTPTypes
1616

1717
/// A payload value used by undocumented operation responses.
1818
///

Sources/OpenAPIRuntime/Conversion/Configuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14-
import Foundation
14+
public import Foundation
1515

1616
/// A type that allows customization of Date encoding and decoding.
1717
///

Sources/OpenAPIRuntime/Conversion/Converter+Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import Foundation
15-
import HTTPTypes
15+
public import HTTPTypes
1616

1717
extension Converter {
1818

Sources/OpenAPIRuntime/Conversion/Converter+Common.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import Foundation
15-
import HTTPTypes
15+
public import HTTPTypes
1616

1717
extension Converter {
1818

Sources/OpenAPIRuntime/Conversion/Converter+Server.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
import Foundation
15-
import HTTPTypes
15+
public import HTTPTypes
1616

1717
extension Converter {
1818

Sources/OpenAPIRuntime/Conversion/ServerVariable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import Foundation
15+
public import Foundation
1616

1717
extension URL {
1818
/// Returns a validated server URL created from the URL template, or

Sources/OpenAPIRuntime/Conversion/URLExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14-
import Foundation
14+
public import Foundation
1515

1616
extension URL {
1717
/// Returns the default server URL of "/".

Sources/OpenAPIRuntime/Deprecated/Deprecated.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14-
import Foundation
14+
public import Foundation
1515
import HTTPTypes
1616

1717
// MARK: - Functionality to be removed in the future

Sources/OpenAPIRuntime/Errors/ClientError.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
15+
public import HTTPTypes
1616
#if canImport(Darwin)
17-
import struct Foundation.URL
17+
public import struct Foundation.URL
1818
#else
19-
@preconcurrency import struct Foundation.URL
19+
@preconcurrency public import struct Foundation.URL
2020
#endif
21-
import protocol Foundation.LocalizedError
21+
public import protocol Foundation.LocalizedError
2222

2323
/// An error thrown by a client performing an OpenAPI operation.
2424
///

Sources/OpenAPIRuntime/Errors/ServerError.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
16-
import protocol Foundation.LocalizedError
15+
public import HTTPTypes
16+
public import protocol Foundation.LocalizedError
1717

1818
/// An error thrown by a server handling an OpenAPI operation.
1919
public struct ServerError: Error {

Sources/OpenAPIRuntime/EventStreams/JSONLinesDecoding.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if canImport(Darwin)
16-
import class Foundation.JSONDecoder
16+
public import class Foundation.JSONDecoder
1717
#else
18-
@preconcurrency import class Foundation.JSONDecoder
18+
@preconcurrency public import class Foundation.JSONDecoder
1919
#endif
20-
import struct Foundation.Data
20+
public import struct Foundation.Data
2121

2222
/// A sequence that parses arbitrary byte chunks into lines using the JSON Lines format.
2323
public struct JSONLinesDeserializationSequence<Upstream: AsyncSequence & Sendable>: Sendable

Sources/OpenAPIRuntime/EventStreams/JSONLinesEncoding.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if canImport(Darwin)
16-
import class Foundation.JSONEncoder
16+
public import class Foundation.JSONEncoder
1717
#else
18-
@preconcurrency import class Foundation.JSONEncoder
18+
@preconcurrency public import class Foundation.JSONEncoder
1919
#endif
2020

2121
/// A sequence that serializes lines by concatenating them using the JSON Lines format.

Sources/OpenAPIRuntime/EventStreams/JSONSequenceDecoding.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if canImport(Darwin)
16-
import class Foundation.JSONDecoder
16+
public import class Foundation.JSONDecoder
1717
#else
18-
@preconcurrency import class Foundation.JSONDecoder
18+
@preconcurrency public import class Foundation.JSONDecoder
1919
#endif
20-
import protocol Foundation.LocalizedError
21-
import struct Foundation.Data
20+
public import protocol Foundation.LocalizedError
21+
public import struct Foundation.Data
2222

2323
/// A sequence that parses arbitrary byte chunks into lines using the JSON Sequence format.
2424
public struct JSONSequenceDeserializationSequence<Upstream: AsyncSequence & Sendable>: Sendable

Sources/OpenAPIRuntime/EventStreams/JSONSequenceEncoding.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if canImport(Darwin)
16-
import class Foundation.JSONEncoder
16+
public import class Foundation.JSONEncoder
1717
#else
18-
@preconcurrency import class Foundation.JSONEncoder
18+
@preconcurrency public import class Foundation.JSONEncoder
1919
#endif
2020

2121
/// A sequence that serializes lines by concatenating them using the JSON Sequence format.

Sources/OpenAPIRuntime/EventStreams/ServerSentEventsDecoding.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if canImport(Darwin)
16-
import class Foundation.JSONDecoder
16+
public import class Foundation.JSONDecoder
1717
#else
18-
@preconcurrency import class Foundation.JSONDecoder
18+
@preconcurrency public import class Foundation.JSONDecoder
1919
#endif
20-
import struct Foundation.Data
20+
public import struct Foundation.Data
2121

2222
/// A sequence that parses arbitrary byte chunks into events using the Server-sent Events format.
2323
///

Sources/OpenAPIRuntime/EventStreams/ServerSentEventsEncoding.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if canImport(Darwin)
16-
import class Foundation.JSONEncoder
16+
public import class Foundation.JSONEncoder
1717
#else
18-
@preconcurrency import class Foundation.JSONEncoder
18+
@preconcurrency public import class Foundation.JSONEncoder
1919
#endif
2020

2121
/// A sequence that serializes Server-sent Events.

Sources/OpenAPIRuntime/Interface/ClientTransport.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
16-
import struct Foundation.URL
15+
public import HTTPTypes
16+
public import struct Foundation.URL
1717

1818
/// A type that performs HTTP operations.
1919
///

Sources/OpenAPIRuntime/Interface/CurrencyTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
15+
public import HTTPTypes
1616

1717
/// A container for request metadata already parsed and validated
1818
/// by the server transport.

Sources/OpenAPIRuntime/Interface/ErrorHandlingMiddleware.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
15+
public import HTTPTypes
1616

1717
/// An opt-in error handling middleware that converts an error to an HTTP response.
1818
///

Sources/OpenAPIRuntime/Interface/HTTPBody.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import class Foundation.NSLock
16-
import protocol Foundation.LocalizedError
17-
import struct Foundation.Data // only for convenience initializers
15+
public import class Foundation.NSLock
16+
public import protocol Foundation.LocalizedError
17+
public import struct Foundation.Data // only for convenience initializers
1818

1919
/// A body of an HTTP request or HTTP response.
2020
///

Sources/OpenAPIRuntime/Interface/ServerTransport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
15+
public import HTTPTypes
1616

1717
/// A type that registers and handles HTTP operations.
1818
///

Sources/OpenAPIRuntime/Interface/UniversalClient.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14-
import HTTPTypes
14+
public import HTTPTypes
1515
#if canImport(Darwin)
16-
import struct Foundation.URL
16+
public import struct Foundation.URL
1717
#else
18-
@preconcurrency import struct Foundation.URL
18+
@preconcurrency public import struct Foundation.URL
1919
#endif
2020

2121
/// OpenAPI document-agnostic HTTP client used by OpenAPI document-specific,

Sources/OpenAPIRuntime/Interface/UniversalServer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import HTTPTypes
15+
public import HTTPTypes
1616
#if canImport(Darwin)
17-
import struct Foundation.URL
17+
public import struct Foundation.URL
1818
#else
19-
@preconcurrency import struct Foundation.URL
19+
@preconcurrency public import struct Foundation.URL
2020
#endif
21-
import struct Foundation.URLComponents
21+
public import struct Foundation.URLComponents
2222

2323
/// OpenAPI document-agnostic HTTP server used by OpenAPI document-specific,
2424
/// generated servers to perform request deserialization, middleware and handler

Sources/OpenAPIRuntime/Multipart/MultipartPublicTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
import Foundation
16-
import HTTPTypes
16+
public import HTTPTypes
1717

1818
/// A raw multipart part containing the header fields and the body stream.
1919
public struct MultipartRawPart: Sendable, Hashable {

Sources/OpenAPIRuntime/Multipart/MultipartPublicTypesExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
import Foundation
16-
import HTTPTypes
16+
public import HTTPTypes
1717

1818
// MARK: - Extensions
1919

Tests/OpenAPIRuntimeTests/Conversion/Test_Converter+Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ final class Test_ClientConverterExtensions: Test_Runtime {
275275
/// - message: An optional custom message to display upon test failure.
276276
/// - file: The file name to include in the failure message (default is the source file where this function is called).
277277
/// - line: The line number to include in the failure message (default is the line where this function is called).
278-
public func XCTAssertEqualStringifiedData(
278+
func XCTAssertEqualStringifiedData(
279279
_ expression1: @autoclosure () throws -> Data,
280280
_ expression2: @autoclosure () throws -> String,
281281
_ message: @autoclosure () -> String = "",

Tests/OpenAPIRuntimeTests/Test_Runtime.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ struct MockCustomCoder: CustomCoder {
259259
/// - rhs: The expected absolute string representation.
260260
/// - file: The file name to include in the failure message (default is the source file where this function is called).
261261
/// - line: The line number to include in the failure message (default is the line where this function is called).
262-
public func XCTAssertEqualURLString(_ lhs: URL?, _ rhs: String, file: StaticString = #filePath, line: UInt = #line) {
262+
func XCTAssertEqualURLString(_ lhs: URL?, _ rhs: String, file: StaticString = #filePath, line: UInt = #line) {
263263
guard let lhs else {
264264
XCTFail("URL is nil")
265265
return
@@ -384,7 +384,7 @@ public func XCTAssertEqualStringifiedData<S: Sequence>(
384384
/// - file: The file name to include in the failure message (default is the source file where this function is called).
385385
/// - line: The line number to include in the failure message (default is the line where this function is called).
386386
/// - Throws: If either of the autoclosures throws an error, the function will rethrow that error.
387-
public func XCTAssertEqualStringifiedData(
387+
func XCTAssertEqualStringifiedData(
388388
_ expression1: @autoclosure () throws -> HTTPBody?,
389389
_ expression2: @autoclosure () throws -> String,
390390
_ message: @autoclosure () -> String = "",
@@ -474,7 +474,7 @@ public func XCTAssertEqualAsyncData<C: Collection, AS: AsyncSequence>(
474474
}
475475

476476
/// Asserts that the data matches the expected value.
477-
public func XCTAssertEqualData<C: Collection>(
477+
func XCTAssertEqualData<C: Collection>(
478478
_ expression1: @autoclosure () throws -> HTTPBody?,
479479
_ expression2: @autoclosure () throws -> C,
480480
_ message: @autoclosure () -> String = "Data doesn't match.",

0 commit comments

Comments
 (0)