diff --git a/Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp.xcodeproj/project.pbxproj b/Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp.xcodeproj/project.pbxproj index 7ec7c9e8c..a393f1685 100644 --- a/Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp.xcodeproj/project.pbxproj +++ b/Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp.xcodeproj/project.pbxproj @@ -459,7 +459,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.HelloWorldiOSClientApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -487,7 +487,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.HelloWorldiOSClientApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -504,7 +504,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.HelloWorldiOSClientAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorldiOSClientApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/HelloWorldiOSClientApp"; }; @@ -522,7 +522,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.HelloWorldiOSClientAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorldiOSClientApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/HelloWorldiOSClientApp"; }; @@ -539,7 +539,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.HelloWorldiOSClientAppUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = HelloWorldiOSClientApp; }; @@ -556,7 +556,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.example.HelloWorldiOSClientAppUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = HelloWorldiOSClientApp; }; diff --git a/Examples/auth-client-middleware-example/Package.swift b/Examples/auth-client-middleware-example/Package.swift index 4588b73e5..bd094e415 100644 --- a/Examples/auth-client-middleware-example/Package.swift +++ b/Examples/auth-client-middleware-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/auth-server-middleware-example/Package.swift b/Examples/auth-server-middleware-example/Package.swift index fef741e7f..e8005bdfc 100644 --- a/Examples/auth-server-middleware-example/Package.swift +++ b/Examples/auth-server-middleware-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/bidirectional-event-streams-client-example/Package.swift b/Examples/bidirectional-event-streams-client-example/Package.swift index c7df6cb98..158460ff2 100644 --- a/Examples/bidirectional-event-streams-client-example/Package.swift +++ b/Examples/bidirectional-event-streams-client-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/bidirectional-event-streams-server-example/Package.swift b/Examples/bidirectional-event-streams-server-example/Package.swift index ca55b8794..847f28e4f 100644 --- a/Examples/bidirectional-event-streams-server-example/Package.swift +++ b/Examples/bidirectional-event-streams-server-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/command-line-client-example/Package.swift b/Examples/command-line-client-example/Package.swift index 989298478..cfdba7e05 100644 --- a/Examples/command-line-client-example/Package.swift +++ b/Examples/command-line-client-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/curated-client-library-example/Package.swift b/Examples/curated-client-library-example/Package.swift index 3706ef00b..6d8d1ddec 100644 --- a/Examples/curated-client-library-example/Package.swift +++ b/Examples/curated-client-library-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/event-streams-client-example/Package.swift b/Examples/event-streams-client-example/Package.swift index b2adcc0e8..e97a5a052 100644 --- a/Examples/event-streams-client-example/Package.swift +++ b/Examples/event-streams-client-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/event-streams-server-example/Package.swift b/Examples/event-streams-server-example/Package.swift index 6ce7cc5d1..20ee87e7c 100644 --- a/Examples/event-streams-server-example/Package.swift +++ b/Examples/event-streams-server-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/hello-world-async-http-client-example/Package.swift b/Examples/hello-world-async-http-client-example/Package.swift index 29703d2ff..6cf04e799 100644 --- a/Examples/hello-world-async-http-client-example/Package.swift +++ b/Examples/hello-world-async-http-client-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/hello-world-hummingbird-server-example/Package.swift b/Examples/hello-world-hummingbird-server-example/Package.swift index cef2db231..73252f096 100644 --- a/Examples/hello-world-hummingbird-server-example/Package.swift +++ b/Examples/hello-world-hummingbird-server-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/hello-world-urlsession-client-example/Package.swift b/Examples/hello-world-urlsession-client-example/Package.swift index 71d66b2da..1e563b1c3 100644 --- a/Examples/hello-world-urlsession-client-example/Package.swift +++ b/Examples/hello-world-urlsession-client-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/hello-world-vapor-server-example/Package.swift b/Examples/hello-world-vapor-server-example/Package.swift index 524e500f2..f9f2750b3 100644 --- a/Examples/hello-world-vapor-server-example/Package.swift +++ b/Examples/hello-world-vapor-server-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/logging-middleware-oslog-example/Package.swift b/Examples/logging-middleware-oslog-example/Package.swift index 3b1507bab..d4ae2483c 100644 --- a/Examples/logging-middleware-oslog-example/Package.swift +++ b/Examples/logging-middleware-oslog-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/logging-middleware-swift-log-example/Package.swift b/Examples/logging-middleware-swift-log-example/Package.swift index e8842edab..d7c4a3143 100644 --- a/Examples/logging-middleware-swift-log-example/Package.swift +++ b/Examples/logging-middleware-swift-log-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/manual-generation-generator-cli-example/Package.swift b/Examples/manual-generation-generator-cli-example/Package.swift index ae2976576..c1049e3e1 100644 --- a/Examples/manual-generation-generator-cli-example/Package.swift +++ b/Examples/manual-generation-generator-cli-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/manual-generation-package-plugin-example/Package.swift b/Examples/manual-generation-package-plugin-example/Package.swift index 95c49958f..bd689dafc 100644 --- a/Examples/manual-generation-package-plugin-example/Package.swift +++ b/Examples/manual-generation-package-plugin-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/metrics-middleware-example/Package.swift b/Examples/metrics-middleware-example/Package.swift index d508a78e4..a64e7cebe 100644 --- a/Examples/metrics-middleware-example/Package.swift +++ b/Examples/metrics-middleware-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/metrics-middleware-example/docker/Dockerfile b/Examples/metrics-middleware-example/docker/Dockerfile index ecc2d18d8..cbd2a74fd 100644 --- a/Examples/metrics-middleware-example/docker/Dockerfile +++ b/Examples/metrics-middleware-example/docker/Dockerfile @@ -1,10 +1,10 @@ -FROM swift:5.9 AS builder +FROM swift:6.2 AS builder COPY ../Sources/ /code/Sources/ COPY ../Package.swift /code/Package.swift WORKDIR /code RUN swift build -c release -FROM swift:5.9-slim AS runtime +FROM swift:6.2-slim AS runtime COPY --from=builder /code/.build/release/HelloWorldVaporServer /HelloWorldVaporServer ENV HOST=0.0.0.0 ENV PORT=8080 diff --git a/Examples/postgres-database-example/Package.swift b/Examples/postgres-database-example/Package.swift index 036dfc3bb..37c38625b 100644 --- a/Examples/postgres-database-example/Package.swift +++ b/Examples/postgres-database-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/retrying-middleware-example/Package.swift b/Examples/retrying-middleware-example/Package.swift index 087e4ee9b..642524fe5 100644 --- a/Examples/retrying-middleware-example/Package.swift +++ b/Examples/retrying-middleware-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/shared-types-client-server-example/Package.swift b/Examples/shared-types-client-server-example/Package.swift index f30eb6345..d7b578054 100644 --- a/Examples/shared-types-client-server-example/Package.swift +++ b/Examples/shared-types-client-server-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/streaming-chatgpt-proxy/Package.swift b/Examples/streaming-chatgpt-proxy/Package.swift index 99d161fe3..24dfeb9db 100644 --- a/Examples/streaming-chatgpt-proxy/Package.swift +++ b/Examples/streaming-chatgpt-proxy/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 import PackageDescription let package = Package( diff --git a/Examples/swagger-ui-endpoint-example/Package.swift b/Examples/swagger-ui-endpoint-example/Package.swift index 04a608334..c6e5c191f 100644 --- a/Examples/swagger-ui-endpoint-example/Package.swift +++ b/Examples/swagger-ui-endpoint-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/tracing-middleware-example/Package.swift b/Examples/tracing-middleware-example/Package.swift index f983ed509..5938c9e15 100644 --- a/Examples/tracing-middleware-example/Package.swift +++ b/Examples/tracing-middleware-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/type-overrides-example/Package.swift b/Examples/type-overrides-example/Package.swift index 2751186aa..0d397e254 100644 --- a/Examples/type-overrides-example/Package.swift +++ b/Examples/type-overrides-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/various-content-types-client-example/Package.swift b/Examples/various-content-types-client-example/Package.swift index 5c598c1ba..165596a67 100644 --- a/Examples/various-content-types-client-example/Package.swift +++ b/Examples/various-content-types-client-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Examples/various-content-types-server-example/Package.swift b/Examples/various-content-types-server-example/Package.swift index 6d8e0798e..dc8cda1be 100644 --- a/Examples/various-content-types-server-example/Package.swift +++ b/Examples/various-content-types-server-example/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/IntegrationTest/Package.swift b/IntegrationTest/Package.swift index 0875530ca..8c5dad8f5 100644 --- a/IntegrationTest/Package.swift +++ b/IntegrationTest/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/Package.swift b/Package.swift index f2705fef1..c66a4d2e2 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project @@ -15,13 +15,6 @@ import Foundation import PackageDescription -// General Swift-settings for all targets. -var swiftSettings: [SwiftSetting] = [ - // https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md - // Require `any` for existential types. - .enableUpcomingFeature("ExistentialAny"), .enableExperimentalFeature("StrictConcurrency=complete"), -] - let package = Package( name: "swift-openapi-generator", platforms: [ @@ -54,7 +47,7 @@ let package = Package( // Tests-only: Runtime library linked by generated code, and also // helps keep the runtime library new enough to work with the generated // code. - .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.8.2"), + .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.10.1"), .package(url: "https://github.com/apple/swift-http-types", from: "1.0.2"), ], targets: [ @@ -69,23 +62,20 @@ let package = Package( .product(name: "Algorithms", package: "swift-algorithms"), .product(name: "OrderedCollections", package: "swift-collections"), .product(name: "Yams", package: "Yams"), - ], - swiftSettings: swiftSettings + ] ), // Generator Core Tests .testTarget( name: "OpenAPIGeneratorCoreTests", - dependencies: ["_OpenAPIGeneratorCore"], - swiftSettings: swiftSettings + dependencies: ["_OpenAPIGeneratorCore"] ), // GeneratorReferenceTests .testTarget( name: "OpenAPIGeneratorReferenceTests", dependencies: ["_OpenAPIGeneratorCore"], - resources: [.copy("Resources")], - swiftSettings: swiftSettings + resources: [.copy("Resources")] ), // Common types for concrete PetstoreConsumer*Tests test targets. @@ -94,8 +84,7 @@ let package = Package( dependencies: [ .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), .product(name: "HTTPTypes", package: "swift-http-types"), - ], - swiftSettings: swiftSettings + ] ), // PetstoreConsumerTests @@ -103,8 +92,7 @@ let package = Package( // to ensure it actually works correctly at runtime. .testTarget( name: "PetstoreConsumerTests", - dependencies: ["PetstoreConsumerTestCore"], - swiftSettings: swiftSettings + dependencies: ["PetstoreConsumerTestCore"] ), // Test Target for swift-openapi-generator @@ -118,8 +106,7 @@ let package = Package( condition: .when(platforms: [.android, .linux, .macOS, .openbsd, .wasi, .custom("freebsd")]) ), .product(name: "ArgumentParser", package: "swift-argument-parser"), ], - resources: [.copy("Resources")], - swiftSettings: swiftSettings + resources: [.copy("Resources")] ), // Generator CLI @@ -127,8 +114,7 @@ let package = Package( name: "swift-openapi-generator", dependencies: [ "_OpenAPIGeneratorCore", .product(name: "ArgumentParser", package: "swift-argument-parser"), - ], - swiftSettings: swiftSettings + ] ), // Build Plugin @@ -153,15 +139,27 @@ let package = Package( ] ) -// --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // for target in package.targets { switch target.type { - case .regular, .test, .executable: - var settings = target.swiftSettings ?? [] - // https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md - settings.append(.enableUpcomingFeature("MemberImportVisibility")) - target.swiftSettings = settings - case .macro, .plugin, .system, .binary: () // not applicable - @unknown default: () // we don't know what to do here, do nothing + case .executable, .regular, .test: + break + default: + continue } -}// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // + + var settings = target.swiftSettings ?? [] + + // https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md + // Require `any` for existential types. + settings.append(.enableUpcomingFeature("ExistentialAny")) + + // https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md + settings.append(.enableUpcomingFeature("MemberImportVisibility")) + + if target.name != "PetstoreConsumerTests" { + // https://github.com/swiftlang/swift-evolution/blob/main/proposals/0409-access-level-on-imports.md + settings.append(.enableUpcomingFeature("InternalImportsByDefault")) + } + + target.swiftSettings = settings +} \ No newline at end of file diff --git a/Plugins/PluginsShared/PluginError.swift b/Plugins/PluginsShared/PluginError.swift index 6341f9af3..cc0b304f2 100644 --- a/Plugins/PluginsShared/PluginError.swift +++ b/Plugins/PluginsShared/PluginError.swift @@ -73,7 +73,7 @@ struct FileError: Swift.Error, Equatable, CustomStringConvertible, LocalizedErro } /// Encountered issue. - enum Issue: Equatable { + enum Issue: Equatable, /* remove unchecked when 6.1 is minimum version and we migrate from Path to URL */ @unchecked Sendable { /// File wasn't found. case noFilesFound /// More than 1 file found. diff --git a/Sources/PetstoreConsumerTestCore/Assertions.swift b/Sources/PetstoreConsumerTestCore/Assertions.swift index d68514a6c..3d30de101 100644 --- a/Sources/PetstoreConsumerTestCore/Assertions.swift +++ b/Sources/PetstoreConsumerTestCore/Assertions.swift @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// import Foundation -import XCTest -import OpenAPIRuntime +package import XCTest +package import OpenAPIRuntime /// Asserts that the stringified data matches the expected string value. -public func XCTAssertEqualStringifiedData( +package func XCTAssertEqualStringifiedData( _ expression1: @autoclosure () throws -> Data?, _ expression2: @autoclosure () throws -> String, _ message: @autoclosure () -> String = "", @@ -50,7 +50,7 @@ public func XCTAssertEqualStringifiedData( } catch { XCTFail(error.localizedDescription, file: file, line: line) } } /// Asserts that the stringified data matches the expected string value. -public func XCTAssertEqualStringifiedData( +package func XCTAssertEqualStringifiedData( _ expression1: @autoclosure () throws -> HTTPBody?, _ expression2: @autoclosure () throws -> String, _ message: @autoclosure () -> String = "", @@ -120,7 +120,7 @@ public func XCTAssertEqualData( } catch { XCTFail(error.localizedDescription, file: file, line: line) } } /// Asserts that the data matches the expected value. -public func XCTAssertEqualData( +package func XCTAssertEqualData( _ expression1: @autoclosure () throws -> HTTPBody?, _ expression2: @autoclosure () throws -> C, _ message: @autoclosure () -> String = "Data doesn't match.", diff --git a/Sources/PetstoreConsumerTestCore/Common.swift b/Sources/PetstoreConsumerTestCore/Common.swift index 9b53a8033..9bb113a9f 100644 --- a/Sources/PetstoreConsumerTestCore/Common.swift +++ b/Sources/PetstoreConsumerTestCore/Common.swift @@ -11,19 +11,19 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import OpenAPIRuntime -import Foundation -import HTTPTypes +package import OpenAPIRuntime +package import Foundation +package import HTTPTypes /// An error used by Petstore tests. -public enum TestError: Swift.Error, LocalizedError, CustomStringConvertible, Sendable { +package enum TestError: Swift.Error, LocalizedError, CustomStringConvertible, Sendable { case noHandlerFound(method: HTTPRequest.Method, path: String) case invalidURLString(String) case unexpectedValue(any Sendable) case unexpectedMissingRequestBody /// A human-readable description of the error. - public var description: String { + package var description: String { switch self { case .noHandlerFound(let method, let path): return "No handler found for method \(method) and path \(path)" case .invalidURLString(let string): return "Invalid URL string: \(string)" @@ -33,16 +33,16 @@ public enum TestError: Swift.Error, LocalizedError, CustomStringConvertible, Sen } /// A localized description of the error suitable for presenting to the user. - public var errorDescription: String? { description } + package var errorDescription: String? { description } } -public extension Date { +package extension Date { static var test: Date { Date(timeIntervalSince1970: 1_674_036_251) } static var testString: String { "2023-01-18T10:04:11Z" } } -public extension HTTPResponse { +package extension HTTPResponse { func withEncodedBody(_ encodedBody: String) throws -> (HTTPResponse, HTTPBody) { (self, .init(encodedBody)) } @@ -63,7 +63,7 @@ public extension HTTPResponse { } } -public extension Data { +package extension Data { var pretty: String { String(decoding: self, as: UTF8.self) } static var abcdString: String { "abcd" } @@ -174,6 +174,6 @@ public extension Data { } } -public extension HTTPRequest { +package extension HTTPRequest { func withEncodedBody(_ encodedBody: String) -> (HTTPRequest, HTTPBody) { (self, .init(encodedBody)) } } diff --git a/Sources/PetstoreConsumerTestCore/TestClientTransport.swift b/Sources/PetstoreConsumerTestCore/TestClientTransport.swift index 111a400a8..1df44933e 100644 --- a/Sources/PetstoreConsumerTestCore/TestClientTransport.swift +++ b/Sources/PetstoreConsumerTestCore/TestClientTransport.swift @@ -11,9 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import OpenAPIRuntime -import Foundation -import HTTPTypes +package import OpenAPIRuntime +package import Foundation +package import HTTPTypes /// A test implementation of the `ClientTransport` protocol. /// @@ -30,19 +30,19 @@ import HTTPTypes /// /// let client = APIClient(transport: testTransport) /// ``` -public struct TestClientTransport: ClientTransport { +package struct TestClientTransport: ClientTransport { /// A typealias representing a call handler closure for processing client requests. - public typealias CallHandler = + package typealias CallHandler = @Sendable (HTTPRequest, HTTPBody?, URL, String) async throws -> (HTTPResponse, HTTPBody?) /// The call handler responsible for processing client requests. - public let callHandler: CallHandler + package let callHandler: CallHandler /// Initializes a `TestClientTransport` instance with a custom call handler. /// /// - Parameter callHandler: The closure responsible for processing client requests. - public init(callHandler: @escaping CallHandler) { self.callHandler = callHandler } + package init(callHandler: @escaping CallHandler) { self.callHandler = callHandler } /// Sends a client request using the test transport. /// @@ -53,7 +53,7 @@ public struct TestClientTransport: ClientTransport { /// - operationID: The ID of the operation being performed. /// - Returns: The response received from the call handler. /// - Throws: An error if the call handler encounters an issue. - public func send(_ request: HTTPRequest, body: HTTPBody?, baseURL: URL, operationID: String) async throws -> ( + package func send(_ request: HTTPRequest, body: HTTPBody?, baseURL: URL, operationID: String) async throws -> ( HTTPResponse, HTTPBody? ) { try await callHandler(request, body, baseURL, operationID) } } diff --git a/Sources/PetstoreConsumerTestCore/TestServerTransport.swift b/Sources/PetstoreConsumerTestCore/TestServerTransport.swift index c4b3d68f1..8e07cf4b4 100644 --- a/Sources/PetstoreConsumerTestCore/TestServerTransport.swift +++ b/Sources/PetstoreConsumerTestCore/TestServerTransport.swift @@ -11,8 +11,8 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import OpenAPIRuntime -import HTTPTypes +package import OpenAPIRuntime +package import HTTPTypes /// A test implementation of the `ServerTransport` protocol for simulating server-side API handling. /// @@ -30,52 +30,52 @@ import HTTPTypes /// /// let server = MyServer(transport: testTransport) /// ``` -public final class TestServerTransport: ServerTransport { +package final class TestServerTransport: ServerTransport { /// Represents the input parameters for an API operation. - public struct OperationInputs: Equatable { + package struct OperationInputs: Equatable { /// The HTTP method of the operation. - public var method: HTTPRequest.Method + package var method: HTTPRequest.Method /// The path components of the operation's route. - public var path: String + package var path: String /// Initializes a new instance of `OperationInputs`. /// /// - Parameters: /// - method: The HTTP method of the operation. /// - path: The path components of the operation's route. - public init(method: HTTPRequest.Method, path: String) { + package init(method: HTTPRequest.Method, path: String) { self.method = method self.path = path } } /// A typealias representing a handler closure for processing server requests. - public typealias Handler = + package typealias Handler = @Sendable (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> (HTTPResponse, HTTPBody?) /// Represents an operation with its inputs and associated handler. - public struct Operation { + package struct Operation { /// The input parameters for the API operation. - public var inputs: OperationInputs + package var inputs: OperationInputs /// The closure representing the server operation logic. - public var closure: Handler + package var closure: Handler /// Initializes a new instance of `Operation`. /// /// - Parameters: /// - inputs: The input parameters for the API operation. /// - closure: The closure representing the server operation logic - public init(inputs: OperationInputs, closure: @escaping Handler) { + package init(inputs: OperationInputs, closure: @escaping Handler) { self.inputs = inputs self.closure = closure } } /// Initializes a new instance of `TestServerTransport`. - public init() {} + package init() {} /// The array of registered operations. - public private(set) var registered: [Operation] = [] + package private(set) var registered: [Operation] = [] /// Registers a new API operation handler with specific parameters. /// @@ -84,7 +84,7 @@ public final class TestServerTransport: ServerTransport { /// - method: The HTTP method of the operation. /// - path: The path components of the operation. /// - Throws: An error if there's an issue registering the operation. - public func register( + package func register( _ handler: @Sendable @escaping (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> ( HTTPResponse, HTTPBody? diff --git a/Sources/_OpenAPIGeneratorCore/Diagnostics.swift b/Sources/_OpenAPIGeneratorCore/Diagnostics.swift index e23e0613d..b8776b240 100644 --- a/Sources/_OpenAPIGeneratorCore/Diagnostics.swift +++ b/Sources/_OpenAPIGeneratorCore/Diagnostics.swift @@ -11,8 +11,8 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import Foundation -import OpenAPIKit +public import Foundation +public import OpenAPIKit /// A message emitted by the generator. public struct Diagnostic: Error, Codable, Sendable { diff --git a/Sources/_OpenAPIGeneratorCore/DiagnosticsCollectorProvider.swift b/Sources/_OpenAPIGeneratorCore/DiagnosticsCollectorProvider.swift index 965eebb0a..614c13f72 100644 --- a/Sources/_OpenAPIGeneratorCore/DiagnosticsCollectorProvider.swift +++ b/Sources/_OpenAPIGeneratorCore/DiagnosticsCollectorProvider.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -import Foundation +public import Foundation /// Prepares a diagnostics collector. /// - Parameter outputPath: A file path where to persist the YAML file. If `nil`, diagnostics will be printed to stderr. diff --git a/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift b/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift index b75008a0e..ffee5c571 100644 --- a/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift +++ b/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift @@ -11,7 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import Foundation +public import Foundation #if $RetroactiveAttribute extension FileHandle: @retroactive TextOutputStream {} diff --git a/Sources/_OpenAPIGeneratorCore/Hooks/DocumentFilter.swift b/Sources/_OpenAPIGeneratorCore/Hooks/DocumentFilter.swift index 2b2af38c2..4c9975d0a 100644 --- a/Sources/_OpenAPIGeneratorCore/Hooks/DocumentFilter.swift +++ b/Sources/_OpenAPIGeneratorCore/Hooks/DocumentFilter.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -@preconcurrency import OpenAPIKit +@preconcurrency public import OpenAPIKit /// Rules used to filter an OpenAPI document. public struct DocumentFilter: Codable, Sendable { diff --git a/Sources/_OpenAPIGeneratorCore/Layers/RenderedSwiftRepresentation.swift b/Sources/_OpenAPIGeneratorCore/Layers/RenderedSwiftRepresentation.swift index 3a9c89e36..872c044d7 100644 --- a/Sources/_OpenAPIGeneratorCore/Layers/RenderedSwiftRepresentation.swift +++ b/Sources/_OpenAPIGeneratorCore/Layers/RenderedSwiftRepresentation.swift @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// #if os(Linux) -@preconcurrency import struct Foundation.URL -@preconcurrency import struct Foundation.Data +@preconcurrency public import struct Foundation.URL +@preconcurrency public import struct Foundation.Data #else -import struct Foundation.URL -import struct Foundation.Data +public import struct Foundation.URL +public import struct Foundation.Data #endif /// An in-memory file that contains the generated Swift code. diff --git a/Sources/_OpenAPIGeneratorCore/Parser/YamsParser.swift b/Sources/_OpenAPIGeneratorCore/Parser/YamsParser.swift index ac646b56b..582f2bde8 100644 --- a/Sources/_OpenAPIGeneratorCore/Parser/YamsParser.swift +++ b/Sources/_OpenAPIGeneratorCore/Parser/YamsParser.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Foundation -import OpenAPIKit +public import OpenAPIKit import OpenAPIKit30 import OpenAPIKitCompat import Yams diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientSwiftPM.tutorial b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientSwiftPM.tutorial index 11f1a22ae..90b1cb633 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientSwiftPM.tutorial +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientSwiftPM.tutorial @@ -1,5 +1,5 @@ @Tutorial(time: 20) { - @XcodeRequirement(title: "Swift 5.9 ", destination: "https://developer.apple.com/download/applications/") + @XcodeRequirement(title: "Swift 6.0 ", destination: "https://developer.apple.com/download/applications/") @Intro(title: "Generating a client in a Swift package") { This tutorial guides you through building _GreetingServiceClient_—an API client for a fictitious service that returns a personalized greeting. diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientXcode.tutorial b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientXcode.tutorial index 36a54bb66..9f785b74f 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientXcode.tutorial +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientXcode.tutorial @@ -1,5 +1,5 @@ @Tutorial(time: 20) { - @XcodeRequirement(title: "Swift 5.9 ", destination: "https://developer.apple.com/download/applications/") + @XcodeRequirement(title: "Swift 6.0 ", destination: "https://developer.apple.com/download/applications/") @Intro(title: "Generating a client in an Xcode project") { This tutorial guides you through building _GreetingServiceClient_—an API client for a fictitious service that returns a personalized greeting. diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ServerSwiftPM.tutorial b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ServerSwiftPM.tutorial index 917e12cea..699e9e8f4 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ServerSwiftPM.tutorial +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ServerSwiftPM.tutorial @@ -1,5 +1,5 @@ @Tutorial(time: 20) { - @XcodeRequirement(title: "Swift 5.9 ", destination: "https://developer.apple.com/download/applications/") + @XcodeRequirement(title: "Swift 6.0 ", destination: "https://developer.apple.com/download/applications/") @Intro(title: "Generating server stubs in a Swift package") { diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.0.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.0.swift index 3596a147b..2f4286f1b 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.0.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.0.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.1.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.1.swift index f92bb26c8..eef1320ab 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.1.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.1.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.2.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.2.swift index 65afa8ef6..a580365c1 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.2.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.2.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.3.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.3.swift index e54fd0cf9..249f8f72d 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.3.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.3.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.4.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.4.swift index 30c6268d3..35a36e77c 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.4.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.4.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.5.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.5.swift index 30c6268d3..35a36e77c 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.5.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.Package.5.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.0.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.0.swift index 48155db20..e6db09f12 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.0.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.0.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.1.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.1.swift index aa31ee691..081a77a70 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.1.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.1.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.2.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.2.swift index c9d36bc75..2cda6dcc0 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.2.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.2.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.3.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.3.swift index b4ef1f0d3..f869eae63 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.3.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.3.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.4.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.4.swift index a8559045d..eb1fdd984 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.4.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.4.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.5.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.5.swift index a8559045d..eb1fdd984 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.5.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.Package.5.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription let package = Package( diff --git a/Sources/swift-openapi-generator/Extensions.swift b/Sources/swift-openapi-generator/Extensions.swift index 76f433616..3cb3a6766 100644 --- a/Sources/swift-openapi-generator/Extensions.swift +++ b/Sources/swift-openapi-generator/Extensions.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Foundation -import ArgumentParser +public import ArgumentParser import _OpenAPIGeneratorCore import Yams @@ -30,7 +30,7 @@ extension URL { /// /// Initializes a `URL` instance using the path provided as an argument string. /// - Parameter argument: The string argument representing the path for the URL. - public init?(argument: String) { self.init(fileURLWithPath: argument) } + init?(argument: String) { self.init(fileURLWithPath: argument) } } extension CaseIterable where Self: RawRepresentable, Self.RawValue == String { diff --git a/Sources/swift-openapi-generator/GenerateOptions.swift b/Sources/swift-openapi-generator/GenerateOptions.swift index 182a2e921..e1ce9b9f8 100644 --- a/Sources/swift-openapi-generator/GenerateOptions.swift +++ b/Sources/swift-openapi-generator/GenerateOptions.swift @@ -11,7 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import ArgumentParser +public import ArgumentParser import Foundation import Yams import OpenAPIKit diff --git a/Tests/OpenAPIGeneratorCoreTests/Parser/Test_YamsParser.swift b/Tests/OpenAPIGeneratorCoreTests/Parser/Test_YamsParser.swift index 46bcd0294..b30c18465 100644 --- a/Tests/OpenAPIGeneratorCoreTests/Parser/Test_YamsParser.swift +++ b/Tests/OpenAPIGeneratorCoreTests/Parser/Test_YamsParser.swift @@ -179,7 +179,7 @@ final class Test_YamsParser: Test_Core { private func assertThrownError( _ closure: @autoclosure () throws -> ParsedOpenAPIRepresentation, expectedDiagnostic: String, - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) { XCTAssertThrowsError(try closure(), file: file, line: line) { error in diff --git a/Tests/OpenAPIGeneratorCoreTests/Renderer/Test_TextBasedRenderer.swift b/Tests/OpenAPIGeneratorCoreTests/Renderer/Test_TextBasedRenderer.swift index 4919a7867..795d09e25 100644 --- a/Tests/OpenAPIGeneratorCoreTests/Renderer/Test_TextBasedRenderer.swift +++ b/Tests/OpenAPIGeneratorCoreTests/Renderer/Test_TextBasedRenderer.swift @@ -755,7 +755,7 @@ extension Test_TextBasedRenderer { _ input: Input, renderedBy renderClosure: (TextBasedRenderer) -> ((Input) -> String), rendersAs output: String, - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) throws { let renderer = TextBasedRenderer.default diff --git a/Tests/OpenAPIGeneratorCoreTests/Translator/CommonTypes/Test_DiscriminatorExtensions.swift b/Tests/OpenAPIGeneratorCoreTests/Translator/CommonTypes/Test_DiscriminatorExtensions.swift index 2b6daa90a..d30ec830f 100644 --- a/Tests/OpenAPIGeneratorCoreTests/Translator/CommonTypes/Test_DiscriminatorExtensions.swift +++ b/Tests/OpenAPIGeneratorCoreTests/Translator/CommonTypes/Test_DiscriminatorExtensions.swift @@ -30,7 +30,7 @@ final class Test_DiscriminatorExtensions: Test_Core { mapping: OrderedDictionary?, schemaNames: [String], expectedOutputs: [Output], - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) throws { let discriminator = OpenAPI.Discriminator(propertyName: "which", mapping: mapping) diff --git a/Tests/OpenAPIGeneratorCoreTests/Translator/Multipart/Test_MultipartContentInspector.swift b/Tests/OpenAPIGeneratorCoreTests/Translator/Multipart/Test_MultipartContentInspector.swift index c388a5509..3e81ed595 100644 --- a/Tests/OpenAPIGeneratorCoreTests/Translator/Multipart/Test_MultipartContentInspector.swift +++ b/Tests/OpenAPIGeneratorCoreTests/Translator/Multipart/Test_MultipartContentInspector.swift @@ -24,7 +24,7 @@ class Test_MultipartContentInspector: Test_Core { source: MultipartPartInfo.ContentTypeSource, repetition: MultipartPartInfo.RepetitionKind, schemaOut: JSONSchema, - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) throws { let (info, actualSchemaOut) = try XCTUnwrap( diff --git a/Tests/OpenAPIGeneratorCoreTests/Translator/TypeAssignment/Test_RecursionDetector_Generic.swift b/Tests/OpenAPIGeneratorCoreTests/Translator/TypeAssignment/Test_RecursionDetector_Generic.swift index a640f9ce1..22a5a509a 100644 --- a/Tests/OpenAPIGeneratorCoreTests/Translator/TypeAssignment/Test_RecursionDetector_Generic.swift +++ b/Tests/OpenAPIGeneratorCoreTests/Translator/TypeAssignment/Test_RecursionDetector_Generic.swift @@ -113,7 +113,7 @@ class Test_RecursionDetector_Generic: Test_Core { rootNodes: [String], putIntoContainer nodesForContainer: [TestNode], expected expectedRecursed: Set, - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) throws { precondition(Set(rootNodes).count == nodesForContainer.count, "Not all nodes are mentioned in rootNodes") diff --git a/Tests/OpenAPIGeneratorReferenceTests/CompatabilityTest.swift b/Tests/OpenAPIGeneratorReferenceTests/CompatabilityTest.swift index b99a4c89d..7f44a7b1b 100644 --- a/Tests/OpenAPIGeneratorReferenceTests/CompatabilityTest.swift +++ b/Tests/OpenAPIGeneratorReferenceTests/CompatabilityTest.swift @@ -287,7 +287,7 @@ fileprivate extension CompatibilityTest { XCTAssertNoThrow(try FileManager.default.createDirectory(at: packageDir, withIntermediateDirectories: true)) let packageSwiftPath = packageDir.appendingPathComponent("Package.swift", isDirectory: false) let packageSwiftContents = """ - // swift-tools-version:5.9 + // swift-tools-version:6.0 import PackageDescription let package = Package( name: "\(packageName)", diff --git a/Tests/PetstoreConsumerTests/Common.swift b/Tests/PetstoreConsumerTests/Common.swift index 0fa07dc97..a26930d7b 100644 --- a/Tests/PetstoreConsumerTests/Common.swift +++ b/Tests/PetstoreConsumerTests/Common.swift @@ -25,7 +25,7 @@ extension HTTPRequest { /// - path: The path of the HTTP request. /// - method: The HTTP method (e.g., GET, POST, PUT, DELETE, etc.). /// - headerFields: HTTP header fields to include in the request. - public init(soar_path path: String, method: Method, headerFields: HTTPFields = .init()) { + init(soar_path path: String, method: Method, headerFields: HTTPFields = .init()) { self.init(method: method, scheme: nil, authority: nil, path: path, headerFields: headerFields) } } diff --git a/Tests/PetstoreConsumerTests/Test_Types.swift b/Tests/PetstoreConsumerTests/Test_Types.swift index d01973b0f..c08cc3f7a 100644 --- a/Tests/PetstoreConsumerTests/Test_Types.swift +++ b/Tests/PetstoreConsumerTests/Test_Types.swift @@ -84,7 +84,7 @@ final class Test_Types: XCTestCase { func testJSON( _ value: T, expectedJSON: String, - file: StaticString = #file, + file: StaticString = #filePath, line: UInt = #line ) throws { let data = try testEncoder.encode(value)