From f86099878f1f27e83f28eec330e92f071792d81d Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 10:02:03 +0000 Subject: [PATCH 1/8] [swift6] fix vapor build --- .../swift6/vaporLibrary/Package.resolved | 187 +++++++++++++----- .../swift6/vaporLibrary/Package.swift | 4 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 8 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 112 +++++------ .../APIs/FakeClassnameTags123API.swift | 8 +- .../Sources/PetstoreClient/APIs/PetAPI.swift | 72 +++---- .../PetstoreClient/APIs/StoreAPI.swift | 30 +-- .../Sources/PetstoreClient/APIs/UserAPI.swift | 62 +++--- .../PetstoreClient/Infrastructure/APIs.swift | 16 +- .../Infrastructure/Extensions.swift | 27 ++- .../Models/AdditionalPropertiesAnyType.swift | 2 +- .../Models/AdditionalPropertiesArray.swift | 2 +- .../Models/AdditionalPropertiesBoolean.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Models/AdditionalPropertiesInteger.swift | 2 +- .../Models/AdditionalPropertiesNumber.swift | 2 +- .../Models/AdditionalPropertiesObject.swift | 2 +- .../Models/AdditionalPropertiesString.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../PetstoreClient/Models/BigCat.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 2 +- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 2 +- .../Models/OuterComposite.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 2 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../PetstoreClient/Models/XmlItem.swift | 2 +- 54 files changed, 363 insertions(+), 251 deletions(-) diff --git a/samples/client/petstore/swift6/vaporLibrary/Package.resolved b/samples/client/petstore/swift6/vaporLibrary/Package.resolved index 43abc9ffe932..98da6fb9097e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Package.resolved +++ b/samples/client/petstore/swift6/vaporLibrary/Package.resolved @@ -1,22 +1,13 @@ { - "originHash" : "304d1886957f380ef5bd7f0063626a4f4aba90401e7b7bdb7cc76683c6164046", + "originHash" : "c50d0dfe7c1a62afbc27f4524644bf3c0d5fabf878c0b98e4d5036ac1163b38d", "pins" : [ - { - "identity" : "anycodable", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Flight-School/AnyCodable", - "state" : { - "revision" : "862808b2070cd908cb04f9aafe7de83d35f81b05", - "version" : "0.6.7" - } - }, { "identity" : "async-http-client", "kind" : "remoteSourceControl", "location" : "https://github.com/swift-server/async-http-client.git", "state" : { - "revision" : "8e4d51908dd49272667126403bf977c5c503f78f", - "version" : "1.5.0" + "revision" : "4b99975677236d13f0754339864e5360142ff5a1", + "version" : "1.30.3" } }, { @@ -24,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/async-kit.git", "state" : { - "revision" : "c1de408100a2f2e4ab2ea06512e8635bc1a59144", - "version" : "1.3.1" + "revision" : "6f3615ccf2ac3c2ae0c8087d527546e9544a43dd", + "version" : "1.21.0" } }, { @@ -33,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/console-kit.git", "state" : { - "revision" : "cfe8bcd58f74ffecb4f536d8237de146b634ecd3", - "version" : "4.2.6" + "revision" : "742f624a998cba2a9e653d9b1e91ad3f3a5dff6b", + "version" : "4.15.2" } }, { @@ -42,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/multipart-kit.git", "state" : { - "revision" : "c9ea04017b7fb3b1f034ad7a77f8e53d3e080be5", - "version" : "4.2.1" + "revision" : "3498e60218e6003894ff95192d756e238c01f44e", + "version" : "4.7.1" } }, { @@ -51,17 +42,62 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/routing-kit.git", "state" : { - "revision" : "a0801a36a6ad501d5ad6285cbcd4774de6b0a734", - "version" : "4.3.0" + "revision" : "1a10ccea61e4248effd23b6e814999ce7bdf0ee0", + "version" : "4.9.3" + } + }, + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms.git", + "state" : { + "revision" : "87e50f483c54e6efd60e885f7f5aa946cee68023", + "version" : "1.2.1" + } + }, + { + "identity" : "swift-asn1", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-asn1.git", + "state" : { + "revision" : "810496cf121e525d660cd0ea89a758740476b85f", + "version" : "1.5.1" + } + }, + { + "identity" : "swift-async-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-async-algorithms.git", + "state" : { + "revision" : "6c050d5ef8e1aa6342528460db614e9770d7f804", + "version" : "1.1.1" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "b601256eab081c0f92f059e12818ac1d4f178ff7", + "version" : "1.3.0" } }, { - "identity" : "swift-backtrace", + "identity" : "swift-certificates", "kind" : "remoteSourceControl", - "location" : "https://github.com/swift-server/swift-backtrace.git", + "location" : "https://github.com/apple/swift-certificates.git", "state" : { - "revision" : "54a65d6391a1467a896d0d351ff2de6f469ee53c", - "version" : "1.2.3" + "revision" : "7d5f6124c91a2d06fb63a811695a3400d15a100e", + "version" : "1.17.1" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "7b847a3b7008b2dc2f47ca3110d8c782fb2e5c7e", + "version" : "1.3.0" } }, { @@ -69,8 +105,35 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-crypto.git", "state" : { - "revision" : "3bea268b223651c4ab7b7b9ad62ef9b2d4143eb6", - "version" : "1.1.6" + "revision" : "6f70fa9eab24c1fd982af18c281c4525d05e3095", + "version" : "4.2.0" + } + }, + { + "identity" : "swift-distributed-tracing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-distributed-tracing.git", + "state" : { + "revision" : "baa932c1336f7894145cbaafcd34ce2dd0b77c97", + "version" : "1.3.1" + } + }, + { + "identity" : "swift-http-structured-headers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-structured-headers.git", + "state" : { + "revision" : "76d7627bd88b47bf5a0f8497dd244885960dde0b", + "version" : "1.6.0" + } + }, + { + "identity" : "swift-http-types", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-types.git", + "state" : { + "revision" : "45eb0224913ea070ec4fba17291b9e7ecf4749ca", + "version" : "1.5.1" } }, { @@ -78,8 +141,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "5d66f7ba25daf4f94100e7022febf3c75e37a6c7", - "version" : "1.4.2" + "revision" : "2778fd4e5a12a8aaa30a3ee8285f4ce54c5f3181", + "version" : "1.9.1" } }, { @@ -87,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-metrics.git", "state" : { - "revision" : "e382458581b05839a571c578e90060fff499f101", - "version" : "2.1.1" + "revision" : "0743a9364382629da3bf5677b46a2c4b1ce5d2a6", + "version" : "2.7.1" } }, { @@ -96,8 +159,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "d79e33308b0ac83326b0ead0ea6446e604b8162d", - "version" : "2.30.0" + "revision" : "233f61bc2cfbb22d0edeb2594da27a20d2ce514e", + "version" : "2.93.0" } }, { @@ -105,8 +168,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "f72c4688f89c28502105509186eadc49a49cb922", - "version" : "1.10.0" + "revision" : "cc599775aa85d04340f09b47e5432564f9889ae7", + "version" : "1.32.0" } }, { @@ -114,8 +177,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "13b6a7a83864005334818d7ea2a3053869a96c04", - "version" : "1.18.0" + "revision" : "c2ba4cfbb83f307c66f5a6df6bb43e3c88dfbf80", + "version" : "1.39.0" } }, { @@ -123,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "9db7cee4b62c39160a6bd513a47a1ecdcceac18a", - "version" : "2.14.0" + "revision" : "173cc69a058623525a58ae6710e2f5727c663793", + "version" : "2.36.0" } }, { @@ -132,8 +195,44 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "39587bceccda72780e2a8a8c5e857e42a9df2fa8", - "version" : "1.11.0" + "revision" : "60c3e187154421171721c1a38e800b390680fb5d", + "version" : "1.26.0" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics.git", + "state" : { + "revision" : "0c0290ff6b24942dadb83a929ffaaa1481df04a2", + "version" : "1.1.1" + } + }, + { + "identity" : "swift-service-context", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-service-context.git", + "state" : { + "revision" : "1983448fefc717a2bc2ebde5490fe99873c5b8a6", + "version" : "1.2.1" + } + }, + { + "identity" : "swift-service-lifecycle", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/swift-service-lifecycle.git", + "state" : { + "revision" : "1de37290c0ab3c5a96028e0f02911b672fd42348", + "version" : "2.9.1" + } + }, + { + "identity" : "swift-system", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-system.git", + "state" : { + "revision" : "7c6ad0fc39d0763e0b699210e4124afd5041c5df", + "version" : "1.6.4" } }, { @@ -141,8 +240,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/vapor", "state" : { - "revision" : "086d0b80f2c3623ffd6b5e32b964ad00b67c2e90", - "version" : "4.47.1" + "revision" : "6f3db7122ccffb28e11e121c3797a176fcb88796", + "version" : "4.121.1" } }, { @@ -150,8 +249,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/websocket-kit.git", "state" : { - "revision" : "a2d26b3de8b3be292f3208d1c74024f76ac503da", - "version" : "2.1.3" + "revision" : "8666c92dbbb3c8eefc8008c9c8dcf50bfd302167", + "version" : "2.16.1" } } ], diff --git a/samples/client/petstore/swift6/vaporLibrary/Package.swift b/samples/client/petstore/swift6/vaporLibrary/Package.swift index 5f2d61faba90..d1fa19e8dd3e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Package.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Package.swift @@ -16,14 +16,14 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/vapor/vapor", from: "4.0.0") + .package(url: "https://github.com/vapor/vapor", from: "4.99.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "PetstoreClient", - dependencies: ["Vapor", ], + dependencies: [.product(name: "Vapor", package: "vapor")], path: "Sources/PetstoreClient" ), ], diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 490594e67bbe..611eeb97e786 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -18,7 +18,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `ClientResponse` */ - open class func call123testSpecialTagsRaw(uuidTest: UUID, body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func call123testSpecialTagsRaw(uuidTest: UUID, body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/another-fake/dummy" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -27,7 +27,7 @@ open class AnotherFakeAPI { } return localVariableApiClient.send(.PATCH, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "uuid_test", value: uuidTest.description) @@ -51,8 +51,8 @@ open class AnotherFakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `Call123testSpecialTags` */ - open class func call123testSpecialTags(uuidTest: UUID, body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return call123testSpecialTagsRaw(uuidTest: uuidTest, body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> Call123testSpecialTags in + open class func call123testSpecialTags(uuidTest: UUID, body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return call123testSpecialTagsRaw(uuidTest: uuidTest, body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> Call123testSpecialTags in switch response.status.code { case 200: return .http200(value: try response.content.decode(Client.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Client.defaultContentType)), raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 480dc61d468e..9bde13e34387 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -17,7 +17,7 @@ open class FakeAPI { - parameter xmlItem: (body) XmlItem Body - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createXmlItemRaw(xmlItem: XmlItem, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createXmlItemRaw(xmlItem: XmlItem, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/create_xml_item" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -26,7 +26,7 @@ open class FakeAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(xmlItem, using: apiConfiguration.contentConfiguration.requireEncoder(for: XmlItem.defaultContentType)) @@ -47,8 +47,8 @@ open class FakeAPI { - parameter xmlItem: (body) XmlItem Body - returns: `EventLoopFuture` of `CreateXmlItem` */ - open class func createXmlItem(xmlItem: XmlItem, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return createXmlItemRaw(xmlItem: xmlItem, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> CreateXmlItem in + open class func createXmlItem(xmlItem: XmlItem, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return createXmlItemRaw(xmlItem: xmlItem, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateXmlItem in switch response.status.code { case 200: return .http200(raw: response) @@ -64,7 +64,7 @@ open class FakeAPI { - parameter body: (body) Input boolean as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterBooleanSerializeRaw(body: Bool? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterBooleanSerializeRaw(body: Bool? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/boolean" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -73,7 +73,7 @@ open class FakeAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) if let localVariableBody = body { @@ -95,8 +95,8 @@ open class FakeAPI { - parameter body: (body) Input boolean as post body (optional) - returns: `EventLoopFuture` of `FakeOuterBooleanSerialize` */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return fakeOuterBooleanSerializeRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterBooleanSerialize in + open class func fakeOuterBooleanSerialize(body: Bool? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return fakeOuterBooleanSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterBooleanSerialize in switch response.status.code { case 200: return .http200(value: try response.content.decode(Bool.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Bool.defaultContentType)), raw: response) @@ -112,7 +112,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterCompositeSerializeRaw(body: OuterComposite? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterCompositeSerializeRaw(body: OuterComposite? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/composite" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -121,7 +121,7 @@ open class FakeAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) if let localVariableBody = body { @@ -143,8 +143,8 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - returns: `EventLoopFuture` of `FakeOuterCompositeSerialize` */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return fakeOuterCompositeSerializeRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterCompositeSerialize in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return fakeOuterCompositeSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterCompositeSerialize in switch response.status.code { case 200: return .http200(value: try response.content.decode(OuterComposite.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: OuterComposite.defaultContentType)), raw: response) @@ -160,7 +160,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterNumberSerializeRaw(body: Double? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterNumberSerializeRaw(body: Double? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/number" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -169,7 +169,7 @@ open class FakeAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) if let localVariableBody = body { @@ -191,8 +191,8 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - returns: `EventLoopFuture` of `FakeOuterNumberSerialize` */ - open class func fakeOuterNumberSerialize(body: Double? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return fakeOuterNumberSerializeRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterNumberSerialize in + open class func fakeOuterNumberSerialize(body: Double? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return fakeOuterNumberSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterNumberSerialize in switch response.status.code { case 200: return .http200(value: try response.content.decode(Double.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Double.defaultContentType)), raw: response) @@ -208,7 +208,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterStringSerializeRaw(body: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterStringSerializeRaw(body: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/string" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -217,7 +217,7 @@ open class FakeAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) if let localVariableBody = body { @@ -239,8 +239,8 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - returns: `EventLoopFuture` of `FakeOuterStringSerialize` */ - open class func fakeOuterStringSerialize(body: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return fakeOuterStringSerializeRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterStringSerialize in + open class func fakeOuterStringSerialize(body: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return fakeOuterStringSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterStringSerialize in switch response.status.code { case 200: return .http200(value: try response.content.decode(String.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: String.defaultContentType)), raw: response) @@ -256,7 +256,7 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testBodyWithFileSchemaRaw(body: FileSchemaTestClass, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testBodyWithFileSchemaRaw(body: FileSchemaTestClass, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/body-with-file-schema" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -265,7 +265,7 @@ open class FakeAPI { } return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: FileSchemaTestClass.defaultContentType)) @@ -285,8 +285,8 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `TestBodyWithFileSchema` */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testBodyWithFileSchemaRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestBodyWithFileSchema in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testBodyWithFileSchemaRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestBodyWithFileSchema in switch response.status.code { case 200: return .http200(raw: response) @@ -302,7 +302,7 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testBodyWithQueryParamsRaw(query: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testBodyWithQueryParamsRaw(query: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/body-with-query-params" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -311,7 +311,7 @@ open class FakeAPI { } return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { var query: String @@ -338,8 +338,8 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `TestBodyWithQueryParams` */ - open class func testBodyWithQueryParams(query: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testBodyWithQueryParamsRaw(query: query, body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestBodyWithQueryParams in + open class func testBodyWithQueryParams(query: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testBodyWithQueryParamsRaw(query: query, body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestBodyWithQueryParams in switch response.status.code { case 200: return .http200(raw: response) @@ -356,7 +356,7 @@ open class FakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testClientModelRaw(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testClientModelRaw(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -365,7 +365,7 @@ open class FakeAPI { } return localVariableApiClient.send(.PATCH, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: Client.defaultContentType)) @@ -386,8 +386,8 @@ open class FakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `TestClientModel` */ - open class func testClientModel(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testClientModelRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestClientModel in + open class func testClientModel(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testClientModelRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestClientModel in switch response.status.code { case 200: return .http200(value: try response.content.decode(Client.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Client.defaultContentType)), raw: response) @@ -420,7 +420,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testEndpointParametersRaw(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testEndpointParametersRaw(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -429,7 +429,7 @@ open class FakeAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct FormParams: Content { @@ -483,8 +483,8 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: `EventLoopFuture` of `TestEndpointParameters` */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testEndpointParametersRaw(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestEndpointParameters in + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testEndpointParametersRaw(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestEndpointParameters in switch response.status.code { case 400: return .http400(raw: response) @@ -577,7 +577,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testEnumParametersRaw(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testEnumParametersRaw(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -586,7 +586,7 @@ open class FakeAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "enum_header_string_array", value: enumHeaderStringArray?.map { $0.rawValue.description }.description ?? "") @@ -636,8 +636,8 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: `EventLoopFuture` of `TestEnumParameters` */ - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testEnumParametersRaw(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestEnumParameters in + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testEnumParametersRaw(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestEnumParameters in switch response.status.code { case 400: return .http400(raw: response) @@ -661,7 +661,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testGroupParametersRaw(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testGroupParametersRaw(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -670,7 +670,7 @@ open class FakeAPI { } return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "required_boolean_group", value: requiredBooleanGroup.description) @@ -712,8 +712,8 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: `EventLoopFuture` of `TestGroupParameters` */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testGroupParametersRaw(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestGroupParameters in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testGroupParametersRaw(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestGroupParameters in switch response.status.code { case 400: return .http400(raw: response) @@ -729,7 +729,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testInlineAdditionalPropertiesRaw(param: [String: String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testInlineAdditionalPropertiesRaw(param: [String: String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/inline-additionalProperties" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -738,7 +738,7 @@ open class FakeAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(param, using: apiConfiguration.contentConfiguration.requireEncoder(for: [String: String].defaultContentType)) @@ -758,8 +758,8 @@ open class FakeAPI { - parameter param: (body) request body - returns: `EventLoopFuture` of `TestInlineAdditionalProperties` */ - open class func testInlineAdditionalProperties(param: [String: String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testInlineAdditionalPropertiesRaw(param: param, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestInlineAdditionalProperties in + open class func testInlineAdditionalProperties(param: [String: String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testInlineAdditionalPropertiesRaw(param: param, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestInlineAdditionalProperties in switch response.status.code { case 200: return .http200(raw: response) @@ -776,7 +776,7 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testJsonFormDataRaw(param: String, param2: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testJsonFormDataRaw(param: String, param2: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -785,7 +785,7 @@ open class FakeAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct FormParams: Content { @@ -810,8 +810,8 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: `EventLoopFuture` of `TestJsonFormData` */ - open class func testJsonFormData(param: String, param2: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testJsonFormDataRaw(param: param, param2: param2, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestJsonFormData in + open class func testJsonFormData(param: String, param2: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testJsonFormDataRaw(param: param, param2: param2, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestJsonFormData in switch response.status.code { case 200: return .http200(raw: response) @@ -831,7 +831,7 @@ open class FakeAPI { - parameter context: (query) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testQueryParameterCollectionFormatRaw(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testQueryParameterCollectionFormatRaw(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/test-query-parameters" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -840,7 +840,7 @@ open class FakeAPI { } return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { var pipe: [String] @@ -878,8 +878,8 @@ open class FakeAPI { - parameter context: (query) - returns: `EventLoopFuture` of `TestQueryParameterCollectionFormat` */ - open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testQueryParameterCollectionFormatRaw(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestQueryParameterCollectionFormat in + open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testQueryParameterCollectionFormatRaw(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestQueryParameterCollectionFormat in switch response.status.code { case 200: return .http200(raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 793f6a370ed2..3a8b83b197e1 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testClassnameRaw(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testClassnameRaw(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake_classname_test" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -29,7 +29,7 @@ open class FakeClassnameTags123API { } return localVariableApiClient.send(.PATCH, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: Client.defaultContentType)) @@ -53,8 +53,8 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - returns: `EventLoopFuture` of `TestClassname` */ - open class func testClassname(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return testClassnameRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> TestClassname in + open class func testClassname(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return testClassnameRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestClassname in switch response.status.code { case 200: return .http200(value: try response.content.decode(Client.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Client.defaultContentType)), raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index e3e6be3bf6d9..6ba862f307af 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -19,7 +19,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `ClientResponse` */ - open class func addPetRaw(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func addPetRaw(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -28,7 +28,7 @@ open class PetAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: Pet.defaultContentType)) @@ -52,8 +52,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `AddPet` */ - open class func addPet(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return addPetRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> AddPet in + open class func addPet(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return addPetRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> AddPet in switch response.status.code { case 200: return .http200(raw: response) @@ -75,7 +75,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func deletePetRaw(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deletePetRaw(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -87,7 +87,7 @@ open class PetAPI { } return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "api_key", value: apiKey?.description ?? "") @@ -113,8 +113,8 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: `EventLoopFuture` of `DeletePet` */ - open class func deletePet(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return deletePetRaw(petId: petId, apiKey: apiKey, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> DeletePet in + open class func deletePet(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return deletePetRaw(petId: petId, apiKey: apiKey, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> DeletePet in switch response.status.code { case 200: return .http200(raw: response) @@ -145,7 +145,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: `EventLoopFuture` of `ClientResponse` */ - open class func findPetsByStatusRaw(status: [Status_findPetsByStatus], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func findPetsByStatusRaw(status: [Status_findPetsByStatus], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet/findByStatus" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -154,7 +154,7 @@ open class PetAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { var status: [Status_findPetsByStatus] @@ -185,8 +185,8 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: `EventLoopFuture` of `FindPetsByStatus` */ - open class func findPetsByStatus(status: [Status_findPetsByStatus], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return findPetsByStatusRaw(status: status, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> FindPetsByStatus in + open class func findPetsByStatus(status: [Status_findPetsByStatus], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return findPetsByStatusRaw(status: status, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FindPetsByStatus in switch response.status.code { case 200: return .http200(value: try response.content.decode([Pet].self, using: apiConfiguration.contentConfiguration.requireDecoder(for: [Pet].defaultContentType)), raw: response) @@ -209,7 +209,7 @@ open class PetAPI { - returns: `EventLoopFuture` of `ClientResponse` */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTagsRaw(tags: Set, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func findPetsByTagsRaw(tags: Set, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet/findByTags" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -218,7 +218,7 @@ open class PetAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { var tags: Set @@ -250,8 +250,8 @@ open class PetAPI { - returns: `EventLoopFuture` of `FindPetsByTags` */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: Set, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return findPetsByTagsRaw(tags: tags, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> FindPetsByTags in + open class func findPetsByTags(tags: Set, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return findPetsByTagsRaw(tags: tags, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FindPetsByTags in switch response.status.code { case 200: return .http200(value: try response.content.decode(Set.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Set.defaultContentType)), raw: response) @@ -273,7 +273,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getPetByIdRaw(petId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getPetByIdRaw(petId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -285,7 +285,7 @@ open class PetAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) @@ -310,8 +310,8 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - returns: `EventLoopFuture` of `GetPetById` */ - open class func getPetById(petId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return getPetByIdRaw(petId: petId, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> GetPetById in + open class func getPetById(petId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return getPetByIdRaw(petId: petId, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetPetById in switch response.status.code { case 200: return .http200(value: try response.content.decode(Pet.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Pet.defaultContentType)), raw: response) @@ -334,7 +334,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `ClientResponse` */ - open class func updatePetRaw(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updatePetRaw(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -343,7 +343,7 @@ open class PetAPI { } return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: Pet.defaultContentType)) @@ -369,8 +369,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `UpdatePet` */ - open class func updatePet(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return updatePetRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> UpdatePet in + open class func updatePet(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return updatePetRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UpdatePet in switch response.status.code { case 200: return .http200(raw: response) @@ -397,7 +397,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func updatePetWithFormRaw(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updatePetWithFormRaw(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -409,7 +409,7 @@ open class PetAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct FormParams: Content { @@ -438,8 +438,8 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: `EventLoopFuture` of `UpdatePetWithForm` */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return updatePetWithFormRaw(petId: petId, name: name, status: status, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> UpdatePetWithForm in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return updatePetWithFormRaw(petId: petId, name: name, status: status, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UpdatePetWithForm in switch response.status.code { case 405: return .http405(raw: response) @@ -460,7 +460,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func uploadFileRaw(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func uploadFileRaw(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}/uploadImage" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -472,7 +472,7 @@ open class PetAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct FormParams: Content { @@ -501,8 +501,8 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: `EventLoopFuture` of `UploadFile` */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return uploadFileRaw(petId: petId, additionalMetadata: additionalMetadata, file: file, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> UploadFile in + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return uploadFileRaw(petId: petId, additionalMetadata: additionalMetadata, file: file, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UploadFile in switch response.status.code { case 200: return .http200(value: try response.content.decode(ApiResponse.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: ApiResponse.defaultContentType)), raw: response) @@ -523,7 +523,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func uploadFileWithRequiredFileRaw(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func uploadFileWithRequiredFileRaw(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -535,7 +535,7 @@ open class PetAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct FormParams: Content { @@ -564,8 +564,8 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: `EventLoopFuture` of `UploadFileWithRequiredFile` */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return uploadFileWithRequiredFileRaw(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> UploadFileWithRequiredFile in + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return uploadFileWithRequiredFileRaw(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UploadFileWithRequiredFile in switch response.status.code { case 200: return .http200(value: try response.content.decode(ApiResponse.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: ApiResponse.defaultContentType)), raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 3b66f4fe05c1..19a164eea9d7 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -17,7 +17,7 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - returns: `EventLoopFuture` of `ClientResponse` */ - open class func deleteOrderRaw(orderId: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deleteOrderRaw(orderId: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/store/order/{order_id}" let orderIdPreEscape = String(describing: orderId) let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -29,7 +29,7 @@ open class StoreAPI { } return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) @@ -50,8 +50,8 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - returns: `EventLoopFuture` of `DeleteOrder` */ - open class func deleteOrder(orderId: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return deleteOrderRaw(orderId: orderId, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> DeleteOrder in + open class func deleteOrder(orderId: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return deleteOrderRaw(orderId: orderId, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> DeleteOrder in switch response.status.code { case 400: return .http400(raw: response) @@ -72,7 +72,7 @@ open class StoreAPI { - name: api_key - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getInventoryRaw(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getInventoryRaw(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/store/inventory" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -81,7 +81,7 @@ open class StoreAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) @@ -103,7 +103,7 @@ open class StoreAPI { - name: api_key - returns: `EventLoopFuture` of `GetInventory` */ - open class func getInventory(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getInventory(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return getInventoryRaw(headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> GetInventory in switch response.status.code { case 200: @@ -121,7 +121,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getOrderByIdRaw(orderId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getOrderByIdRaw(orderId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/store/order/{order_id}" let orderIdPreEscape = String(describing: orderId) let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -133,7 +133,7 @@ open class StoreAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) @@ -155,8 +155,8 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - returns: `EventLoopFuture` of `GetOrderById` */ - open class func getOrderById(orderId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return getOrderByIdRaw(orderId: orderId, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> GetOrderById in + open class func getOrderById(orderId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return getOrderByIdRaw(orderId: orderId, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetOrderById in switch response.status.code { case 200: return .http200(value: try response.content.decode(Order.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Order.defaultContentType)), raw: response) @@ -176,7 +176,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - returns: `EventLoopFuture` of `ClientResponse` */ - open class func placeOrderRaw(body: Order, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func placeOrderRaw(body: Order, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/store/order" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -185,7 +185,7 @@ open class StoreAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: Order.defaultContentType)) @@ -206,8 +206,8 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - returns: `EventLoopFuture` of `PlaceOrder` */ - open class func placeOrder(body: Order, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return placeOrderRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> PlaceOrder in + open class func placeOrder(body: Order, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return placeOrderRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> PlaceOrder in switch response.status.code { case 200: return .http200(value: try response.content.decode(Order.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: Order.defaultContentType)), raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 6038bfc99fcd..3883e1bd4c12 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -17,7 +17,7 @@ open class UserAPI { - parameter body: (body) Created user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createUserRaw(body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUserRaw(body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -26,7 +26,7 @@ open class UserAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: User.defaultContentType)) @@ -46,8 +46,8 @@ open class UserAPI { - parameter body: (body) Created user object - returns: `EventLoopFuture` of `CreateUser` */ - open class func createUser(body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return createUserRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> CreateUser in + open class func createUser(body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return createUserRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateUser in switch response.status.code { default: return .http0(raw: response) @@ -61,7 +61,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createUsersWithArrayInputRaw(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUsersWithArrayInputRaw(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/createWithArray" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -70,7 +70,7 @@ open class UserAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: [User].defaultContentType)) @@ -89,8 +89,8 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `CreateUsersWithArrayInput` */ - open class func createUsersWithArrayInput(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return createUsersWithArrayInputRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> CreateUsersWithArrayInput in + open class func createUsersWithArrayInput(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return createUsersWithArrayInputRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateUsersWithArrayInput in switch response.status.code { default: return .http0(raw: response) @@ -104,7 +104,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createUsersWithListInputRaw(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUsersWithListInputRaw(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/createWithList" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -113,7 +113,7 @@ open class UserAPI { } return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: [User].defaultContentType)) @@ -132,8 +132,8 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `CreateUsersWithListInput` */ - open class func createUsersWithListInput(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return createUsersWithListInputRaw(body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> CreateUsersWithListInput in + open class func createUsersWithListInput(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return createUsersWithListInputRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateUsersWithListInput in switch response.status.code { default: return .http0(raw: response) @@ -148,7 +148,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - returns: `EventLoopFuture` of `ClientResponse` */ - open class func deleteUserRaw(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deleteUserRaw(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/user/{username}" let usernamePreEscape = String(describing: username) let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -160,7 +160,7 @@ open class UserAPI { } return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) @@ -181,8 +181,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - returns: `EventLoopFuture` of `DeleteUser` */ - open class func deleteUser(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return deleteUserRaw(username: username, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> DeleteUser in + open class func deleteUser(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return deleteUserRaw(username: username, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> DeleteUser in switch response.status.code { case 400: return .http400(raw: response) @@ -200,7 +200,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getUserByNameRaw(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getUserByNameRaw(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/user/{username}" let usernamePreEscape = String(describing: username) let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -212,7 +212,7 @@ open class UserAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) @@ -233,8 +233,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: `EventLoopFuture` of `GetUserByName` */ - open class func getUserByName(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return getUserByNameRaw(username: username, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> GetUserByName in + open class func getUserByName(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return getUserByNameRaw(username: username, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetUserByName in switch response.status.code { case 200: return .http200(value: try response.content.decode(User.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: User.defaultContentType)), raw: response) @@ -256,7 +256,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: `EventLoopFuture` of `ClientResponse` */ - open class func loginUserRaw(username: String, password: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func loginUserRaw(username: String, password: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/login" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -265,7 +265,7 @@ open class UserAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { var username: String @@ -296,8 +296,8 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: `EventLoopFuture` of `LoginUser` */ - open class func loginUser(username: String, password: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return loginUserRaw(username: username, password: password, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> LoginUser in + open class func loginUser(username: String, password: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return loginUserRaw(username: username, password: password, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> LoginUser in switch response.status.code { case 200: return .http200(value: try response.content.decode(String.self, using: apiConfiguration.contentConfiguration.requireDecoder(for: String.defaultContentType)), raw: response) @@ -314,7 +314,7 @@ open class UserAPI { GET /user/logout - returns: `EventLoopFuture` of `ClientResponse` */ - open class func logoutUserRaw(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func logoutUserRaw(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/logout" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -323,7 +323,7 @@ open class UserAPI { } return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) @@ -340,7 +340,7 @@ open class UserAPI { GET /user/logout - returns: `EventLoopFuture` of `LogoutUser` */ - open class func logoutUser(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func logoutUser(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return logoutUserRaw(headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> LogoutUser in switch response.status.code { default: @@ -357,7 +357,7 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func updateUserRaw(username: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updateUserRaw(username: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/user/{username}" let usernamePreEscape = String(describing: username) let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -369,7 +369,7 @@ open class UserAPI { } return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) try localVariableRequest.content.encode(body, using: apiConfiguration.contentConfiguration.requireEncoder(for: User.defaultContentType)) @@ -392,8 +392,8 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: `EventLoopFuture` of `UpdateUser` */ - open class func updateUser(username: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return updateUserRaw(username: username, body: body, headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> UpdateUser in + open class func updateUser(username: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + return updateUserRaw(username: username, body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UpdateUser in switch response.status.code { case 400: return .http400(raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index b0d47e8d4738..d6f62668b5d4 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -14,21 +14,21 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public var basePath: String public var customHeaders: HTTPHeaders public var apiClient: Vapor.Client? - public var apiWrapper: (inout Vapor.ClientRequest) throws -> () - public var contentConfiguration + public var apiWrapper: @Sendable (inout Vapor.ClientRequest) throws -> () + public var contentConfiguration: ContentConfiguration public init( basePath: String = "http://petstore.swagger.io:80/v2", customHeaders: HTTPHeaders = [:], apiClient: Vapor.Client? = nil, - apiWrapper: (inout Vapor.ClientRequest) throws -> () = { _ in }, - contentConfiguration = ContentConfiguration.default() + apiWrapper: @escaping @Sendable (inout Vapor.ClientRequest) throws -> () = { _ in }, + contentConfiguration: ContentConfiguration = ContentConfiguration.default() ) { self.basePath = basePath - customHeaders = customHeaders - apiClient = apiClient - apiWrapper = apiWrapper - contentConfiguration = contentConfiguration + self.customHeaders = customHeaders + self.apiClient = apiClient + self.apiWrapper = apiWrapper + self.contentConfiguration = contentConfiguration } public static let shared = PetstoreClientAPIConfiguration() diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift index f8b1d7f1a218..fe7303e5afc6 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift @@ -132,13 +132,11 @@ extension KeyedDecodingContainerProtocol { } -extension UUID: Content { } +extension UUID: @retroactive Content { } -extension URL: Content { } +extension URL: @retroactive Content { } -extension Bool: Content { } - -extension Set: ResponseEncodable where Element: Content { +extension Set: @retroactive ResponseEncodable where Element: Content { public func encodeResponse(for request: Vapor.Request) -> EventLoopFuture { let response = Vapor.Response() do { @@ -150,7 +148,15 @@ extension Set: ResponseEncodable where Element: Content { } } -extension Set: RequestDecodable where Element: Content { +extension Set: @retroactive AsyncResponseEncodable where Element: Content { + public func encodeResponse(for request: Vapor.Request) async throws -> Vapor.Response { + let response = Vapor.Response() + try response.content.encode(Array(self)) + return response + } +} + +extension Set: @retroactive RequestDecodable where Element: Content { public static func decodeRequest(_ request: Vapor.Request) -> EventLoopFuture { do { let content = try request.content.decode([Element].self) @@ -161,6 +167,13 @@ extension Set: RequestDecodable where Element: Content { } } -extension Set: Content where Element: Content { } +extension Set: @retroactive AsyncRequestDecodable where Element: Content { + public static func decodeRequest(_ request: Vapor.Request) async throws -> Self { + let content = try request.content.decode([Element].self) + return Set(content) + } +} + +extension Set: @retroactive Content where Element: Content { } extension JSONValue: Content {} diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift index 8f33cba8744e..f918dfd67533 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesAnyType: Content, Hashable { +public struct AdditionalPropertiesAnyType: Content, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift index cf3d2db319f7..7ea3d7435d84 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesArray: Content, Hashable { +public struct AdditionalPropertiesArray: Content, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift index e2908594503a..af6de06c39e1 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesBoolean: Content, Hashable { +public struct AdditionalPropertiesBoolean: Content, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index dcbede7bc8fb..14b5d84e3451 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesClass: Content, Hashable { +public struct AdditionalPropertiesClass: Content, Hashable { public var mapString: [String: String]? public var mapNumber: [String: Double]? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift index f90c9ffa7a62..8433f84189ee 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesInteger: Content, Hashable { +public struct AdditionalPropertiesInteger: Content, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift index 5c6ae2f4740e..1b1aeebc2dc5 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesNumber: Content, Hashable { +public struct AdditionalPropertiesNumber: Content, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift index 16dbb6aa01d5..530ddbdfe419 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesObject: Content, Hashable { +public struct AdditionalPropertiesObject: Content, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift index 27b7f315f1f4..16e895b993ec 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class AdditionalPropertiesString: Content, Hashable { +public struct AdditionalPropertiesString: Content, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift index e61742f7690f..01333b082c13 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Animal: Content, Hashable { +public struct Animal: Content, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index f9c5939be9b0..170a2c38376b 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class ApiResponse: Content, Hashable { +public struct ApiResponse: Content, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 60ae66f64e35..b47ec386bb22 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class ArrayOfArrayOfNumberOnly: Content, Hashable { +public struct ArrayOfArrayOfNumberOnly: Content, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index f93ca8bdeaf2..dfca80c3bfee 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class ArrayOfNumberOnly: Content, Hashable { +public struct ArrayOfNumberOnly: Content, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index e0a779991ca7..87085de54063 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class ArrayTest: Content, Hashable { +public struct ArrayTest: Content, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift index 38b07f79246b..c4e557599737 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class BigCat: Content, Hashable { +public struct BigCat: Content, Hashable { public enum Kind: String, Sendable, Content, Hashable, CaseIterable { case lions = "lions" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift index f0cc18c0f8c5..0676febcb9b9 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Capitalization: Content, Hashable { +public struct Capitalization: Content, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift index 37e70c0036ff..007cb3b14974 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Cat: Content, Hashable { +public struct Cat: Content, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift index e2115d08fbe0..73e914dfcf0b 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Category: Content, Hashable { +public struct Category: Content, Hashable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift index 000d3658d224..29081aeb2e4d 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing model with \"_class\" property */ -public final class ClassModel: Content, Hashable { +public struct ClassModel: Content, Hashable { public var `class`: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift index 4ba5219ddf21..a2b793774294 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Client: Content, Hashable { +public struct Client: Content, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift index a20eb84fffb7..0d5aacebb27b 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Dog: Content, Hashable { +public struct Dog: Content, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index a563c354db7d..a905130bac9a 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class EnumArrays: Content, Hashable { +public struct EnumArrays: Content, Hashable { public enum JustSymbol: String, Sendable, Content, Hashable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift index 15779b57b9f9..46cae818ed67 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class EnumTest: Content, Hashable { +public struct EnumTest: Content, Hashable { public enum EnumString: String, Sendable, Content, Hashable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift index 3b70313f505a..97885b686d5d 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Must be named `File` for test. */ -public final class File: Content, Hashable { +public struct File: Content, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index bc57101c274b..7bd9ea5350a6 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class FileSchemaTestClass: Content, Hashable { +public struct FileSchemaTestClass: Content, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift index 570ef7166630..4a9e08a1a885 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class FormatTest: Content, Hashable { +public struct FormatTest: Content, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index dfdb09175e4b..981c77dbd430 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class HasOnlyReadOnly: Content, Hashable { +public struct HasOnlyReadOnly: Content, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift index a96ff0eef787..6032980d200e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class List: Content, Hashable { +public struct List: Content, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift index d74262b414d8..bb652c227ea5 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class MapTest: Content, Hashable { +public struct MapTest: Content, Hashable { public enum MapOfEnumString: String, Sendable, Content, Hashable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 61d7e38e0405..d6e53abf02f2 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class MixedPropertiesAndAdditionalPropertiesClass: Content, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Content, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift index 40e36b4ca39c..81d51dff42ad 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing model name starting with number */ -public final class Model200Response: Content, Hashable { +public struct Model200Response: Content, Hashable { public var name: Int? public var `class`: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift index ef9692a6603f..eeb3880c0e86 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing model name same as property name */ -public final class Name: Content, Hashable { +public struct Name: Content, Hashable { public var name: Int public var snakeCase: Int? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index 9c451e9f0182..8812ad4ea798 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class NumberOnly: Content, Hashable { +public struct NumberOnly: Content, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift index c6ebc2461026..204e727f6719 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Order: Content, Hashable { +public struct Order: Content, Hashable { public enum Status: String, Sendable, Content, Hashable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index d7696fe5c9f9..04020a1b0ede 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class OuterComposite: Content, Hashable { +public struct OuterComposite: Content, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift index 04cffcaa7fc0..6e60042ee634 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Pet: Content, Hashable { +public struct Pet: Content, Hashable { public enum Status: String, Sendable, Content, Hashable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index c48fc99cdc81..8ad77d64a5b2 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class ReadOnlyFirst: Content, Hashable { +public struct ReadOnlyFirst: Content, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift index 45415afbd2bf..ba859ef5a43f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing reserved words */ -public final class Return: Content, Hashable { +public struct Return: Content, Hashable { public var `return`: Int? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index 9319338bde68..69c731a660d9 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class SpecialModelName: Content, Hashable { +public struct SpecialModelName: Content, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index e558e254f531..5e261517eb2f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class StringBooleanMap: Content, Hashable { +public struct StringBooleanMap: Content, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift index 530aec30b0b0..268cbb76325a 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class Tag: Content, Hashable { +public struct Tag: Content, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index 766b73224e99..f704f2e1b4f6 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class TypeHolderDefault: Content, Hashable { +public struct TypeHolderDefault: Content, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index 8115aacedbac..785693de4beb 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class TypeHolderExample: Content, Hashable { +public struct TypeHolderExample: Content, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift index 38fbd26b4303..1a0e60f14c21 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class User: Content, Hashable { +public struct User: Content, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift index 6a66d8e7e829..5ae5f6a64aa9 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public final class XmlItem: Content, Hashable { +public struct XmlItem: Content, Hashable { public var attributeString: String? public var attributeNumber: Double? From ae5cfcc7023fc0e2063b93aed5fdf2a29b062f21 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 10:07:25 +0000 Subject: [PATCH 2/8] [swift6] enable all swift 6 ci tests --- samples/client/petstore/swift6/swift6_test_all.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/swift6/swift6_test_all.sh b/samples/client/petstore/swift6/swift6_test_all.sh index 55bde1c8754d..6a2f45b730d9 100755 --- a/samples/client/petstore/swift6/swift6_test_all.sh +++ b/samples/client/petstore/swift6/swift6_test_all.sh @@ -12,20 +12,20 @@ DIRECTORY=`dirname $0` (cd $DIRECTORY/default/ && ./run_spmbuild.sh) (cd $DIRECTORY/objcCompatible/ && ./run_spmbuild.sh) (cd $DIRECTORY/oneOf/ && ./run_spmbuild.sh) -# (cd $DIRECTORY/promisekitLibrary/ && ./run_spmbuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail +(cd $DIRECTORY/promisekitLibrary/ && ./run_spmbuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail (cd $DIRECTORY/resultLibrary/ && ./run_spmbuild.sh) (cd $DIRECTORY/rxswiftLibrary/ && ./run_spmbuild.sh) (cd $DIRECTORY/urlsessionLibrary/ && ./run_spmbuild.sh) (cd $DIRECTORY/validation/ && ./run_spmbuild.sh) -# (cd $DIRECTORY/vaporLibrary/ && ./run_spmbuild.sh) # Commented because it's not working +(cd $DIRECTORY/vaporLibrary/ && ./run_spmbuild.sh) # Commented because it's not working # example project with unit tests (cd $DIRECTORY/alamofireLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/apiNonStaticMethod/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/asyncAwaitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) -# (cd $DIRECTORY/combineLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail +(cd $DIRECTORY/combineLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail (cd $DIRECTORY/combineDeferredLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/default/SwaggerClientTests/ && ./run_xcodebuild.sh) -# (cd $DIRECTORY/promisekitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail +(cd $DIRECTORY/promisekitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail (cd $DIRECTORY/rxswiftLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/urlsessionLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) From e2e53be99aebf25c9b3674701a236e4c31be7f07 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 10:11:50 +0000 Subject: [PATCH 3/8] [swift6] fix vapor build --- .../Models/AdditionalPropertiesAnyType.swift | 8 --- .../Models/AdditionalPropertiesArray.swift | 8 --- .../Models/AdditionalPropertiesBoolean.swift | 8 --- .../Models/AdditionalPropertiesClass.swift | 28 -------- .../Models/AdditionalPropertiesInteger.swift | 8 --- .../Models/AdditionalPropertiesNumber.swift | 8 --- .../Models/AdditionalPropertiesObject.swift | 8 --- .../Models/AdditionalPropertiesString.swift | 8 --- .../PetstoreClient/Models/Animal.swift | 10 --- .../PetstoreClient/Models/ApiResponse.swift | 12 ---- .../Models/ArrayOfArrayOfNumberOnly.swift | 8 --- .../Models/ArrayOfNumberOnly.swift | 8 --- .../PetstoreClient/Models/ArrayTest.swift | 12 ---- .../PetstoreClient/Models/BigCat.swift | 8 --- .../Models/Capitalization.swift | 18 ------ .../Sources/PetstoreClient/Models/Cat.swift | 12 ---- .../PetstoreClient/Models/Category.swift | 10 --- .../PetstoreClient/Models/ClassModel.swift | 8 --- .../PetstoreClient/Models/Client.swift | 8 --- .../Sources/PetstoreClient/Models/Dog.swift | 12 ---- .../PetstoreClient/Models/EnumArrays.swift | 10 --- .../PetstoreClient/Models/EnumTest.swift | 16 ----- .../Sources/PetstoreClient/Models/File.swift | 8 --- .../Models/FileSchemaTestClass.swift | 10 --- .../PetstoreClient/Models/FormatTest.swift | 34 ---------- .../Models/HasOnlyReadOnly.swift | 10 --- .../Sources/PetstoreClient/Models/List.swift | 8 --- .../PetstoreClient/Models/MapTest.swift | 14 ---- ...opertiesAndAdditionalPropertiesClass.swift | 12 ---- .../Models/Model200Response.swift | 10 --- .../Sources/PetstoreClient/Models/Name.swift | 14 ---- .../PetstoreClient/Models/NumberOnly.swift | 8 --- .../Sources/PetstoreClient/Models/Order.swift | 18 ------ .../Models/OuterComposite.swift | 12 ---- .../Sources/PetstoreClient/Models/Pet.swift | 18 ------ .../PetstoreClient/Models/ReadOnlyFirst.swift | 10 --- .../PetstoreClient/Models/Return.swift | 8 --- .../Models/SpecialModelName.swift | 8 --- .../Models/StringBooleanMap.swift | 6 -- .../Sources/PetstoreClient/Models/Tag.swift | 10 --- .../Models/TypeHolderDefault.swift | 16 ----- .../Models/TypeHolderExample.swift | 18 ------ .../Sources/PetstoreClient/Models/User.swift | 22 ------- .../PetstoreClient/Models/XmlItem.swift | 64 ------------------- 44 files changed, 574 deletions(-) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift index f918dfd67533..cf5dc9f24f5f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift @@ -56,14 +56,6 @@ public struct AdditionalPropertiesAnyType: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap(JSONValue.self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: AdditionalPropertiesAnyType, rhs: AdditionalPropertiesAnyType) -> Bool { - lhs.name == rhs.name - && lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift index 7ea3d7435d84..93383da3d22f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift @@ -56,14 +56,6 @@ public struct AdditionalPropertiesArray: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap([JSONValue].self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: AdditionalPropertiesArray, rhs: AdditionalPropertiesArray) -> Bool { - lhs.name == rhs.name - && lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift index af6de06c39e1..c71f77fe456d 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift @@ -56,14 +56,6 @@ public struct AdditionalPropertiesBoolean: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: AdditionalPropertiesBoolean, rhs: AdditionalPropertiesBoolean) -> Bool { - lhs.name == rhs.name - && lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index 14b5d84e3451..fd7d6fdf980f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -67,34 +67,6 @@ public struct AdditionalPropertiesClass: Content, Hashable { try container.encodeIfPresent(anytype3, forKey: .anytype3) } - public static func == (lhs: AdditionalPropertiesClass, rhs: AdditionalPropertiesClass) -> Bool { - lhs.mapString == rhs.mapString && - lhs.mapNumber == rhs.mapNumber && - lhs.mapInteger == rhs.mapInteger && - lhs.mapBoolean == rhs.mapBoolean && - lhs.mapArrayInteger == rhs.mapArrayInteger && - lhs.mapArrayAnytype == rhs.mapArrayAnytype && - lhs.mapMapString == rhs.mapMapString && - lhs.mapMapAnytype == rhs.mapMapAnytype && - lhs.anytype1 == rhs.anytype1 && - lhs.anytype2 == rhs.anytype2 && - lhs.anytype3 == rhs.anytype3 - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(mapString?.hashValue) - hasher.combine(mapNumber?.hashValue) - hasher.combine(mapInteger?.hashValue) - hasher.combine(mapBoolean?.hashValue) - hasher.combine(mapArrayInteger?.hashValue) - hasher.combine(mapArrayAnytype?.hashValue) - hasher.combine(mapMapString?.hashValue) - hasher.combine(mapMapAnytype?.hashValue) - hasher.combine(anytype1?.hashValue) - hasher.combine(anytype2?.hashValue) - hasher.combine(anytype3?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift index 8433f84189ee..a75515abe668 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift @@ -56,14 +56,6 @@ public struct AdditionalPropertiesInteger: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: AdditionalPropertiesInteger, rhs: AdditionalPropertiesInteger) -> Bool { - lhs.name == rhs.name - && lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift index 1b1aeebc2dc5..2d6bc5d93a93 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift @@ -56,14 +56,6 @@ public struct AdditionalPropertiesNumber: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap(Double.self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: AdditionalPropertiesNumber, rhs: AdditionalPropertiesNumber) -> Bool { - lhs.name == rhs.name - && lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift index 530ddbdfe419..7cbb823b7e30 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift @@ -56,14 +56,6 @@ public struct AdditionalPropertiesObject: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap([String: JSONValue].self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: AdditionalPropertiesObject, rhs: AdditionalPropertiesObject) -> Bool { - lhs.name == rhs.name - && lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift index 16e895b993ec..b3355087a155 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift @@ -56,14 +56,6 @@ public struct AdditionalPropertiesString: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: AdditionalPropertiesString, rhs: AdditionalPropertiesString) -> Bool { - lhs.name == rhs.name - && lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift index 01333b082c13..dee1d044e1b6 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -31,16 +31,6 @@ public struct Animal: Content, Hashable { try container.encodeIfPresent(color, forKey: .color) } - public static func == (lhs: Animal, rhs: Animal) -> Bool { - lhs.className == rhs.className && - lhs.color == rhs.color - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(className.hashValue) - hasher.combine(color?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index 170a2c38376b..021884963114 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -35,18 +35,6 @@ public struct ApiResponse: Content, Hashable { try container.encodeIfPresent(message, forKey: .message) } - public static func == (lhs: ApiResponse, rhs: ApiResponse) -> Bool { - lhs.code == rhs.code && - lhs.type == rhs.type && - lhs.message == rhs.message - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(code?.hashValue) - hasher.combine(type?.hashValue) - hasher.combine(message?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index b47ec386bb22..af8f421fd877 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -27,14 +27,6 @@ public struct ArrayOfArrayOfNumberOnly: Content, Hashable { try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - public static func == (lhs: ArrayOfArrayOfNumberOnly, rhs: ArrayOfArrayOfNumberOnly) -> Bool { - lhs.arrayArrayNumber == rhs.arrayArrayNumber - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(arrayArrayNumber?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index dfca80c3bfee..7b556836c235 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -27,14 +27,6 @@ public struct ArrayOfNumberOnly: Content, Hashable { try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - public static func == (lhs: ArrayOfNumberOnly, rhs: ArrayOfNumberOnly) -> Bool { - lhs.arrayNumber == rhs.arrayNumber - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(arrayNumber?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index 87085de54063..16cbdcce654a 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -35,18 +35,6 @@ public struct ArrayTest: Content, Hashable { try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - public static func == (lhs: ArrayTest, rhs: ArrayTest) -> Bool { - lhs.arrayOfString == rhs.arrayOfString && - lhs.arrayArrayOfInteger == rhs.arrayArrayOfInteger && - lhs.arrayArrayOfModel == rhs.arrayArrayOfModel - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(arrayOfString?.hashValue) - hasher.combine(arrayArrayOfInteger?.hashValue) - hasher.combine(arrayArrayOfModel?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift index c4e557599737..c96e15f5ada1 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift @@ -33,14 +33,6 @@ public struct BigCat: Content, Hashable { try container.encodeIfPresent(kind, forKey: .kind) } - public static func == (lhs: BigCat, rhs: BigCat) -> Bool { - lhs.kind == rhs.kind - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(kind?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift index 0676febcb9b9..3de739a319ba 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -48,24 +48,6 @@ public struct Capitalization: Content, Hashable { try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - public static func == (lhs: Capitalization, rhs: Capitalization) -> Bool { - lhs.smallCamel == rhs.smallCamel && - lhs.capitalCamel == rhs.capitalCamel && - lhs.smallSnake == rhs.smallSnake && - lhs.capitalSnake == rhs.capitalSnake && - lhs.sCAETHFlowPoints == rhs.sCAETHFlowPoints && - lhs.ATT_NAME == rhs.ATT_NAME - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(smallCamel?.hashValue) - hasher.combine(capitalCamel?.hashValue) - hasher.combine(smallSnake?.hashValue) - hasher.combine(capitalSnake?.hashValue) - hasher.combine(sCAETHFlowPoints?.hashValue) - hasher.combine(ATT_NAME?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift index 007cb3b14974..0d3b7aea6678 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -35,18 +35,6 @@ public struct Cat: Content, Hashable { try container.encodeIfPresent(declawed, forKey: .declawed) } - public static func == (lhs: Cat, rhs: Cat) -> Bool { - lhs.className == rhs.className && - lhs.color == rhs.color && - lhs.declawed == rhs.declawed - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(className.hashValue) - hasher.combine(color?.hashValue) - hasher.combine(declawed?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift index 73e914dfcf0b..f30debd9a4fc 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift @@ -31,17 +31,7 @@ public struct Category: Content, Hashable { try container.encode(name, forKey: .name) } - public static func == (lhs: Category, rhs: Category) -> Bool { - lhs.id == rhs.id && - lhs.name == rhs.name - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(id?.hashValue) - hasher.combine(name.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift index 29081aeb2e4d..95b2bbb17ee0 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -28,14 +28,6 @@ public struct ClassModel: Content, Hashable { try container.encodeIfPresent(`class`, forKey: .`class`) } - public static func == (lhs: ClassModel, rhs: ClassModel) -> Bool { - lhs.`class` == rhs.`class` - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(`class`?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift index a2b793774294..df1d65d0601c 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift @@ -27,14 +27,6 @@ public struct Client: Content, Hashable { try container.encodeIfPresent(client, forKey: .client) } - public static func == (lhs: Client, rhs: Client) -> Bool { - lhs.client == rhs.client - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(client?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift index 0d5aacebb27b..0036b54d1e48 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -35,18 +35,6 @@ public struct Dog: Content, Hashable { try container.encodeIfPresent(breed, forKey: .breed) } - public static func == (lhs: Dog, rhs: Dog) -> Bool { - lhs.className == rhs.className && - lhs.color == rhs.color && - lhs.breed == rhs.breed - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(className.hashValue) - hasher.combine(color?.hashValue) - hasher.combine(breed?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index a905130bac9a..3a22fe557911 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -39,16 +39,6 @@ public struct EnumArrays: Content, Hashable { try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - public static func == (lhs: EnumArrays, rhs: EnumArrays) -> Bool { - lhs.justSymbol == rhs.justSymbol && - lhs.arrayEnum == rhs.arrayEnum - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(justSymbol?.hashValue) - hasher.combine(arrayEnum?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift index 46cae818ed67..82acb80fcd1d 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -61,22 +61,6 @@ public struct EnumTest: Content, Hashable { try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - public static func == (lhs: EnumTest, rhs: EnumTest) -> Bool { - lhs.enumString == rhs.enumString && - lhs.enumStringRequired == rhs.enumStringRequired && - lhs.enumInteger == rhs.enumInteger && - lhs.enumNumber == rhs.enumNumber && - lhs.outerEnum == rhs.outerEnum - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(enumString?.hashValue) - hasher.combine(enumStringRequired.hashValue) - hasher.combine(enumInteger?.hashValue) - hasher.combine(enumNumber?.hashValue) - hasher.combine(outerEnum?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift index 97885b686d5d..c73b5803bc75 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift @@ -29,14 +29,6 @@ public struct File: Content, Hashable { try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - public static func == (lhs: File, rhs: File) -> Bool { - lhs.sourceURI == rhs.sourceURI - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(sourceURI?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 7bd9ea5350a6..5fad0d68aa2f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -31,16 +31,6 @@ public struct FileSchemaTestClass: Content, Hashable { try container.encodeIfPresent(files, forKey: .files) } - public static func == (lhs: FileSchemaTestClass, rhs: FileSchemaTestClass) -> Bool { - lhs.file == rhs.file && - lhs.files == rhs.files - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(file?.hashValue) - hasher.combine(files?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift index 4a9e08a1a885..820b11863f9b 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -86,40 +86,6 @@ public struct FormatTest: Content, Hashable { try container.encodeIfPresent(bigDecimal, forKey: .bigDecimal) } - public static func == (lhs: FormatTest, rhs: FormatTest) -> Bool { - lhs.integer == rhs.integer && - lhs.int32 == rhs.int32 && - lhs.int64 == rhs.int64 && - lhs.number == rhs.number && - lhs.float == rhs.float && - lhs.double == rhs.double && - lhs.string == rhs.string && - lhs.byte == rhs.byte && - lhs.binary == rhs.binary && - lhs.date == rhs.date && - lhs.dateTime == rhs.dateTime && - lhs.uuid == rhs.uuid && - lhs.password == rhs.password && - lhs.bigDecimal == rhs.bigDecimal - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(integer?.hashValue) - hasher.combine(int32?.hashValue) - hasher.combine(int64?.hashValue) - hasher.combine(number.hashValue) - hasher.combine(float?.hashValue) - hasher.combine(double?.hashValue) - hasher.combine(string?.hashValue) - hasher.combine(byte.hashValue) - hasher.combine(binary?.hashValue) - hasher.combine(date.hashValue) - hasher.combine(dateTime?.hashValue) - hasher.combine(uuid?.hashValue) - hasher.combine(password.hashValue) - hasher.combine(bigDecimal?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index 981c77dbd430..fc9051d02de1 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -31,16 +31,6 @@ public struct HasOnlyReadOnly: Content, Hashable { try container.encodeIfPresent(foo, forKey: .foo) } - public static func == (lhs: HasOnlyReadOnly, rhs: HasOnlyReadOnly) -> Bool { - lhs.bar == rhs.bar && - lhs.foo == rhs.foo - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(bar?.hashValue) - hasher.combine(foo?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift index 6032980d200e..8f94d92a66a2 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift @@ -27,14 +27,6 @@ public struct List: Content, Hashable { try container.encodeIfPresent(_123list, forKey: ._123list) } - public static func == (lhs: List, rhs: List) -> Bool { - lhs._123list == rhs._123list - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(_123list?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift index bb652c227ea5..6db5ee5f126c 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -43,20 +43,6 @@ public struct MapTest: Content, Hashable { try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - public static func == (lhs: MapTest, rhs: MapTest) -> Bool { - lhs.mapMapOfString == rhs.mapMapOfString && - lhs.mapOfEnumString == rhs.mapOfEnumString && - lhs.directMap == rhs.directMap && - lhs.indirectMap == rhs.indirectMap - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(mapMapOfString?.hashValue) - hasher.combine(mapOfEnumString?.hashValue) - hasher.combine(directMap?.hashValue) - hasher.combine(indirectMap?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index d6e53abf02f2..be0ef0b02d56 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -35,18 +35,6 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Content, Hashable { try container.encodeIfPresent(map, forKey: .map) } - public static func == (lhs: MixedPropertiesAndAdditionalPropertiesClass, rhs: MixedPropertiesAndAdditionalPropertiesClass) -> Bool { - lhs.uuid == rhs.uuid && - lhs.dateTime == rhs.dateTime && - lhs.map == rhs.map - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(uuid?.hashValue) - hasher.combine(dateTime?.hashValue) - hasher.combine(map?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift index 81d51dff42ad..e6e44dd259f7 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -32,16 +32,6 @@ public struct Model200Response: Content, Hashable { try container.encodeIfPresent(`class`, forKey: .`class`) } - public static func == (lhs: Model200Response, rhs: Model200Response) -> Bool { - lhs.name == rhs.name && - lhs.`class` == rhs.`class` - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name?.hashValue) - hasher.combine(`class`?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift index eeb3880c0e86..3fec443ffa97 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift @@ -40,20 +40,6 @@ public struct Name: Content, Hashable { try container.encodeIfPresent(_123number, forKey: ._123number) } - public static func == (lhs: Name, rhs: Name) -> Bool { - lhs.name == rhs.name && - lhs.snakeCase == rhs.snakeCase && - lhs.property == rhs.property && - lhs._123number == rhs._123number - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(name.hashValue) - hasher.combine(snakeCase?.hashValue) - hasher.combine(property?.hashValue) - hasher.combine(_123number?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index 8812ad4ea798..ab0af2211138 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -27,14 +27,6 @@ public struct NumberOnly: Content, Hashable { try container.encodeIfPresent(justNumber, forKey: .justNumber) } - public static func == (lhs: NumberOnly, rhs: NumberOnly) -> Bool { - lhs.justNumber == rhs.justNumber - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(justNumber?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift index 204e727f6719..71ad9e544f88 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift @@ -53,25 +53,7 @@ public struct Order: Content, Hashable { try container.encodeIfPresent(complete, forKey: .complete) } - public static func == (lhs: Order, rhs: Order) -> Bool { - lhs.id == rhs.id && - lhs.petId == rhs.petId && - lhs.quantity == rhs.quantity && - lhs.shipDate == rhs.shipDate && - lhs.status == rhs.status && - lhs.complete == rhs.complete - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(id?.hashValue) - hasher.combine(petId?.hashValue) - hasher.combine(quantity?.hashValue) - hasher.combine(shipDate?.hashValue) - hasher.combine(status?.hashValue) - hasher.combine(complete?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index 04020a1b0ede..6ca462cd3690 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -35,18 +35,6 @@ public struct OuterComposite: Content, Hashable { try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - public static func == (lhs: OuterComposite, rhs: OuterComposite) -> Bool { - lhs.myNumber == rhs.myNumber && - lhs.myString == rhs.myString && - lhs.myBoolean == rhs.myBoolean - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(myNumber?.hashValue) - hasher.combine(myString?.hashValue) - hasher.combine(myBoolean?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift index 6e60042ee634..21810f19465a 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -54,25 +54,7 @@ public struct Pet: Content, Hashable { try container.encodeIfPresent(status, forKey: .status) } - public static func == (lhs: Pet, rhs: Pet) -> Bool { - lhs.id == rhs.id && - lhs.category == rhs.category && - lhs.name == rhs.name && - lhs.photoUrls == rhs.photoUrls && - lhs.tags == rhs.tags && - lhs.status == rhs.status - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(id?.hashValue) - hasher.combine(category?.hashValue) - hasher.combine(name.hashValue) - hasher.combine(photoUrls.hashValue) - hasher.combine(tags?.hashValue) - hasher.combine(status?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 8ad77d64a5b2..cb4c6bd34377 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -31,16 +31,6 @@ public struct ReadOnlyFirst: Content, Hashable { try container.encodeIfPresent(baz, forKey: .baz) } - public static func == (lhs: ReadOnlyFirst, rhs: ReadOnlyFirst) -> Bool { - lhs.bar == rhs.bar && - lhs.baz == rhs.baz - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(bar?.hashValue) - hasher.combine(baz?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift index ba859ef5a43f..57f130da226a 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift @@ -28,14 +28,6 @@ public struct Return: Content, Hashable { try container.encodeIfPresent(`return`, forKey: .`return`) } - public static func == (lhs: Return, rhs: Return) -> Bool { - lhs.`return` == rhs.`return` - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(`return`?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index 69c731a660d9..7fbba1d84632 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -27,14 +27,6 @@ public struct SpecialModelName: Content, Hashable { try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - public static func == (lhs: SpecialModelName, rhs: SpecialModelName) -> Bool { - lhs.specialPropertyName == rhs.specialPropertyName - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(specialPropertyName?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index 5e261517eb2f..bf3571b1e46d 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -47,12 +47,6 @@ public struct StringBooleanMap: Content, Hashable { additionalProperties = try additionalPropertiesContainer.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: StringBooleanMap, rhs: StringBooleanMap) -> Bool { - lhs.additionalProperties == rhs.additionalProperties - } - public func hash(into hasher: inout Hasher) { - hasher.combine(additionalProperties.hashValue) - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift index 268cbb76325a..5ef9ce968e15 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -31,17 +31,7 @@ public struct Tag: Content, Hashable { try container.encodeIfPresent(name, forKey: .name) } - public static func == (lhs: Tag, rhs: Tag) -> Bool { - lhs.id == rhs.id && - lhs.name == rhs.name - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(id?.hashValue) - hasher.combine(name?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index f704f2e1b4f6..95ac2e1f11b2 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -43,22 +43,6 @@ public struct TypeHolderDefault: Content, Hashable { try container.encode(arrayItem, forKey: .arrayItem) } - public static func == (lhs: TypeHolderDefault, rhs: TypeHolderDefault) -> Bool { - lhs.stringItem == rhs.stringItem && - lhs.numberItem == rhs.numberItem && - lhs.integerItem == rhs.integerItem && - lhs.boolItem == rhs.boolItem && - lhs.arrayItem == rhs.arrayItem - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(stringItem.hashValue) - hasher.combine(numberItem.hashValue) - hasher.combine(integerItem.hashValue) - hasher.combine(boolItem.hashValue) - hasher.combine(arrayItem.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index 785693de4beb..0725c54ba3a7 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -47,24 +47,6 @@ public struct TypeHolderExample: Content, Hashable { try container.encode(arrayItem, forKey: .arrayItem) } - public static func == (lhs: TypeHolderExample, rhs: TypeHolderExample) -> Bool { - lhs.stringItem == rhs.stringItem && - lhs.numberItem == rhs.numberItem && - lhs.floatItem == rhs.floatItem && - lhs.integerItem == rhs.integerItem && - lhs.boolItem == rhs.boolItem && - lhs.arrayItem == rhs.arrayItem - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(stringItem.hashValue) - hasher.combine(numberItem.hashValue) - hasher.combine(floatItem.hashValue) - hasher.combine(integerItem.hashValue) - hasher.combine(boolItem.hashValue) - hasher.combine(arrayItem.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift index 1a0e60f14c21..548f55330cd1 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift @@ -56,29 +56,7 @@ public struct User: Content, Hashable { try container.encodeIfPresent(userStatus, forKey: .userStatus) } - public static func == (lhs: User, rhs: User) -> Bool { - lhs.id == rhs.id && - lhs.username == rhs.username && - lhs.firstName == rhs.firstName && - lhs.lastName == rhs.lastName && - lhs.email == rhs.email && - lhs.password == rhs.password && - lhs.phone == rhs.phone && - lhs.userStatus == rhs.userStatus - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(id?.hashValue) - hasher.combine(username?.hashValue) - hasher.combine(firstName?.hashValue) - hasher.combine(lastName?.hashValue) - hasher.combine(email?.hashValue) - hasher.combine(password?.hashValue) - hasher.combine(phone?.hashValue) - hasher.combine(userStatus?.hashValue) - - } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift index 5ae5f6a64aa9..cabe964664a1 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift @@ -139,70 +139,6 @@ public struct XmlItem: Content, Hashable { try container.encodeIfPresent(prefixNsWrappedArray, forKey: .prefixNsWrappedArray) } - public static func == (lhs: XmlItem, rhs: XmlItem) -> Bool { - lhs.attributeString == rhs.attributeString && - lhs.attributeNumber == rhs.attributeNumber && - lhs.attributeInteger == rhs.attributeInteger && - lhs.attributeBoolean == rhs.attributeBoolean && - lhs.wrappedArray == rhs.wrappedArray && - lhs.nameString == rhs.nameString && - lhs.nameNumber == rhs.nameNumber && - lhs.nameInteger == rhs.nameInteger && - lhs.nameBoolean == rhs.nameBoolean && - lhs.nameArray == rhs.nameArray && - lhs.nameWrappedArray == rhs.nameWrappedArray && - lhs.prefixString == rhs.prefixString && - lhs.prefixNumber == rhs.prefixNumber && - lhs.prefixInteger == rhs.prefixInteger && - lhs.prefixBoolean == rhs.prefixBoolean && - lhs.prefixArray == rhs.prefixArray && - lhs.prefixWrappedArray == rhs.prefixWrappedArray && - lhs.namespaceString == rhs.namespaceString && - lhs.namespaceNumber == rhs.namespaceNumber && - lhs.namespaceInteger == rhs.namespaceInteger && - lhs.namespaceBoolean == rhs.namespaceBoolean && - lhs.namespaceArray == rhs.namespaceArray && - lhs.namespaceWrappedArray == rhs.namespaceWrappedArray && - lhs.prefixNsString == rhs.prefixNsString && - lhs.prefixNsNumber == rhs.prefixNsNumber && - lhs.prefixNsInteger == rhs.prefixNsInteger && - lhs.prefixNsBoolean == rhs.prefixNsBoolean && - lhs.prefixNsArray == rhs.prefixNsArray && - lhs.prefixNsWrappedArray == rhs.prefixNsWrappedArray - - } - public func hash(into hasher: inout Hasher) { - hasher.combine(attributeString?.hashValue) - hasher.combine(attributeNumber?.hashValue) - hasher.combine(attributeInteger?.hashValue) - hasher.combine(attributeBoolean?.hashValue) - hasher.combine(wrappedArray?.hashValue) - hasher.combine(nameString?.hashValue) - hasher.combine(nameNumber?.hashValue) - hasher.combine(nameInteger?.hashValue) - hasher.combine(nameBoolean?.hashValue) - hasher.combine(nameArray?.hashValue) - hasher.combine(nameWrappedArray?.hashValue) - hasher.combine(prefixString?.hashValue) - hasher.combine(prefixNumber?.hashValue) - hasher.combine(prefixInteger?.hashValue) - hasher.combine(prefixBoolean?.hashValue) - hasher.combine(prefixArray?.hashValue) - hasher.combine(prefixWrappedArray?.hashValue) - hasher.combine(namespaceString?.hashValue) - hasher.combine(namespaceNumber?.hashValue) - hasher.combine(namespaceInteger?.hashValue) - hasher.combine(namespaceBoolean?.hashValue) - hasher.combine(namespaceArray?.hashValue) - hasher.combine(namespaceWrappedArray?.hashValue) - hasher.combine(prefixNsString?.hashValue) - hasher.combine(prefixNsNumber?.hashValue) - hasher.combine(prefixNsInteger?.hashValue) - hasher.combine(prefixNsBoolean?.hashValue) - hasher.combine(prefixNsArray?.hashValue) - hasher.combine(prefixNsWrappedArray?.hashValue) - - } } From 10f43f6da10e60b864bd2aa2ee89088b58cc9966 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 10:22:08 +0000 Subject: [PATCH 4/8] [swift6] fix vapor build --- bin/configs/swift6-vapor.yaml | 2 +- .../src/main/resources/swift6/APIs.mustache | 16 +++++------ .../main/resources/swift6/Extensions.mustache | 27 ++++++++++++++----- .../resources/swift6/Package.swift.mustache | 4 +-- .../src/main/resources/swift6/api.mustache | 10 +++---- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/bin/configs/swift6-vapor.yaml b/bin/configs/swift6-vapor.yaml index 948e4c7429fd..ffba9e9cf466 100644 --- a/bin/configs/swift6-vapor.yaml +++ b/bin/configs/swift6-vapor.yaml @@ -7,6 +7,6 @@ generateAliasAsModel: true additionalProperties: projectName: PetstoreClient useSPMFileStructure: true - useClasses: true + useClasses: false useBacktickEscapes: true mapFileBinaryToData: true diff --git a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache index 22626aa8dc3b..7e3def930f81 100644 --- a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache @@ -19,8 +19,8 @@ import Alamofire{{/useAlamofire}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var basePath: String{{#useVapor}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var customHeaders: HTTPHeaders {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var apiClient: Vapor.Client? - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var apiWrapper: (inout Vapor.ClientRequest) throws -> () - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var contentConfiguration{{/useVapor}}{{^useVapor}} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var apiWrapper: @Sendable (inout Vapor.ClientRequest) throws -> () + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var contentConfiguration: ContentConfiguration{{/useVapor}}{{^useVapor}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var customHeaders: [String: String] {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var credential: URLCredential? {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var requestBuilderFactory: RequestBuilderFactory @@ -49,8 +49,8 @@ import Alamofire{{/useAlamofire}} basePath: String = "{{{basePath}}}",{{#useVapor}} customHeaders: HTTPHeaders = [:], apiClient: Vapor.Client? = nil, - apiWrapper: (inout Vapor.ClientRequest) throws -> () = { _ in }, - contentConfiguration = ContentConfiguration.default(){{/useVapor}}{{^useVapor}} + apiWrapper: @escaping @Sendable (inout Vapor.ClientRequest) throws -> () = { _ in }, + contentConfiguration: ContentConfiguration = ContentConfiguration.default(){{/useVapor}}{{^useVapor}} customHeaders: [String: String] = [:], credential: URLCredential? = nil, requestBuilderFactory: RequestBuilderFactory = {{#useAlamofire}}AlamofireRequestBuilderFactory(){{/useAlamofire}}{{#useURLSession}}URLSessionRequestBuilderFactory(){{/useURLSession}}, @@ -63,10 +63,10 @@ import Alamofire{{/useAlamofire}} stringResponseSerializer: AnyResponseSerializer = AnyResponseSerializer(StringResponseSerializer()){{/useAlamofire}}{{/useVapor}} ) { self.basePath = basePath{{#useVapor}} - customHeaders = customHeaders - apiClient = apiClient - apiWrapper = apiWrapper - contentConfiguration = contentConfiguration{{/useVapor}}{{^useVapor}} + self.customHeaders = customHeaders + self.apiClient = apiClient + self.apiWrapper = apiWrapper + self.contentConfiguration = contentConfiguration{{/useVapor}}{{^useVapor}} self.customHeaders = customHeaders self.credential = credential self.requestBuilderFactory = requestBuilderFactory diff --git a/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache index b009950d7123..0a3670cca2c2 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache @@ -236,13 +236,11 @@ extension RequestBuilder { } }{{/usePromiseKit}}{{#useVapor}} -extension UUID: Content { } +extension UUID: @retroactive Content { } -extension URL: Content { } +extension URL: @retroactive Content { } -extension Bool: Content { } - -extension Set: ResponseEncodable where Element: Content { +extension Set: @retroactive ResponseEncodable where Element: Content { public func encodeResponse(for request: Vapor.Request) -> EventLoopFuture { let response = Vapor.Response() do { @@ -254,7 +252,15 @@ extension Set: ResponseEncodable where Element: Content { } } -extension Set: RequestDecodable where Element: Content { +extension Set: @retroactive AsyncResponseEncodable where Element: Content { + public func encodeResponse(for request: Vapor.Request) async throws -> Vapor.Response { + let response = Vapor.Response() + try response.content.encode(Array(self)) + return response + } +} + +extension Set: @retroactive RequestDecodable where Element: Content { public static func decodeRequest(_ request: Vapor.Request) -> EventLoopFuture { do { let content = try request.content.decode([Element].self) @@ -265,6 +271,13 @@ extension Set: RequestDecodable where Element: Content { } } -extension Set: Content where Element: Content { } +extension Set: @retroactive AsyncRequestDecodable where Element: Content { + public static func decodeRequest(_ request: Vapor.Request) async throws -> Self { + let content = try request.content.decode([Element].self) + return Set(content) + } +} + +extension Set: @retroactive Content where Element: Content { } extension JSONValue: Content {}{{/useVapor}} diff --git a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache index 000f495b48f0..4d6e829dcd54 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache @@ -34,7 +34,7 @@ let package = Package( .package(url: "https://github.com/ReactiveX/RxSwift", .upToNextMajor(from: "6.8.0")), {{/useRxSwift}} {{#useVapor}} - .package(url: "https://github.com/vapor/vapor", from: "4.0.0") + .package(url: "https://github.com/vapor/vapor", from: "4.99.0") {{/useVapor}} ], targets: [ @@ -42,7 +42,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "{{projectName}}", - dependencies: [{{#useVapor}}"Vapor", {{/useVapor}}{{#useAlamofire}}"Alamofire", {{/useAlamofire}}{{#usePromiseKit}}"PromiseKit", {{/usePromiseKit}}{{#useRxSwift}}"RxSwift"{{/useRxSwift}}], + dependencies: [{{#useVapor}}.product(name: "Vapor", package: "vapor"){{/useVapor}}{{#useAlamofire}}"Alamofire", {{/useAlamofire}}{{#usePromiseKit}}"PromiseKit", {{/usePromiseKit}}{{#useRxSwift}}"RxSwift"{{/useRxSwift}}], path: "{{swiftPackagePath}}{{^swiftPackagePath}}{{#useSPMFileStructure}}Sources/{{projectName}}{{/useSPMFileStructure}}{{^useSPMFileStructure}}{{projectName}}/Classes{{/useSPMFileStructure}}{{/swiftPackagePath}}" ), ], diff --git a/modules/openapi-generator/src/main/resources/swift6/api.mustache b/modules/openapi-generator/src/main/resources/swift6/api.mustache index 8242210a5a15..b07c06ad51bf 100644 --- a/modules/openapi-generator/src/main/resources/swift6/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/api.mustache @@ -357,19 +357,19 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}Raw({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}APIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}Raw({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}APIConfiguration.shared.customHeaders, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{#-first}}var{{/-first}}{{/pathParams}} localVariablePath = "{{{path}}}"{{#pathParams}} let {{paramName}}PreEscape = String(describing: {{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}{{paramName}}{{/isEnum}}) let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{paramName}}PostEscape, options: .literal, range: nil){{/pathParams}} let localVariableURLString = apiConfiguration.basePath + localVariablePath - guard let localVariableApiClient = {{#swiftUseApiNamespace}}{{projectName}}API.{{/swiftUseApiNamespace}}apiConfiguration.apiClient else { + guard let localVariableApiClient = apiConfiguration.apiClient else { fatalError("apiConfiguration.apiClient is not set.") } return localVariableApiClient.send(.{{httpMethod}}, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in - try {{#swiftUseApiNamespace}}{{projectName}}API.{{/swiftUseApiNamespace}}Configuration.apiWrapper(&localVariableRequest) + try apiConfiguration.apiWrapper(&localVariableRequest) {{#hasHeaderParams}}{{#headerParams}} localVariableRequest.headers.add(name: "{{baseName}}", value: {{#isArray}}{{paramName}}{{^required}}?{{/required}}.map { $0{{#isEnum}}.rawValue{{/isEnum}}.description }.description{{/isArray}}{{^isArray}}{{#isEnum}}{{paramName}}{{^required}}?{{/required}}.rawValue.description{{/isEnum}}{{^isEnum}}{{paramName}}{{^required}}?{{/required}}.description{{/isEnum}}{{/isArray}}{{^required}} ?? ""{{/required}}) {{/headerParams}}{{/hasHeaderParams}} @@ -437,8 +437,8 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}APIConfiguration.shared.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}> { - return {{operationId}}Raw({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}} in + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}APIConfiguration.shared.customHeaders, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}> { + return {{operationId}}Raw({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}} in switch response.status.code { {{#responses}} {{#isDefault}}default{{/isDefault}}{{^isDefault}}case {{code}}{{/isDefault}}: From 269d9485c2f3c32c6ad6dfa8e4ca0a377097ba52 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 10:25:12 +0000 Subject: [PATCH 5/8] [swift6] fix vapor build --- .../vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift | 2 +- .../vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift | 2 +- .../PetstoreClient/Models/AdditionalPropertiesAnyType.swift | 4 +--- .../PetstoreClient/Models/AdditionalPropertiesArray.swift | 4 +--- .../PetstoreClient/Models/AdditionalPropertiesBoolean.swift | 4 +--- .../PetstoreClient/Models/AdditionalPropertiesClass.swift | 4 +--- .../PetstoreClient/Models/AdditionalPropertiesInteger.swift | 4 +--- .../PetstoreClient/Models/AdditionalPropertiesNumber.swift | 4 +--- .../PetstoreClient/Models/AdditionalPropertiesObject.swift | 4 +--- .../PetstoreClient/Models/AdditionalPropertiesString.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Animal.swift | 4 +--- .../Sources/PetstoreClient/Models/ApiResponse.swift | 4 +--- .../PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift | 4 +--- .../Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift | 4 +--- .../Sources/PetstoreClient/Models/ArrayTest.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift | 4 +--- .../Sources/PetstoreClient/Models/Capitalization.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Cat.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Category.swift | 4 +--- .../Sources/PetstoreClient/Models/ClassModel.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Client.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Dog.swift | 4 +--- .../Sources/PetstoreClient/Models/EnumArrays.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/File.swift | 4 +--- .../Sources/PetstoreClient/Models/FileSchemaTestClass.swift | 4 +--- .../Sources/PetstoreClient/Models/FormatTest.swift | 4 +--- .../Sources/PetstoreClient/Models/HasOnlyReadOnly.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/List.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift | 4 +--- .../Models/MixedPropertiesAndAdditionalPropertiesClass.swift | 4 +--- .../Sources/PetstoreClient/Models/Model200Response.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Name.swift | 4 +--- .../Sources/PetstoreClient/Models/NumberOnly.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Order.swift | 4 +--- .../Sources/PetstoreClient/Models/OuterComposite.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Pet.swift | 4 +--- .../Sources/PetstoreClient/Models/ReadOnlyFirst.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Return.swift | 4 +--- .../Sources/PetstoreClient/Models/SpecialModelName.swift | 4 +--- .../Sources/PetstoreClient/Models/StringBooleanMap.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/Tag.swift | 4 +--- .../Sources/PetstoreClient/Models/TypeHolderDefault.swift | 4 +--- .../Sources/PetstoreClient/Models/TypeHolderExample.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/User.swift | 4 +--- .../vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift | 4 +--- 46 files changed, 46 insertions(+), 134 deletions(-) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 19a164eea9d7..8dec71a1181c 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -104,7 +104,7 @@ open class StoreAPI { - returns: `EventLoopFuture` of `GetInventory` */ open class func getInventory(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return getInventoryRaw(headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> GetInventory in + return getInventoryRaw(headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetInventory in switch response.status.code { case 200: return .http200(value: try response.content.decode([String: Int].self, using: apiConfiguration.contentConfiguration.requireDecoder(for: [String: Int].defaultContentType)), raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 3883e1bd4c12..690eb1c24efd 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -341,7 +341,7 @@ open class UserAPI { - returns: `EventLoopFuture` of `LogoutUser` */ open class func logoutUser(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { - return logoutUserRaw(headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> LogoutUser in + return logoutUserRaw(headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> LogoutUser in switch response.status.code { default: return .http0(raw: response) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift index cf5dc9f24f5f..d797849f9a6c 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesAnyType: Content, Hashable { +public struct AdditionalPropertiesAnyType: Sendable, Content, Hashable { public var name: String? @@ -55,7 +55,5 @@ public struct AdditionalPropertiesAnyType: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap(JSONValue.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift index 93383da3d22f..b23bc0f9b80b 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesArray: Content, Hashable { +public struct AdditionalPropertiesArray: Sendable, Content, Hashable { public var name: String? @@ -55,7 +55,5 @@ public struct AdditionalPropertiesArray: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap([JSONValue].self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift index c71f77fe456d..36e5b308d911 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesBoolean: Content, Hashable { +public struct AdditionalPropertiesBoolean: Sendable, Content, Hashable { public var name: String? @@ -55,7 +55,5 @@ public struct AdditionalPropertiesBoolean: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index fd7d6fdf980f..152cf59fd397 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesClass: Content, Hashable { +public struct AdditionalPropertiesClass: Sendable, Content, Hashable { public var mapString: [String: String]? public var mapNumber: [String: Double]? @@ -66,7 +66,5 @@ public struct AdditionalPropertiesClass: Content, Hashable { try container.encodeIfPresent(anytype2, forKey: .anytype2) try container.encodeIfPresent(anytype3, forKey: .anytype3) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift index a75515abe668..b0a0313d676e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesInteger: Content, Hashable { +public struct AdditionalPropertiesInteger: Sendable, Content, Hashable { public var name: String? @@ -55,7 +55,5 @@ public struct AdditionalPropertiesInteger: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift index 2d6bc5d93a93..d96c6160f5eb 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesNumber: Content, Hashable { +public struct AdditionalPropertiesNumber: Sendable, Content, Hashable { public var name: String? @@ -55,7 +55,5 @@ public struct AdditionalPropertiesNumber: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap(Double.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift index 7cbb823b7e30..ef397d62ab0f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesObject: Content, Hashable { +public struct AdditionalPropertiesObject: Sendable, Content, Hashable { public var name: String? @@ -55,7 +55,5 @@ public struct AdditionalPropertiesObject: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap([String: JSONValue].self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift index b3355087a155..ce1d463e89b4 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct AdditionalPropertiesString: Content, Hashable { +public struct AdditionalPropertiesString: Sendable, Content, Hashable { public var name: String? @@ -55,7 +55,5 @@ public struct AdditionalPropertiesString: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift index dee1d044e1b6..408c19651482 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Animal: Content, Hashable { +public struct Animal: Sendable, Content, Hashable { public var className: String public var color: String? = "red" @@ -30,7 +30,5 @@ public struct Animal: Content, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index 021884963114..de7650f8c07a 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct ApiResponse: Content, Hashable { +public struct ApiResponse: Sendable, Content, Hashable { public var code: Int? public var type: String? @@ -34,7 +34,5 @@ public struct ApiResponse: Content, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index af8f421fd877..2a833c75ae67 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct ArrayOfArrayOfNumberOnly: Content, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Content, Hashable { public var arrayArrayNumber: [[Double]]? @@ -26,7 +26,5 @@ public struct ArrayOfArrayOfNumberOnly: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index 7b556836c235..d626bac392d9 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct ArrayOfNumberOnly: Content, Hashable { +public struct ArrayOfNumberOnly: Sendable, Content, Hashable { public var arrayNumber: [Double]? @@ -26,7 +26,5 @@ public struct ArrayOfNumberOnly: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index 16cbdcce654a..ddd10ecc24fb 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct ArrayTest: Content, Hashable { +public struct ArrayTest: Sendable, Content, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -34,7 +34,5 @@ public struct ArrayTest: Content, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift index c96e15f5ada1..fb372fb4f98e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct BigCat: Content, Hashable { +public struct BigCat: Sendable, Content, Hashable { public enum Kind: String, Sendable, Content, Hashable, CaseIterable { case lions = "lions" @@ -32,7 +32,5 @@ public struct BigCat: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(kind, forKey: .kind) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift index 3de739a319ba..bd132c1edbce 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Capitalization: Content, Hashable { +public struct Capitalization: Sendable, Content, Hashable { public var smallCamel: String? public var capitalCamel: String? @@ -47,7 +47,5 @@ public struct Capitalization: Content, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift index 0d3b7aea6678..71adb11f6ef0 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Cat: Content, Hashable { +public struct Cat: Sendable, Content, Hashable { public var className: String public var color: String? = "red" @@ -34,7 +34,5 @@ public struct Cat: Content, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift index 76ca5c510025..11497e0f7c5d 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Category.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Category: Content, Hashable { +public struct Category: Sendable, Content, Hashable { public var id: Int64? public var name: String = "default-name" @@ -30,8 +30,6 @@ public struct Category: Content, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift index 95b2bbb17ee0..b10c055f0300 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing model with \"_class\" property */ -public struct ClassModel: Content, Hashable { +public struct ClassModel: Sendable, Content, Hashable { public var `class`: String? @@ -27,7 +27,5 @@ public struct ClassModel: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(`class`, forKey: .`class`) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift index df1d65d0601c..bb40cd87b8a5 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Client.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Client: Content, Hashable { +public struct Client: Sendable, Content, Hashable { public var client: String? @@ -26,7 +26,5 @@ public struct Client: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift index 0036b54d1e48..25bd0592e206 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Dog: Content, Hashable { +public struct Dog: Sendable, Content, Hashable { public var className: String public var color: String? = "red" @@ -34,7 +34,5 @@ public struct Dog: Content, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index 3a22fe557911..62d725acbbbd 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct EnumArrays: Content, Hashable { +public struct EnumArrays: Sendable, Content, Hashable { public enum JustSymbol: String, Sendable, Content, Hashable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -38,7 +38,5 @@ public struct EnumArrays: Content, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift index 82acb80fcd1d..3cf7147fe285 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct EnumTest: Content, Hashable { +public struct EnumTest: Sendable, Content, Hashable { public enum EnumString: String, Sendable, Content, Hashable, CaseIterable { case upper = "UPPER" @@ -60,7 +60,5 @@ public struct EnumTest: Content, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift index c73b5803bc75..53b218ea6aae 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/File.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Must be named `File` for test. */ -public struct File: Content, Hashable { +public struct File: Sendable, Content, Hashable { /** Test capitalization */ public var sourceURI: String? @@ -28,7 +28,5 @@ public struct File: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 5fad0d68aa2f..326b9f0d0d15 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct FileSchemaTestClass: Content, Hashable { +public struct FileSchemaTestClass: Sendable, Content, Hashable { public var file: File? public var files: [File]? @@ -30,7 +30,5 @@ public struct FileSchemaTestClass: Content, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift index 820b11863f9b..c91f6b451207 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct FormatTest: Content, Hashable { +public struct FormatTest: Sendable, Content, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) @@ -85,7 +85,5 @@ public struct FormatTest: Content, Hashable { try container.encode(password, forKey: .password) try container.encodeIfPresent(bigDecimal, forKey: .bigDecimal) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index fc9051d02de1..068ce1d7f1fe 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct HasOnlyReadOnly: Content, Hashable { +public struct HasOnlyReadOnly: Sendable, Content, Hashable { public var bar: String? public var foo: String? @@ -30,7 +30,5 @@ public struct HasOnlyReadOnly: Content, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift index 8f94d92a66a2..0bf0e02a912f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/List.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct List: Content, Hashable { +public struct List: Sendable, Content, Hashable { public var _123list: String? @@ -26,7 +26,5 @@ public struct List: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift index 6db5ee5f126c..e2cfc8125daa 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct MapTest: Content, Hashable { +public struct MapTest: Sendable, Content, Hashable { public enum MapOfEnumString: String, Sendable, Content, Hashable, CaseIterable { case upper = "UPPER" @@ -42,7 +42,5 @@ public struct MapTest: Content, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index be0ef0b02d56..4cb274b14d33 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct MixedPropertiesAndAdditionalPropertiesClass: Content, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Content, Hashable { public var uuid: UUID? public var dateTime: Date? @@ -34,7 +34,5 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Content, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift index e6e44dd259f7..6a6c76eb5e9e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing model name starting with number */ -public struct Model200Response: Content, Hashable { +public struct Model200Response: Sendable, Content, Hashable { public var name: Int? public var `class`: String? @@ -31,7 +31,5 @@ public struct Model200Response: Content, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(`class`, forKey: .`class`) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift index 3fec443ffa97..62db357d768c 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Name.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing model name same as property name */ -public struct Name: Content, Hashable { +public struct Name: Sendable, Content, Hashable { public var name: Int public var snakeCase: Int? @@ -39,7 +39,5 @@ public struct Name: Content, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index ab0af2211138..2b3671db5bd4 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct NumberOnly: Content, Hashable { +public struct NumberOnly: Sendable, Content, Hashable { public var justNumber: Double? @@ -26,7 +26,5 @@ public struct NumberOnly: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift index 0860c929158e..366bcfad21ab 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Order: Content, Hashable { +public struct Order: Sendable, Content, Hashable { public enum Status: String, Sendable, Content, Hashable, CaseIterable { case placed = "placed" @@ -52,8 +52,6 @@ public struct Order: Content, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index 6ca462cd3690..a6e486079b40 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct OuterComposite: Content, Hashable { +public struct OuterComposite: Sendable, Content, Hashable { public var myNumber: Double? public var myString: String? @@ -34,7 +34,5 @@ public struct OuterComposite: Content, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift index fe3fe4537c11..5a84b2a05897 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Pet: Content, Hashable { +public struct Pet: Sendable, Content, Hashable { public enum Status: String, Sendable, Content, Hashable, CaseIterable { case available = "available" @@ -53,8 +53,6 @@ public struct Pet: Content, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index cb4c6bd34377..76d6474b03c5 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct ReadOnlyFirst: Content, Hashable { +public struct ReadOnlyFirst: Sendable, Content, Hashable { public var bar: String? public var baz: String? @@ -30,7 +30,5 @@ public struct ReadOnlyFirst: Content, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift index 57f130da226a..564dac3a7786 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Return.swift @@ -9,7 +9,7 @@ import Foundation import Vapor /** Model for testing reserved words */ -public struct Return: Content, Hashable { +public struct Return: Sendable, Content, Hashable { public var `return`: Int? @@ -27,7 +27,5 @@ public struct Return: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(`return`, forKey: .`return`) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index 7fbba1d84632..3d6a0df0a3a3 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct SpecialModelName: Content, Hashable { +public struct SpecialModelName: Sendable, Content, Hashable { public var specialPropertyName: Int64? @@ -26,7 +26,5 @@ public struct SpecialModelName: Content, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index bf3571b1e46d..2e29564a9433 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct StringBooleanMap: Content, Hashable { +public struct StringBooleanMap: Sendable, Content, Hashable { public enum CodingKeys: CodingKey, CaseIterable { @@ -46,7 +46,5 @@ public struct StringBooleanMap: Content, Hashable { let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) additionalProperties = try additionalPropertiesContainer.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift index ba181347126a..d7665cf1771e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct Tag: Content, Hashable { +public struct Tag: Sendable, Content, Hashable { public var id: Int64? public var name: String? @@ -30,8 +30,6 @@ public struct Tag: Content, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index 95ac2e1f11b2..dbea8378ba21 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct TypeHolderDefault: Content, Hashable { +public struct TypeHolderDefault: Sendable, Content, Hashable { public var stringItem: String = "what" public var numberItem: Double @@ -42,7 +42,5 @@ public struct TypeHolderDefault: Content, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index 0725c54ba3a7..78e61dd7714f 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct TypeHolderExample: Content, Hashable { +public struct TypeHolderExample: Sendable, Content, Hashable { public var stringItem: String public var numberItem: Double @@ -46,7 +46,5 @@ public struct TypeHolderExample: Content, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift index e4208c643fa2..3cb01c898704 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/User.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct User: Content, Hashable { +public struct User: Sendable, Content, Hashable { public var id: Int64? public var username: String? @@ -55,8 +55,6 @@ public struct User: Content, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift index cabe964664a1..91fc7cd5a225 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/XmlItem.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public struct XmlItem: Content, Hashable { +public struct XmlItem: Sendable, Content, Hashable { public var attributeString: String? public var attributeNumber: Double? @@ -138,7 +138,5 @@ public struct XmlItem: Content, Hashable { try container.encodeIfPresent(prefixNsArray, forKey: .prefixNsArray) try container.encodeIfPresent(prefixNsWrappedArray, forKey: .prefixNsWrappedArray) } - - } From 62dfc407777692771dd5cf1f3c61616cd068fada Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 10:27:44 +0000 Subject: [PATCH 6/8] [swift5] Since swift 5 is deprecated we should disable the tests and increase the swift 6 tests on ci --- bitrise.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index 54ce23c6c534..b1ac197b4c76 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -27,15 +27,6 @@ workflows: set -e ./samples/client/petstore/swift6/swift6_test_all.sh - - script@1.2.0: - title: Run Swift5 tests - inputs: - - content: | - #!/usr/bin/env bash - - set -e - - ./samples/client/petstore/swift5/swift5_test_all.sh - script@1.2.0: title: Run swift-combine tests inputs: From 5796a3b5ada616cda6742a16051aa34bbb276fcb Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 10:41:33 +0000 Subject: [PATCH 7/8] [swift6] fix vapor build --- .../xcshareddata/swiftpm/Package.resolved | 6 +++--- samples/client/petstore/swift6/swift6_test_all.sh | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index 0bbc2634349d..6fc5b36f26de 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "472bd6166910f63c0cf0e9ff6ab969628489a7027357cae71bd565f99926ca6b", + "originHash" : "6e8e02fd42383a709bd1233e242575a29d1c56271477e2781924330451956ee8", "pins" : [ { "identity" : "alamofire", "kind" : "remoteSourceControl", "location" : "https://github.com/Alamofire/Alamofire", "state" : { - "revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a", - "version" : "5.9.1" + "revision" : "7be73f6c2b5cd90e40798b06ebd5da8f9f79cf88", + "version" : "5.11.0" } }, { diff --git a/samples/client/petstore/swift6/swift6_test_all.sh b/samples/client/petstore/swift6/swift6_test_all.sh index 6a2f45b730d9..960e0e0e25d9 100755 --- a/samples/client/petstore/swift6/swift6_test_all.sh +++ b/samples/client/petstore/swift6/swift6_test_all.sh @@ -12,20 +12,20 @@ DIRECTORY=`dirname $0` (cd $DIRECTORY/default/ && ./run_spmbuild.sh) (cd $DIRECTORY/objcCompatible/ && ./run_spmbuild.sh) (cd $DIRECTORY/oneOf/ && ./run_spmbuild.sh) -(cd $DIRECTORY/promisekitLibrary/ && ./run_spmbuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail +(cd $DIRECTORY/promisekitLibrary/ && ./run_spmbuild.sh) (cd $DIRECTORY/resultLibrary/ && ./run_spmbuild.sh) (cd $DIRECTORY/rxswiftLibrary/ && ./run_spmbuild.sh) (cd $DIRECTORY/urlsessionLibrary/ && ./run_spmbuild.sh) (cd $DIRECTORY/validation/ && ./run_spmbuild.sh) -(cd $DIRECTORY/vaporLibrary/ && ./run_spmbuild.sh) # Commented because it's not working +(cd $DIRECTORY/vaporLibrary/ && ./run_spmbuild.sh) # example project with unit tests (cd $DIRECTORY/alamofireLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/apiNonStaticMethod/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/asyncAwaitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) -(cd $DIRECTORY/combineLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail +(cd $DIRECTORY/combineLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/combineDeferredLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/default/SwaggerClientTests/ && ./run_xcodebuild.sh) -(cd $DIRECTORY/promisekitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail +(cd $DIRECTORY/promisekitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/rxswiftLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) (cd $DIRECTORY/urlsessionLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) From 44c9160f11a22b9b8aef6fdbffd35dac86c22bbb Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sun, 25 Jan 2026 17:15:27 +0000 Subject: [PATCH 8/8] [swift6] fix PR issues --- .../resources/swift6/Package.swift.mustache | 2 +- .../src/main/resources/swift6/api.mustache | 6 +- .../swift6/vaporLibrary/Package.swift | 2 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 6 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 84 +++++++++---------- .../APIs/FakeClassnameTags123API.swift | 6 +- .../Sources/PetstoreClient/APIs/PetAPI.swift | 54 ++++++------ .../PetstoreClient/APIs/StoreAPI.swift | 24 +++--- .../Sources/PetstoreClient/APIs/UserAPI.swift | 48 +++++------ 9 files changed, 116 insertions(+), 116 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache index 7267f00d3a61..ff8219f3a85e 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache @@ -34,7 +34,7 @@ let package = Package( .package(url: "https://github.com/ReactiveX/RxSwift", .upToNextMajor(from: "6.8.0")), {{/useRxSwift}} {{#useVapor}} - .package(url: "https://github.com/vapor/vapor", from: "4.99.0") + .package(url: "https://github.com/vapor/vapor", from: "4.99.0"), {{/useVapor}} ], targets: [ diff --git a/modules/openapi-generator/src/main/resources/swift6/api.mustache b/modules/openapi-generator/src/main/resources/swift6/api.mustache index e0d87d9be614..23da716370bd 100644 --- a/modules/openapi-generator/src/main/resources/swift6/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/api.mustache @@ -355,7 +355,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}Raw({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}APIConfiguration.shared.customHeaders, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}Raw({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders? = nil, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{#-first}}var{{/-first}}{{/pathParams}} localVariablePath = "{{{path}}}"{{#pathParams}} let {{paramName}}PreEscape = String(describing: {{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}{{paramName}}{{/isEnum}}) let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -366,7 +366,7 @@ extension {{projectName}}API { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.{{httpMethod}}, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.{{httpMethod}}, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) {{#hasHeaderParams}}{{#headerParams}} localVariableRequest.headers.add(name: "{{baseName}}", value: {{#isArray}}{{paramName}}{{^required}}?{{/required}}.map { $0{{#isEnum}}.rawValue{{/isEnum}}.description }.description{{/isArray}}{{^isArray}}{{#isEnum}}{{paramName}}{{^required}}?{{/required}}.rawValue.description{{/isEnum}}{{^isEnum}}{{paramName}}{{^required}}?{{/required}}.description{{/isEnum}}{{/isArray}}{{^required}} ?? ""{{/required}}) @@ -435,7 +435,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}APIConfiguration.shared.customHeaders, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}> { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders? = nil, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}> { return {{operationId}}Raw({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}} in switch response.status.code { {{#responses}} diff --git a/samples/client/petstore/swift6/vaporLibrary/Package.swift b/samples/client/petstore/swift6/vaporLibrary/Package.swift index d1fa19e8dd3e..830841275040 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Package.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Package.swift @@ -16,7 +16,7 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/vapor/vapor", from: "4.99.0") + .package(url: "https://github.com/vapor/vapor", from: "4.99.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 611eeb97e786..1900176b6f1d 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -18,7 +18,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `ClientResponse` */ - open class func call123testSpecialTagsRaw(uuidTest: UUID, body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func call123testSpecialTagsRaw(uuidTest: UUID, body: Client, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/another-fake/dummy" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -26,7 +26,7 @@ open class AnotherFakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PATCH, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PATCH, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "uuid_test", value: uuidTest.description) @@ -51,7 +51,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `Call123testSpecialTags` */ - open class func call123testSpecialTags(uuidTest: UUID, body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func call123testSpecialTags(uuidTest: UUID, body: Client, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return call123testSpecialTagsRaw(uuidTest: uuidTest, body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> Call123testSpecialTags in switch response.status.code { case 200: diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 9bde13e34387..649edd9863b4 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -17,7 +17,7 @@ open class FakeAPI { - parameter xmlItem: (body) XmlItem Body - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createXmlItemRaw(xmlItem: XmlItem, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createXmlItemRaw(xmlItem: XmlItem, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/create_xml_item" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -25,7 +25,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -47,7 +47,7 @@ open class FakeAPI { - parameter xmlItem: (body) XmlItem Body - returns: `EventLoopFuture` of `CreateXmlItem` */ - open class func createXmlItem(xmlItem: XmlItem, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createXmlItem(xmlItem: XmlItem, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return createXmlItemRaw(xmlItem: xmlItem, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateXmlItem in switch response.status.code { case 200: @@ -64,7 +64,7 @@ open class FakeAPI { - parameter body: (body) Input boolean as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterBooleanSerializeRaw(body: Bool? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterBooleanSerializeRaw(body: Bool? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/boolean" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -72,7 +72,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -95,7 +95,7 @@ open class FakeAPI { - parameter body: (body) Input boolean as post body (optional) - returns: `EventLoopFuture` of `FakeOuterBooleanSerialize` */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return fakeOuterBooleanSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterBooleanSerialize in switch response.status.code { case 200: @@ -112,7 +112,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterCompositeSerializeRaw(body: OuterComposite? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterCompositeSerializeRaw(body: OuterComposite? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/composite" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -120,7 +120,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -143,7 +143,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - returns: `EventLoopFuture` of `FakeOuterCompositeSerialize` */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return fakeOuterCompositeSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterCompositeSerialize in switch response.status.code { case 200: @@ -160,7 +160,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterNumberSerializeRaw(body: Double? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterNumberSerializeRaw(body: Double? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/number" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -168,7 +168,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -191,7 +191,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - returns: `EventLoopFuture` of `FakeOuterNumberSerialize` */ - open class func fakeOuterNumberSerialize(body: Double? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterNumberSerialize(body: Double? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return fakeOuterNumberSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterNumberSerialize in switch response.status.code { case 200: @@ -208,7 +208,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func fakeOuterStringSerializeRaw(body: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterStringSerializeRaw(body: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/outer/string" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -216,7 +216,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -239,7 +239,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - returns: `EventLoopFuture` of `FakeOuterStringSerialize` */ - open class func fakeOuterStringSerialize(body: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func fakeOuterStringSerialize(body: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return fakeOuterStringSerializeRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FakeOuterStringSerialize in switch response.status.code { case 200: @@ -256,7 +256,7 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testBodyWithFileSchemaRaw(body: FileSchemaTestClass, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testBodyWithFileSchemaRaw(body: FileSchemaTestClass, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/body-with-file-schema" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -264,7 +264,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PUT, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -285,7 +285,7 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `TestBodyWithFileSchema` */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testBodyWithFileSchemaRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestBodyWithFileSchema in switch response.status.code { case 200: @@ -302,7 +302,7 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testBodyWithQueryParamsRaw(query: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testBodyWithQueryParamsRaw(query: String, body: User, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/body-with-query-params" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -310,7 +310,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PUT, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { @@ -338,7 +338,7 @@ open class FakeAPI { - parameter body: (body) - returns: `EventLoopFuture` of `TestBodyWithQueryParams` */ - open class func testBodyWithQueryParams(query: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testBodyWithQueryParams(query: String, body: User, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testBodyWithQueryParamsRaw(query: query, body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestBodyWithQueryParams in switch response.status.code { case 200: @@ -356,7 +356,7 @@ open class FakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testClientModelRaw(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testClientModelRaw(body: Client, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -364,7 +364,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PATCH, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PATCH, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -386,7 +386,7 @@ open class FakeAPI { - parameter body: (body) client model - returns: `EventLoopFuture` of `TestClientModel` */ - open class func testClientModel(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testClientModel(body: Client, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testClientModelRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestClientModel in switch response.status.code { case 200: @@ -420,7 +420,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testEndpointParametersRaw(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testEndpointParametersRaw(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -428,7 +428,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -483,7 +483,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: `EventLoopFuture` of `TestEndpointParameters` */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testEndpointParametersRaw(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestEndpointParameters in switch response.status.code { case 400: @@ -577,7 +577,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testEnumParametersRaw(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testEnumParametersRaw(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -585,7 +585,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "enum_header_string_array", value: enumHeaderStringArray?.map { $0.rawValue.description }.description ?? "") @@ -636,7 +636,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: `EventLoopFuture` of `TestEnumParameters` */ - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testEnumParametersRaw(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestEnumParameters in switch response.status.code { case 400: @@ -661,7 +661,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testGroupParametersRaw(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testGroupParametersRaw(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -669,7 +669,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.DELETE, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "required_boolean_group", value: requiredBooleanGroup.description) @@ -712,7 +712,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: `EventLoopFuture` of `TestGroupParameters` */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testGroupParametersRaw(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestGroupParameters in switch response.status.code { case 400: @@ -729,7 +729,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testInlineAdditionalPropertiesRaw(param: [String: String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testInlineAdditionalPropertiesRaw(param: [String: String], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/inline-additionalProperties" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -737,7 +737,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -758,7 +758,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: `EventLoopFuture` of `TestInlineAdditionalProperties` */ - open class func testInlineAdditionalProperties(param: [String: String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testInlineAdditionalProperties(param: [String: String], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testInlineAdditionalPropertiesRaw(param: param, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestInlineAdditionalProperties in switch response.status.code { case 200: @@ -776,7 +776,7 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testJsonFormDataRaw(param: String, param2: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testJsonFormDataRaw(param: String, param2: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -784,7 +784,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -810,7 +810,7 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: `EventLoopFuture` of `TestJsonFormData` */ - open class func testJsonFormData(param: String, param2: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testJsonFormData(param: String, param2: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testJsonFormDataRaw(param: param, param2: param2, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestJsonFormData in switch response.status.code { case 200: @@ -831,7 +831,7 @@ open class FakeAPI { - parameter context: (query) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testQueryParameterCollectionFormatRaw(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testQueryParameterCollectionFormatRaw(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake/test-query-parameters" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -839,7 +839,7 @@ open class FakeAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PUT, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { @@ -878,7 +878,7 @@ open class FakeAPI { - parameter context: (query) - returns: `EventLoopFuture` of `TestQueryParameterCollectionFormat` */ - open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testQueryParameterCollectionFormatRaw(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestQueryParameterCollectionFormat in switch response.status.code { case 200: diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 3a8b83b197e1..352c9326d0ee 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - returns: `EventLoopFuture` of `ClientResponse` */ - open class func testClassnameRaw(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testClassnameRaw(body: Client, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/fake_classname_test" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -28,7 +28,7 @@ open class FakeClassnameTags123API { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PATCH, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PATCH, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -53,7 +53,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - returns: `EventLoopFuture` of `TestClassname` */ - open class func testClassname(body: Client, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func testClassname(body: Client, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return testClassnameRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> TestClassname in switch response.status.code { case 200: diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 6ba862f307af..70e8d3407a36 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -19,7 +19,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `ClientResponse` */ - open class func addPetRaw(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func addPetRaw(body: Pet, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -27,7 +27,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -52,7 +52,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `AddPet` */ - open class func addPet(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func addPet(body: Pet, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return addPetRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> AddPet in switch response.status.code { case 200: @@ -75,7 +75,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func deletePetRaw(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deletePetRaw(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -86,7 +86,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.DELETE, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) localVariableRequest.headers.add(name: "api_key", value: apiKey?.description ?? "") @@ -113,7 +113,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: `EventLoopFuture` of `DeletePet` */ - open class func deletePet(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deletePet(petId: Int64, apiKey: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return deletePetRaw(petId: petId, apiKey: apiKey, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> DeletePet in switch response.status.code { case 200: @@ -145,7 +145,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: `EventLoopFuture` of `ClientResponse` */ - open class func findPetsByStatusRaw(status: [Status_findPetsByStatus], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func findPetsByStatusRaw(status: [Status_findPetsByStatus], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet/findByStatus" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -153,7 +153,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { @@ -185,7 +185,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: `EventLoopFuture` of `FindPetsByStatus` */ - open class func findPetsByStatus(status: [Status_findPetsByStatus], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func findPetsByStatus(status: [Status_findPetsByStatus], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return findPetsByStatusRaw(status: status, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FindPetsByStatus in switch response.status.code { case 200: @@ -209,7 +209,7 @@ open class PetAPI { - returns: `EventLoopFuture` of `ClientResponse` */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTagsRaw(tags: Set, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func findPetsByTagsRaw(tags: Set, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet/findByTags" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -217,7 +217,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { @@ -250,7 +250,7 @@ open class PetAPI { - returns: `EventLoopFuture` of `FindPetsByTags` */ @available(*, deprecated, message: "This operation is deprecated.") - open class func findPetsByTags(tags: Set, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func findPetsByTags(tags: Set, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return findPetsByTagsRaw(tags: tags, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> FindPetsByTags in switch response.status.code { case 200: @@ -273,7 +273,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getPetByIdRaw(petId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getPetByIdRaw(petId: Int64, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -284,7 +284,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -310,7 +310,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - returns: `EventLoopFuture` of `GetPetById` */ - open class func getPetById(petId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getPetById(petId: Int64, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return getPetByIdRaw(petId: petId, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetPetById in switch response.status.code { case 200: @@ -334,7 +334,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `ClientResponse` */ - open class func updatePetRaw(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updatePetRaw(body: Pet, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/pet" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -342,7 +342,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PUT, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -369,7 +369,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: `EventLoopFuture` of `UpdatePet` */ - open class func updatePet(body: Pet, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updatePet(body: Pet, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return updatePetRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UpdatePet in switch response.status.code { case 200: @@ -397,7 +397,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func updatePetWithFormRaw(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updatePetWithFormRaw(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -408,7 +408,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -438,7 +438,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: `EventLoopFuture` of `UpdatePetWithForm` */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return updatePetWithFormRaw(petId: petId, name: name, status: status, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UpdatePetWithForm in switch response.status.code { case 405: @@ -460,7 +460,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func uploadFileRaw(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func uploadFileRaw(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/pet/{petId}/uploadImage" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -471,7 +471,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -501,7 +501,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: `EventLoopFuture` of `UploadFile` */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return uploadFileRaw(petId: petId, additionalMetadata: additionalMetadata, file: file, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UploadFile in switch response.status.code { case 200: @@ -523,7 +523,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: `EventLoopFuture` of `ClientResponse` */ - open class func uploadFileWithRequiredFileRaw(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func uploadFileWithRequiredFileRaw(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" let petIdPreEscape = String(describing: petId) let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -534,7 +534,7 @@ open class PetAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -564,7 +564,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: `EventLoopFuture` of `UploadFileWithRequiredFile` */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return uploadFileWithRequiredFileRaw(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UploadFileWithRequiredFile in switch response.status.code { case 200: diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 8dec71a1181c..8e6b7a55d3ae 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -17,7 +17,7 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - returns: `EventLoopFuture` of `ClientResponse` */ - open class func deleteOrderRaw(orderId: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deleteOrderRaw(orderId: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/store/order/{order_id}" let orderIdPreEscape = String(describing: orderId) let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -28,7 +28,7 @@ open class StoreAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.DELETE, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -50,7 +50,7 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - returns: `EventLoopFuture` of `DeleteOrder` */ - open class func deleteOrder(orderId: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deleteOrder(orderId: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return deleteOrderRaw(orderId: orderId, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> DeleteOrder in switch response.status.code { case 400: @@ -72,7 +72,7 @@ open class StoreAPI { - name: api_key - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getInventoryRaw(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getInventoryRaw(headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/store/inventory" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -80,7 +80,7 @@ open class StoreAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -103,7 +103,7 @@ open class StoreAPI { - name: api_key - returns: `EventLoopFuture` of `GetInventory` */ - open class func getInventory(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getInventory(headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return getInventoryRaw(headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetInventory in switch response.status.code { case 200: @@ -121,7 +121,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getOrderByIdRaw(orderId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getOrderByIdRaw(orderId: Int64, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/store/order/{order_id}" let orderIdPreEscape = String(describing: orderId) let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -132,7 +132,7 @@ open class StoreAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -155,7 +155,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - returns: `EventLoopFuture` of `GetOrderById` */ - open class func getOrderById(orderId: Int64, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getOrderById(orderId: Int64, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return getOrderByIdRaw(orderId: orderId, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetOrderById in switch response.status.code { case 200: @@ -176,7 +176,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - returns: `EventLoopFuture` of `ClientResponse` */ - open class func placeOrderRaw(body: Order, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func placeOrderRaw(body: Order, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/store/order" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -184,7 +184,7 @@ open class StoreAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -206,7 +206,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - returns: `EventLoopFuture` of `PlaceOrder` */ - open class func placeOrder(body: Order, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func placeOrder(body: Order, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return placeOrderRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> PlaceOrder in switch response.status.code { case 200: diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 690eb1c24efd..4f11c38a091e 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -17,7 +17,7 @@ open class UserAPI { - parameter body: (body) Created user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createUserRaw(body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUserRaw(body: User, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -25,7 +25,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -46,7 +46,7 @@ open class UserAPI { - parameter body: (body) Created user object - returns: `EventLoopFuture` of `CreateUser` */ - open class func createUser(body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUser(body: User, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return createUserRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateUser in switch response.status.code { default: @@ -61,7 +61,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createUsersWithArrayInputRaw(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUsersWithArrayInputRaw(body: [User], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/createWithArray" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -69,7 +69,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -89,7 +89,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `CreateUsersWithArrayInput` */ - open class func createUsersWithArrayInput(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUsersWithArrayInput(body: [User], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return createUsersWithArrayInputRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateUsersWithArrayInput in switch response.status.code { default: @@ -104,7 +104,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func createUsersWithListInputRaw(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUsersWithListInputRaw(body: [User], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/createWithList" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -112,7 +112,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.POST, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.POST, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -132,7 +132,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: `EventLoopFuture` of `CreateUsersWithListInput` */ - open class func createUsersWithListInput(body: [User], headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func createUsersWithListInput(body: [User], headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return createUsersWithListInputRaw(body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> CreateUsersWithListInput in switch response.status.code { default: @@ -148,7 +148,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - returns: `EventLoopFuture` of `ClientResponse` */ - open class func deleteUserRaw(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deleteUserRaw(username: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/user/{username}" let usernamePreEscape = String(describing: username) let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -159,7 +159,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.DELETE, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.DELETE, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -181,7 +181,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - returns: `EventLoopFuture` of `DeleteUser` */ - open class func deleteUser(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func deleteUser(username: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return deleteUserRaw(username: username, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> DeleteUser in switch response.status.code { case 400: @@ -200,7 +200,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: `EventLoopFuture` of `ClientResponse` */ - open class func getUserByNameRaw(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getUserByNameRaw(username: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/user/{username}" let usernamePreEscape = String(describing: username) let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -211,7 +211,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -233,7 +233,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: `EventLoopFuture` of `GetUserByName` */ - open class func getUserByName(username: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func getUserByName(username: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return getUserByNameRaw(username: username, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> GetUserByName in switch response.status.code { case 200: @@ -256,7 +256,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: `EventLoopFuture` of `ClientResponse` */ - open class func loginUserRaw(username: String, password: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func loginUserRaw(username: String, password: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/login" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -264,7 +264,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) struct QueryParams: Content { @@ -296,7 +296,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: `EventLoopFuture` of `LoginUser` */ - open class func loginUser(username: String, password: String, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func loginUser(username: String, password: String, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return loginUserRaw(username: username, password: password, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> LoginUser in switch response.status.code { case 200: @@ -314,7 +314,7 @@ open class UserAPI { GET /user/logout - returns: `EventLoopFuture` of `ClientResponse` */ - open class func logoutUserRaw(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func logoutUserRaw(headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { let localVariablePath = "/user/logout" let localVariableURLString = apiConfiguration.basePath + localVariablePath @@ -322,7 +322,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.GET, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.GET, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -340,7 +340,7 @@ open class UserAPI { GET /user/logout - returns: `EventLoopFuture` of `LogoutUser` */ - open class func logoutUser(headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func logoutUser(headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return logoutUserRaw(headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> LogoutUser in switch response.status.code { default: @@ -357,7 +357,7 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: `EventLoopFuture` of `ClientResponse` */ - open class func updateUserRaw(username: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updateUserRaw(username: String, body: User, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { var localVariablePath = "/user/{username}" let usernamePreEscape = String(describing: username) let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -368,7 +368,7 @@ open class UserAPI { fatalError("apiConfiguration.apiClient is not set.") } - return localVariableApiClient.send(.PUT, headers: headers, to: URI(string: localVariableURLString)) { localVariableRequest in + return localVariableApiClient.send(.PUT, headers: headers ?? apiConfiguration.customHeaders, to: URI(string: localVariableURLString)) { localVariableRequest in try apiConfiguration.apiWrapper(&localVariableRequest) @@ -392,7 +392,7 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: `EventLoopFuture` of `UpdateUser` */ - open class func updateUser(username: String, body: User, headers: HTTPHeaders = PetstoreClientAPIConfiguration.shared.customHeaders, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { + open class func updateUser(username: String, body: User, headers: HTTPHeaders? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture { return updateUserRaw(username: username, body: body, headers: headers, apiConfiguration: apiConfiguration, beforeSend: beforeSend).flatMapThrowing { response -> UpdateUser in switch response.status.code { case 400: