diff --git a/Examples/auth-server-middleware-example/Package.swift b/Examples/auth-server-middleware-example/Package.swift index c11543df3..fef741e7f 100644 --- a/Examples/auth-server-middleware-example/Package.swift +++ b/Examples/auth-server-middleware-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ diff --git a/Examples/auth-server-middleware-example/README.md b/Examples/auth-server-middleware-example/README.md index 8796e953e..76ca288d7 100644 --- a/Examples/auth-server-middleware-example/README.md +++ b/Examples/auth-server-middleware-example/README.md @@ -11,7 +11,7 @@ with a new target, `AuthenticationServerMiddleware`, which is then used when reg NOTE: This example shows just one way of varifying authentication information in a middleware and is purely for illustrative purposes. -The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/swift-server/swift-openapi-vapor). +The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/vapor/swift-openapi-vapor). The CLI starts the server on `http://localhost:8080` and can be invoked by running the `AuthenticationClientMiddleware` example client or on the command line using: diff --git a/Examples/bidirectional-event-streams-server-example/Package.swift b/Examples/bidirectional-event-streams-server-example/Package.swift index ba7a60574..ca55b8794 100644 --- a/Examples/bidirectional-event-streams-server-example/Package.swift +++ b/Examples/bidirectional-event-streams-server-example/Package.swift @@ -21,7 +21,7 @@ let package = Package( .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), .package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.5.0"), - .package(url: "https://github.com/swift-server/swift-openapi-hummingbird.git", from: "2.0.1"), + .package(url: "https://github.com/hummingbird-project/swift-openapi-hummingbird.git", from: "2.0.1"), ], targets: [ .executableTarget( diff --git a/Examples/bidirectional-event-streams-server-example/README.md b/Examples/bidirectional-event-streams-server-example/README.md index 32b03419f..4f45e2886 100644 --- a/Examples/bidirectional-event-streams-server-example/README.md +++ b/Examples/bidirectional-event-streams-server-example/README.md @@ -8,7 +8,7 @@ An example project using [Swift OpenAPI Generator](https://github.com/apple/swif A server that uses generated server stubs to show how to work with bidirectional event streams. -The tool uses the [Hummingbird](https://github.com/hummingbird-project/hummingbird) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Hummingbird](https://github.com/swift-server/swift-openapi-hummingbird). +The tool uses the [Hummingbird](https://github.com/hummingbird-project/hummingbird) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Hummingbird](https://github.com/hummingbird-project/swift-openapi-hummingbird). The CLI starts the server on `http://localhost:8080` and can be invoked by running `bidirectional-event-streams-client-example`. diff --git a/Examples/event-streams-server-example/Package.swift b/Examples/event-streams-server-example/Package.swift index a5d2fb68e..6ce7cc5d1 100644 --- a/Examples/event-streams-server-example/Package.swift +++ b/Examples/event-streams-server-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ diff --git a/Examples/event-streams-server-example/README.md b/Examples/event-streams-server-example/README.md index 063914d70..6f4edf66a 100644 --- a/Examples/event-streams-server-example/README.md +++ b/Examples/event-streams-server-example/README.md @@ -8,7 +8,7 @@ An example project using [Swift OpenAPI Generator](https://github.com/apple/swif A server that uses generated server stubs to show how to work with event streams, such as JSON Lines, JSON Sequence, and Server-sent Events. -The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/swift-server/swift-openapi-vapor). +The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/vapor/swift-openapi-vapor). The CLI starts the server on `http://localhost:8080` and can be invoked by running `event-streams-client-example` or on the command line using: diff --git a/Examples/hello-world-hummingbird-server-example/Package.swift b/Examples/hello-world-hummingbird-server-example/Package.swift index 2d460717b..cef2db231 100644 --- a/Examples/hello-world-hummingbird-server-example/Package.swift +++ b/Examples/hello-world-hummingbird-server-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-hummingbird", from: "2.0.1"), + .package(url: "https://github.com/hummingbird-project/swift-openapi-hummingbird", from: "2.0.1"), .package(url: "https://github.com/hummingbird-project/hummingbird", from: "2.5.0"), ], targets: [ diff --git a/Examples/hello-world-hummingbird-server-example/README.md b/Examples/hello-world-hummingbird-server-example/README.md index 09586a086..63262bc72 100644 --- a/Examples/hello-world-hummingbird-server-example/README.md +++ b/Examples/hello-world-hummingbird-server-example/README.md @@ -8,7 +8,7 @@ An example project using [Swift OpenAPI Generator](https://github.com/apple/swif A "hello world" server that uses generated server stubs to handle requests as the Greeting Service. -The tool uses the [Hummingbird](https://github.com/hummingbird-project/hummingbird) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Hummingbird Transport](https://github.com/swift-server/swift-openapi-hummingbird). +The tool uses the [Hummingbird](https://github.com/hummingbird-project/hummingbird) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Hummingbird Transport](https://github.com/hummingbird-project/swift-openapi-hummingbird). The CLI starts the server on `http://localhost:8080` and can be invoked by running any of the Hello World example clients or on the command line using: diff --git a/Examples/hello-world-vapor-server-example/Package.swift b/Examples/hello-world-vapor-server-example/Package.swift index 05700fe3f..524e500f2 100644 --- a/Examples/hello-world-vapor-server-example/Package.swift +++ b/Examples/hello-world-vapor-server-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ diff --git a/Examples/hello-world-vapor-server-example/README.md b/Examples/hello-world-vapor-server-example/README.md index 6d5b968e3..67484d422 100644 --- a/Examples/hello-world-vapor-server-example/README.md +++ b/Examples/hello-world-vapor-server-example/README.md @@ -8,7 +8,7 @@ An example project using [Swift OpenAPI Generator](https://github.com/apple/swif A "hello world" server that uses generated server stubs to handle requests as the Greeting Service. -The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/swift-server/swift-openapi-vapor). +The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/vapor/swift-openapi-vapor). The CLI starts the server on `http://localhost:8080` and can be invoked by running any of the Hello World example clients or on the command line using: diff --git a/Examples/logging-middleware-oslog-example/Sources/LoggingMiddleware/LoggingMiddleware.swift b/Examples/logging-middleware-oslog-example/Sources/LoggingMiddleware/LoggingMiddleware.swift index 0cf93378d..860d9b031 100644 --- a/Examples/logging-middleware-oslog-example/Sources/LoggingMiddleware/LoggingMiddleware.swift +++ b/Examples/logging-middleware-oslog-example/Sources/LoggingMiddleware/LoggingMiddleware.swift @@ -59,7 +59,8 @@ extension LoggingMiddleware: ServerMiddleware { body: OpenAPIRuntime.HTTPBody?, metadata: OpenAPIRuntime.ServerRequestMetadata, operationID: String, - next: @Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata) + next: + @Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) ) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) { let (requestBodyToLog, requestBodyForNext) = try await bodyLoggingPolicy.process(body) diff --git a/Examples/logging-middleware-swift-log-example/Sources/LoggingMiddleware/LoggingMiddleware.swift b/Examples/logging-middleware-swift-log-example/Sources/LoggingMiddleware/LoggingMiddleware.swift index a95752a31..04500c4e7 100644 --- a/Examples/logging-middleware-swift-log-example/Sources/LoggingMiddleware/LoggingMiddleware.swift +++ b/Examples/logging-middleware-swift-log-example/Sources/LoggingMiddleware/LoggingMiddleware.swift @@ -56,7 +56,8 @@ extension LoggingMiddleware: ServerMiddleware { body: OpenAPIRuntime.HTTPBody?, metadata: OpenAPIRuntime.ServerRequestMetadata, operationID: String, - next: @Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata) + next: + @Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) ) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) { let (requestBodyToLog, requestBodyForNext) = try await bodyLoggingPolicy.process(body) diff --git a/Examples/metrics-middleware-example/Package.swift b/Examples/metrics-middleware-example/Package.swift index 9b1470389..d508a78e4 100644 --- a/Examples/metrics-middleware-example/Package.swift +++ b/Examples/metrics-middleware-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), .package(url: "https://github.com/apple/swift-metrics", from: "2.4.1"), .package(url: "https://github.com/swift-server/swift-prometheus", from: "2.0.0"), diff --git a/Examples/postgres-database-example/Package.swift b/Examples/postgres-database-example/Package.swift index 07d42b09a..036dfc3bb 100644 --- a/Examples/postgres-database-example/Package.swift +++ b/Examples/postgres-database-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), .package(url: "https://github.com/vapor/postgres-nio", from: "1.19.1"), ], diff --git a/Examples/shared-types-client-server-example/Package.swift b/Examples/shared-types-client-server-example/Package.swift index 49ef04ab2..f30eb6345 100644 --- a/Examples/shared-types-client-server-example/Package.swift +++ b/Examples/shared-types-client-server-example/Package.swift @@ -25,7 +25,7 @@ let package = Package( .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), .package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0"), - .package(url: "https://github.com/swift-server/swift-openapi-hummingbird", from: "2.0.0"), + .package(url: "https://github.com/hummingbird-project/swift-openapi-hummingbird", from: "2.0.0"), ], targets: [ .target( diff --git a/Examples/streaming-chatgpt-proxy/Package.swift b/Examples/streaming-chatgpt-proxy/Package.swift index df93487fd..99d161fe3 100644 --- a/Examples/streaming-chatgpt-proxy/Package.swift +++ b/Examples/streaming-chatgpt-proxy/Package.swift @@ -8,7 +8,7 @@ let package = Package( .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.2"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.1"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.1"), .package(url: "https://github.com/swift-server/swift-openapi-async-http-client", from: "1.1.0"), ], targets: [ diff --git a/Examples/swagger-ui-endpoint-example/Package.swift b/Examples/swagger-ui-endpoint-example/Package.swift index f0b65a221..04a608334 100644 --- a/Examples/swagger-ui-endpoint-example/Package.swift +++ b/Examples/swagger-ui-endpoint-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.108.0"), ], targets: [ diff --git a/Examples/swagger-ui-endpoint-example/README.md b/Examples/swagger-ui-endpoint-example/README.md index 37560513d..cfbb8de35 100644 --- a/Examples/swagger-ui-endpoint-example/README.md +++ b/Examples/swagger-ui-endpoint-example/README.md @@ -21,7 +21,7 @@ The OpenAPI document also contains the following server definition, which allows description: This server. ``` -The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/swift-server/swift-openapi-vapor). +The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/vapor/swift-openapi-vapor). The CLI starts the server on `http://localhost:8080` and you can go to `http://localhost:8080/openapi.yaml` to see the raw OpenAPI document, and to `http://localhost:8080/openapi` to see the rendered documentation. diff --git a/Examples/tracing-middleware-example/Package.swift b/Examples/tracing-middleware-example/Package.swift index 9f7bfdf55..f983ed509 100644 --- a/Examples/tracing-middleware-example/Package.swift +++ b/Examples/tracing-middleware-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.108.0"), .package(url: "https://github.com/apple/swift-distributed-tracing", from: "1.0.1"), .package(url: "https://github.com/apple/swift-distributed-tracing-extras", exact: "1.0.0-beta.1"), diff --git a/Examples/various-content-types-server-example/Package.swift b/Examples/various-content-types-server-example/Package.swift index e5a529ad6..6d8e0798e 100644 --- a/Examples/various-content-types-server-example/Package.swift +++ b/Examples/various-content-types-server-example/Package.swift @@ -20,7 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ diff --git a/Examples/various-content-types-server-example/README.md b/Examples/various-content-types-server-example/README.md index 9e03b1122..97f6ad2f1 100644 --- a/Examples/various-content-types-server-example/README.md +++ b/Examples/various-content-types-server-example/README.md @@ -8,7 +8,7 @@ An example project using [Swift OpenAPI Generator](https://github.com/apple/swif A server that uses generated server stubs to show how to work with various HTTP content types. -The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/swift-server/swift-openapi-vapor). +The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to handle HTTP requests, wrapped in the [Swift OpenAPI Vapor Transport](https://github.com/vapor/swift-openapi-vapor). The CLI starts the server on `http://localhost:8080` and can be invoked by running `various-content-types-client-example` or on the command line using: diff --git a/IntegrationTest/Sources/MockTransportServer/Server.swift b/IntegrationTest/Sources/MockTransportServer/Server.swift index 0f3fe556b..4c8494a4e 100644 --- a/IntegrationTest/Sources/MockTransportServer/Server.swift +++ b/IntegrationTest/Sources/MockTransportServer/Server.swift @@ -24,9 +24,9 @@ actor SimpleAPIImpl: APIProtocol { } class MockServerTransport: ServerTransport { - typealias Handler = @Sendable ( - HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata - ) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) + typealias Handler = + @Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata) async throws + -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) func register(_ handler: @escaping Handler, method: HTTPTypes.HTTPRequest.Method, path: String) throws { // noop. diff --git a/README.md b/README.md index 154187db4..15aadfb87 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,15 @@ The Swift OpenAPI Generator project is split across multiple repositories to ena | [apple/swift-openapi-runtime][repo-runtime] | Runtime library used by the generated code | | [apple/swift-openapi-urlsession][repo-urlsession] | `ClientTransport` using [URLSession][urlsession] | | [swift-server/swift-openapi-async-http-client][repo-ahc] | `ClientTransport` using [AsyncHTTPClient][ahc] | -| [swift-server/swift-openapi-vapor][repo-vapor] | `ServerTransport` using [Vapor][vapor] | -| [swift-server/swift-openapi-hummingbird][repo-hummingbird] | `ServerTransport` using [Hummingbird][hummingbird] | +| [vapor/swift-openapi-vapor][repo-vapor] | `ServerTransport` using [Vapor][vapor] | +| [hummingbird-project/swift-openapi-hummingbird][repo-hummingbird] | `ServerTransport` using [Hummingbird][hummingbird] | | [swift-server/swift-openapi-lambda][repo-lambda] | `ServerTransport` using [AWS Lambda][lambda] | ## Requirements and supported features -| Generator versions | Supported OpenAPI versions | Minimum Swift version | -| ------------------ | -------------------------- | --------------------- | -| `1.0.0` ... `main` | 3.0, 3.1 | 5.9 | +| Generator versions | Supported OpenAPI versions | +| ------------------ | -------------------------- | +| `1.0.0` ... `main` | 3.0, 3.1 | See also [Supported OpenAPI features][supported-openapi-features]. @@ -109,9 +109,6 @@ platforms, listed below. | Generator plugin and CLI | ✅ 10.15+ | ✅ | ✖️ | ✖️ | ✖️ | ✖️ | | Generated code and runtime library | ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ | -> [!NOTE] -> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and then importing it into your main module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). - ## Documentation and example projects To get started, check out the [documentation][docs-generator], which contains @@ -134,9 +131,9 @@ Generator](https://developer.apple.com/wwdc23/10171) from WWDC23. [urlsession]: https://developer.apple.com/documentation/foundation/urlsession [repo-ahc]: https://github.com/swift-server/swift-openapi-async-http-client [ahc]: https://github.com/swift-server/async-http-client -[repo-vapor]: https://github.com/swift-server/swift-openapi-vapor +[repo-vapor]: https://github.com/vapor/swift-openapi-vapor [vapor]: https://github.com/vapor/vapor -[repo-hummingbird]: https://github.com/swift-server/swift-openapi-hummingbird +[repo-hummingbird]: https://github.com/hummingbird-project/swift-openapi-hummingbird [hummingbird]: https://github.com/hummingbird-project/hummingbird [repo-lambda]: https://github.com/swift-server/swift-openapi-lambda [lambda]: https://docs.aws.amazon.com/lambda/latest/dg/welcome.html diff --git a/Sources/PetstoreConsumerTestCore/TestClientTransport.swift b/Sources/PetstoreConsumerTestCore/TestClientTransport.swift index e982569cc..111a400a8 100644 --- a/Sources/PetstoreConsumerTestCore/TestClientTransport.swift +++ b/Sources/PetstoreConsumerTestCore/TestClientTransport.swift @@ -33,9 +33,8 @@ import HTTPTypes public struct TestClientTransport: ClientTransport { /// A typealias representing a call handler closure for processing client requests. - public typealias CallHandler = @Sendable (HTTPRequest, HTTPBody?, URL, String) async throws -> ( - HTTPResponse, HTTPBody? - ) + public typealias CallHandler = + @Sendable (HTTPRequest, HTTPBody?, URL, String) async throws -> (HTTPResponse, HTTPBody?) /// The call handler responsible for processing client requests. public let callHandler: CallHandler diff --git a/Sources/PetstoreConsumerTestCore/TestServerTransport.swift b/Sources/PetstoreConsumerTestCore/TestServerTransport.swift index 7c7aee721..c4b3d68f1 100644 --- a/Sources/PetstoreConsumerTestCore/TestServerTransport.swift +++ b/Sources/PetstoreConsumerTestCore/TestServerTransport.swift @@ -50,9 +50,8 @@ public final class TestServerTransport: ServerTransport { } /// A typealias representing a handler closure for processing server requests. - public typealias Handler = @Sendable (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> ( - HTTPResponse, HTTPBody? - ) + public typealias Handler = + @Sendable (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> (HTTPResponse, HTTPBody?) /// Represents an operation with its inputs and associated handler. public struct Operation { @@ -86,9 +85,10 @@ public final class TestServerTransport: ServerTransport { /// - path: The path components of the operation. /// - Throws: An error if there's an issue registering the operation. public func register( - _ handler: @Sendable @escaping (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> ( - HTTPResponse, HTTPBody? - ), + _ handler: + @Sendable @escaping (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> ( + HTTPResponse, HTTPBody? + ), method: HTTPRequest.Method, path: String ) throws { registered.append(Operation(inputs: .init(method: method, path: path), closure: handler)) } diff --git a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md index 840f808ec..8a9386f97 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md +++ b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md @@ -84,8 +84,8 @@ The Swift OpenAPI Generator project is split across multiple repositories to ena | [apple/swift-openapi-runtime][repo-runtime] | Runtime library used by the generated code | | [apple/swift-openapi-urlsession][repo-urlsession] | `ClientTransport` using [URLSession][urlsession] | | [swift-server/swift-openapi-async-http-client][repo-ahc] | `ClientTransport` using [AsyncHTTPClient][ahc] | -| [swift-server/swift-openapi-vapor][repo-vapor] | `ServerTransport` using [Vapor][vapor] | -| [swift-server/swift-openapi-hummingbird][repo-hummingbird] | `ServerTransport` using [Hummingbird][hummingbird] | +| [vapor/swift-openapi-vapor][repo-vapor] | `ServerTransport` using [Vapor][vapor] | +| [hummingbird-project/swift-openapi-hummingbird][repo-hummingbird] | `ServerTransport` using [Hummingbird][hummingbird] | | [swift-server/swift-openapi-lambda][repo-lambda] | `ServerTransport` using [AWS Lambda][lambda] | ### Requirements and supported features @@ -197,9 +197,9 @@ components: [urlsession]: https://developer.apple.com/documentation/foundation/urlsession [repo-ahc]: https://github.com/swift-server/swift-openapi-async-http-client [ahc]: https://github.com/swift-server/async-http-client -[repo-vapor]: https://github.com/swift-server/swift-openapi-vapor +[repo-vapor]: https://github.com/vapor/swift-openapi-vapor [vapor]: https://github.com/vapor/vapor -[repo-hummingbird]: https://github.com/swift-server/swift-openapi-hummingbird +[repo-hummingbird]: https://github.com/hummingbird-project/swift-openapi-hummingbird [hummingbird]: https://github.com/hummingbird-project/hummingbird [repo-lambda]: https://github.com/swift-server/swift-openapi-lambda [lambda]: https://docs.aws.amazon.com/lambda/latest/dg/welcome.html 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 ba749d6ae..c9d36bc75 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 @@ -9,7 +9,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ 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 6d0921691..b4ef1f0d3 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 @@ -9,7 +9,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ 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 0f7f29d17..a8559045d 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 @@ -9,7 +9,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ 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 0f7f29d17..a8559045d 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 @@ -9,7 +9,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"), .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"), - .package(url: "https://github.com/swift-server/swift-openapi-vapor", from: "1.0.0"), + .package(url: "https://github.com/vapor/swift-openapi-vapor", from: "1.0.0"), .package(url: "https://github.com/vapor/vapor", from: "4.89.0"), ], targets: [ diff --git a/Tests/PetstoreConsumerTests/TestClient.swift b/Tests/PetstoreConsumerTests/TestClient.swift index 140d108d2..399c11f87 100644 --- a/Tests/PetstoreConsumerTests/TestClient.swift +++ b/Tests/PetstoreConsumerTests/TestClient.swift @@ -29,8 +29,8 @@ struct TestClient: APIProtocol { return try await block(input) } - typealias CreatePetWithFormSignature = @Sendable (Operations.CreatePetWithForm.Input) async throws -> - Operations.CreatePetWithForm.Output + typealias CreatePetWithFormSignature = + @Sendable (Operations.CreatePetWithForm.Input) async throws -> Operations.CreatePetWithForm.Output var createPetWithFormBlock: CreatePetWithFormSignature? func createPetWithForm(_ input: Operations.CreatePetWithForm.Input) async throws -> Operations.CreatePetWithForm.Output @@ -67,8 +67,8 @@ struct TestClient: APIProtocol { return try await block(input) } - typealias UploadAvatarForPetSignature = @Sendable (Operations.UploadAvatarForPet.Input) async throws -> - Operations.UploadAvatarForPet.Output + typealias UploadAvatarForPetSignature = + @Sendable (Operations.UploadAvatarForPet.Input) async throws -> Operations.UploadAvatarForPet.Output var uploadAvatarForPetBlock: UploadAvatarForPetSignature? func uploadAvatarForPet(_ input: Operations.UploadAvatarForPet.Input) async throws -> Operations.UploadAvatarForPet.Output @@ -76,8 +76,8 @@ struct TestClient: APIProtocol { guard let block = uploadAvatarForPetBlock else { throw UnspecifiedBlockError() } return try await block(input) } - typealias MultipartDownloadTypedSignature = @Sendable (Operations.MultipartDownloadTyped.Input) async throws -> - Operations.MultipartDownloadTyped.Output + typealias MultipartDownloadTypedSignature = + @Sendable (Operations.MultipartDownloadTyped.Input) async throws -> Operations.MultipartDownloadTyped.Output var multipartDownloadTypedBlock: MultipartDownloadTypedSignature? func multipartDownloadTyped(_ input: Operations.MultipartDownloadTyped.Input) async throws -> Operations.MultipartDownloadTyped.Output @@ -85,8 +85,8 @@ struct TestClient: APIProtocol { guard let block = multipartDownloadTypedBlock else { throw UnspecifiedBlockError() } return try await block(input) } - typealias MultipartUploadTypedSignature = @Sendable (Operations.MultipartUploadTyped.Input) async throws -> - Operations.MultipartUploadTyped.Output + typealias MultipartUploadTypedSignature = + @Sendable (Operations.MultipartUploadTyped.Input) async throws -> Operations.MultipartUploadTyped.Output var multipartUploadTypedBlock: MultipartUploadTypedSignature? func multipartUploadTyped(_ input: Operations.MultipartUploadTyped.Input) async throws -> Operations.MultipartUploadTyped.Output