diff --git a/Examples/GreetingService/Sources/GreetingService/GreetingService.swift b/Examples/GreetingService/Sources/GreetingService/GreetingService.swift index 3c6c38fd..d2dbe747 100644 --- a/Examples/GreetingService/Sources/GreetingService/GreetingService.swift +++ b/Examples/GreetingService/Sources/GreetingService/GreetingService.swift @@ -55,7 +55,7 @@ struct Main { let handler = Handler() // Call the generated protocol function on the handler to configure the Vapor application. - try handler.registerHandlers(on: transport, serverURL: Servers.server1()) + try handler.registerHandlers(on: transport, serverURL: Servers.server2()) // Start the Vapor application, in the same way as if it was manually configured. try app.run() diff --git a/Examples/GreetingService/Sources/GreetingService/openapi.yaml b/Examples/GreetingService/Sources/GreetingService/openapi.yaml index c670a499..4408f4b1 100644 --- a/Examples/GreetingService/Sources/GreetingService/openapi.yaml +++ b/Examples/GreetingService/Sources/GreetingService/openapi.yaml @@ -1,10 +1,12 @@ -openapi: '3.0.3' +openapi: '3.1.0' info: title: GreetingService version: 1.0.0 servers: - url: https://example.com/api - description: Example + description: Example service deployment. + - url: http://127.0.0.1:8080/api + description: Localhost deployment. paths: /greet: get: @@ -13,7 +15,7 @@ paths: - name: name required: false in: query - description: A name used in the returned greeting. + description: The name used in the returned greeting. schema: type: string responses: diff --git a/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml index 613d6e3c..4408f4b1 100644 --- a/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml +++ b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml @@ -1,12 +1,12 @@ -openapi: '3.0.3' +openapi: '3.1.0' info: title: GreetingService version: 1.0.0 servers: - url: https://example.com/api - description: Example - - url: http://localhost:8080/api - description: Localhost + description: Example service deployment. + - url: http://127.0.0.1:8080/api + description: Localhost deployment. paths: /greet: get: @@ -15,7 +15,7 @@ paths: - name: name required: false in: query - description: A name used in the returned greeting. + description: The name used in the returned greeting. schema: type: string responses: diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientSwiftPM.tutorial b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/ClientSwiftPM.tutorial index ddc8ac9f..53f9da6e 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.8 ", destination: "https://developer.apple.com/download/") + @XcodeRequirement(title: "Swift 5.9 ", 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 7dcb8817..136acff4 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.8 ", destination: "https://developer.apple.com/download/") + @XcodeRequirement(title: "Swift 5.9 ", 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 c65d2dd0..c682b2b1 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.8 ", destination: "https://developer.apple.com/download/") + @XcodeRequirement(title: "Swift 5.9 ", 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 a6cde908..18b1cde1 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.8 +// swift-tools-version: 5.9 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 312a49ea..69ee9a89 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,10 +1,13 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( name: "GreetingServiceClient", platforms: [ - .macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), + .macOS(.v10_15), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6), ], targets: [ .executableTarget( 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 6ca9b71b..152870c6 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,10 +1,13 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( name: "GreetingServiceClient", platforms: [ - .macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), + .macOS(.v10_15), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6), ], dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")), 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 1534bc88..dc3f40a8 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,10 +1,13 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( name: "GreetingServiceClient", platforms: [ - .macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), + .macOS(.v10_15), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6), ], dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")), 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 26985fa5..395ff9ed 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,10 +1,13 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( name: "GreetingServiceClient", platforms: [ - .macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), + .macOS(.v10_15), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6), ], dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")), 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 26985fa5..395ff9ed 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,10 +1,13 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( name: "GreetingServiceClient", platforms: [ - .macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), + .macOS(.v10_15), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6), ], dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")), 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 eb40738a..f887b205 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.8 +// swift-tools-version: 5.9 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 6b677066..4d01de62 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.8 +// swift-tools-version: 5.9 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 f46c89f1..466836cb 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.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( @@ -10,7 +10,7 @@ let package = Package( .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"), + .package(url: "https://github.com/vapor/vapor", from: "4.84.0"), ], targets: [ .executableTarget( 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 863add15..58a5f8a8 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.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( @@ -10,7 +10,7 @@ let package = Package( .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"), + .package(url: "https://github.com/vapor/vapor", from: "4.84.0"), ], targets: [ .executableTarget( 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 b5dcd8a5..87c1450b 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.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( @@ -10,7 +10,7 @@ let package = Package( .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"), + .package(url: "https://github.com/vapor/vapor", from: "4.84.0"), ], targets: [ .executableTarget( 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 b5dcd8a5..87c1450b 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.8 +// swift-tools-version: 5.9 import PackageDescription let package = Package( @@ -10,7 +10,7 @@ let package = Package( .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"), + .package(url: "https://github.com/vapor/vapor", from: "4.84.0"), ], targets: [ .executableTarget( diff --git a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.main.2.swift b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.main.2.swift index 95aee116..e842a36c 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.main.2.swift +++ b/Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/server.main.2.swift @@ -17,7 +17,8 @@ struct GreetingServiceAPIImpl: APIProtocol { _ input: Operations.getEmoji.Input ) async throws -> Operations.getEmoji.Output { let emojis = "πŸ‘‹πŸ‘πŸ‘πŸ™πŸ€™πŸ€˜" - return .ok(.init(body: .text(String(emojis.randomElement()!)))) + let emoji = String(emojis.randomElement()!) + return .ok(.init(body: .plainText(.init(emoji)))) } }