From 7ae6b5a7072736eea36999b7abf755a4f1cfc788 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Thu, 5 Oct 2023 22:19:40 +0200 Subject: [PATCH] Update all examples and integration tests to 0.3.0 --- Examples/GreetingService/Package.swift | 6 +++--- Examples/GreetingServiceClient/Package.swift | 6 ++---- .../GreetingServiceClient/GreetingServiceClient.swift | 4 ++-- .../Sources/GreetingServiceClient/openapi.yaml | 2 ++ IntegrationTest/Package.swift | 4 +--- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Examples/GreetingService/Package.swift b/Examples/GreetingService/Package.swift index 3685a655..bbf700b9 100644 --- a/Examples/GreetingService/Package.swift +++ b/Examples/GreetingService/Package.swift @@ -20,9 +20,9 @@ let package = Package( .macOS(.v13) ], dependencies: [ - .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.2.0")), - .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.2.0")), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.2.0")), + .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")), + .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")), + .package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.3.0")), .package(url: "https://github.com/vapor/vapor", from: "4.76.0"), ], targets: [ diff --git a/Examples/GreetingServiceClient/Package.swift b/Examples/GreetingServiceClient/Package.swift index 0cb8774d..98428dac 100644 --- a/Examples/GreetingServiceClient/Package.swift +++ b/Examples/GreetingServiceClient/Package.swift @@ -15,14 +15,12 @@ import PackageDescription let package = Package( - name: "GreetingService", + name: "GreetingServiceClient", platforms: [ .macOS(.v13) ], dependencies: [ - // TODO: When swift-openapi-generator is tagged with 0.3.0, stop depending on main. - // .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0"), - .package(url: "https://github.com/apple/swift-openapi-generator", branch: "main"), + .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")), .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")), .package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.3.0")), ], diff --git a/Examples/GreetingServiceClient/Sources/GreetingServiceClient/GreetingServiceClient.swift b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/GreetingServiceClient.swift index b06f62ae..6ac9ce01 100644 --- a/Examples/GreetingServiceClient/Sources/GreetingServiceClient/GreetingServiceClient.swift +++ b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/GreetingServiceClient.swift @@ -20,8 +20,8 @@ struct GreetingServiceClient { static func main() async throws { // Create an instance of the generated client type. let client: APIProtocol = Client( - // Server.server1() is generated, derived from the server URL in the OpenAPI document. - serverURL: try Servers.server1(), + // Server.server2() is generated, derived from the server URL in the OpenAPI document. + serverURL: try Servers.server2(), // URLSessionTransport conforms to ClientTransport and is provided by a separate package. transport: URLSessionTransport() ) diff --git a/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml index c670a499..613d6e3c 100644 --- a/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml +++ b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml @@ -5,6 +5,8 @@ info: servers: - url: https://example.com/api description: Example + - url: http://localhost:8080/api + description: Localhost paths: /greet: get: diff --git a/IntegrationTest/Package.swift b/IntegrationTest/Package.swift index 7b7ab5d7..e7078a02 100644 --- a/IntegrationTest/Package.swift +++ b/IntegrationTest/Package.swift @@ -32,9 +32,7 @@ let package = Package( ) ], dependencies: [ - // TODO: When swift-openapi-generator is tagged with 0.3.0, stop depending on main. - // .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0"), - .package(url: "https://github.com/apple/swift-openapi-generator", branch: "main"), + .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")), .package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")), ], targets: [