From dcd11c2ef777ae941d4ca968aad9ea80ca0877ca Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Fri, 23 Jan 2026 13:06:54 +0000 Subject: [PATCH 1/3] [swift6][client] make api calls concurrent --- .../src/main/resources/swift6/APIs.mustache | 1 + .../main/resources/swift6/Package.swift.mustache | 2 +- .../src/main/resources/swift6/api.mustache | 1 + .../petstore/swift6/alamofireLibrary/Package.swift | 2 +- .../swift6/apiNonStaticMethod/Package.swift | 2 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 + .../Sources/PetstoreClient/APIs/FakeAPI.swift | 12 ++++++++++++ .../APIs/FakeClassnameTags123API.swift | 1 + .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +++++++++ .../Sources/PetstoreClient/APIs/StoreAPI.swift | 4 ++++ .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ++++++++ .../PetstoreClient/Infrastructure/APIs.swift | 1 + .../swift6/asyncAwaitLibrary/Package.swift | 2 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 + .../Sources/PetstoreClient/APIs/FakeAPI.swift | 12 ++++++++++++ .../APIs/FakeClassnameTags123API.swift | 1 + .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +++++++++ .../Sources/PetstoreClient/APIs/StoreAPI.swift | 4 ++++ .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ++++++++ .../PetstoreClient/Infrastructure/APIs.swift | 1 + .../swift6/combineDeferredLibrary/Package.swift | 2 +- .../petstore/swift6/combineLibrary/Package.swift | 2 +- .../client/petstore/swift6/default/Package.swift | 2 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 + .../Sources/PetstoreClient/APIs/FakeAPI.swift | 14 ++++++++++++++ .../APIs/FakeClassnameTags123API.swift | 1 + .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +++++++++ .../Sources/PetstoreClient/APIs/StoreAPI.swift | 4 ++++ .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ++++++++ .../PetstoreClient/Infrastructure/APIs.swift | 1 + .../petstore/swift6/objcCompatible/Package.swift | 2 +- samples/client/petstore/swift6/oneOf/Package.swift | 2 +- .../swift6/promisekitLibrary/Package.swift | 2 +- .../petstore/swift6/resultLibrary/Package.swift | 2 +- .../petstore/swift6/rxswiftLibrary/Package.swift | 2 +- .../swift6/urlsessionLibrary/Package.swift | 2 +- .../petstore/swift6/validation/Package.swift | 2 +- .../Classes/OpenAPIs/APIs/DefaultAPI.swift | 1 + .../Classes/OpenAPIs/Infrastructure/APIs.swift | 1 + .../petstore/swift6/vaporLibrary/Package.swift | 2 +- 40 files changed, 129 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache index c9d2a508d099..451194bf5329 100644 --- a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache @@ -119,6 +119,7 @@ import Alamofire{{/useAlamofire}} } {{#useAsyncAwait}} + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute() async throws(ErrorResponse) -> Response { 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..ed7fa1806d18 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/modules/openapi-generator/src/main/resources/swift6/api.mustache b/modules/openapi-generator/src/main/resources/swift6/api.mustache index a4728dbfb84a..59bc2eb78b79 100644 --- a/modules/openapi-generator/src/main/resources/swift6/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/api.mustache @@ -209,6 +209,7 @@ extension {{projectName}}API { - parameter apiConfiguration: The configuration for the http request.{{/apiStaticMethod}} - returns: {{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}} */ + @concurrent {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} diff --git a/samples/client/petstore/swift6/alamofireLibrary/Package.swift b/samples/client/petstore/swift6/alamofireLibrary/Package.swift index 18f505a86cf9..67796d7d9d42 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Package.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift index 58fb81d22bd1..f32a4b76ea86 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index e825c12d849f..f65a8a23c309 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -116,6 +116,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func call123testSpecialTags(body: Client) async throws(ErrorResponse) -> Client { return try await call123testSpecialTagsWithRequestBuilder(body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift index d4ba08951590..00ee346632aa 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -111,6 +111,7 @@ open class FakeAPI { - parameter body: (body) Input boolean as post body (optional) - returns: Bool */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterBooleanSerialize(body: Bool? = nil) async throws(ErrorResponse) -> Bool { return try await fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute().body @@ -250,6 +251,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - returns: OuterComposite */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterCompositeSerialize(body: OuterComposite? = nil) async throws(ErrorResponse) -> OuterComposite { return try await fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute().body @@ -389,6 +391,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - returns: Double */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterNumberSerialize(body: Double? = nil) async throws(ErrorResponse) -> Double { return try await fakeOuterNumberSerializeWithRequestBuilder(body: body).execute().body @@ -528,6 +531,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - returns: String */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterStringSerialize(body: String? = nil) async throws(ErrorResponse) -> String { return try await fakeOuterStringSerializeWithRequestBuilder(body: body).execute().body @@ -667,6 +671,7 @@ open class FakeAPI { - parameter body: (body) - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testBodyWithFileSchema(body: FileSchemaTestClass) async throws(ErrorResponse) { return try await testBodyWithFileSchemaWithRequestBuilder(body: body).execute().body @@ -811,6 +816,7 @@ open class FakeAPI { - parameter body: (body) - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testBodyWithQueryParams(query: String, body: User) async throws(ErrorResponse) { return try await testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute().body @@ -959,6 +965,7 @@ open class FakeAPI { - parameter body: (body) client model - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testClientModel(body: Client) async throws(ErrorResponse) -> Client { return try await testClientModelWithRequestBuilder(body: body).execute().body @@ -1170,6 +1177,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open 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) async throws(ErrorResponse) { return try await testEndpointParametersWithRequestBuilder(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).execute().body @@ -1465,6 +1473,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open 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) async throws(ErrorResponse) { return try await testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute().body @@ -1664,6 +1673,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) async throws(ErrorResponse) { return try await testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute().body @@ -1827,6 +1837,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testInlineAdditionalProperties(param: [String: String]) async throws(ErrorResponse) { return try await testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute().body @@ -1977,6 +1988,7 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testJsonFormData(param: String, param2: String) async throws(ErrorResponse) { return try await testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 70fa1efd0ff5..99d5a76b7521 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -116,6 +116,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testClassname(body: Client) async throws(ErrorResponse) -> Client { return try await testClassnameWithRequestBuilder(body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift index fb4c4debdc92..858ba510779d 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift @@ -116,6 +116,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func addPet(body: Pet) async throws(ErrorResponse) { return try await addPetWithRequestBuilder(body: body).execute().body @@ -272,6 +273,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deletePet(petId: Int64, apiKey: String? = nil) async throws(ErrorResponse) { return try await deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute().body @@ -434,6 +436,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: [Pet] */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func findPetsByStatus(status: [Status_findPetsByStatus]) async throws(ErrorResponse) -> [Pet] { return try await findPetsByStatusWithRequestBuilder(status: status).execute().body @@ -590,6 +593,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: [Pet] */ + @concurrent @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func findPetsByTags(tags: [String]) async throws(ErrorResponse) -> [Pet] { @@ -745,6 +749,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - returns: Pet */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getPetById(petId: Int64) async throws(ErrorResponse) -> Pet { return try await getPetByIdWithRequestBuilder(petId: petId).execute().body @@ -897,6 +902,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func updatePet(body: Pet) async throws(ErrorResponse) { return try await updatePetWithRequestBuilder(body: body).execute().body @@ -1055,6 +1061,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) async throws(ErrorResponse) { return try await updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute().body @@ -1226,6 +1233,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: ApiResponse */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute().body @@ -1397,6 +1405,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: ApiResponse */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func uploadFileWithRequiredFile(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift index 4b0490a5563a..e13bc4ce8b46 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -116,6 +116,7 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteOrder(orderId: String) async throws(ErrorResponse) { return try await deleteOrderWithRequestBuilder(orderId: orderId).execute().body @@ -260,6 +261,7 @@ open class StoreAPI { - returns: [String: Int] */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getInventory() async throws(ErrorResponse) -> [String: Int] { return try await getInventoryWithRequestBuilder().execute().body @@ -407,6 +409,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - returns: Order */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getOrderById(orderId: Int64) async throws(ErrorResponse) -> Order { return try await getOrderByIdWithRequestBuilder(orderId: orderId).execute().body @@ -556,6 +559,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - returns: Order */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func placeOrder(body: Order) async throws(ErrorResponse) -> Order { return try await placeOrderWithRequestBuilder(body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift index eec7a4630485..c40ac39efe68 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift @@ -116,6 +116,7 @@ open class UserAPI { - parameter body: (body) Created user object - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func createUser(body: User) async throws(ErrorResponse) { return try await createUserWithRequestBuilder(body: body).execute().body @@ -262,6 +263,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func createUsersWithArrayInput(body: [User]) async throws(ErrorResponse) { return try await createUsersWithArrayInputWithRequestBuilder(body: body).execute().body @@ -407,6 +409,7 @@ open class UserAPI { - parameter body: (body) List of user object - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func createUsersWithListInput(body: [User]) async throws(ErrorResponse) { return try await createUsersWithListInputWithRequestBuilder(body: body).execute().body @@ -552,6 +555,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteUser(username: String) async throws(ErrorResponse) { return try await deleteUserWithRequestBuilder(username: username).execute().body @@ -701,6 +705,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: User */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getUserByName(username: String) async throws(ErrorResponse) -> User { return try await getUserByNameWithRequestBuilder(username: username).execute().body @@ -854,6 +859,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: String */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func loginUser(username: String, password: String) async throws(ErrorResponse) -> String { return try await loginUserWithRequestBuilder(username: username, password: password).execute().body @@ -1001,6 +1007,7 @@ open class UserAPI { - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func logoutUser() async throws(ErrorResponse) { return try await logoutUserWithRequestBuilder().execute().body @@ -1149,6 +1156,7 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func updateUser(username: String, body: User) async throws(ErrorResponse) { return try await updateUserWithRequestBuilder(username: username, body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift index e697fa560e49..af22680eecd6 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -97,6 +97,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift index 0c83fdb87472..42b7351bfd85 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 961bc491b4ea..e16d323fbeb1 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -16,6 +16,7 @@ open class AnotherFakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await call123testSpecialTagsWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 8c2a987f7c77..852b2eeaf979 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -15,6 +15,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Bool */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Bool { return try await fakeOuterBooleanSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -51,6 +52,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: OuterComposite */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> OuterComposite { return try await fakeOuterCompositeSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -87,6 +89,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Double */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Double { return try await fakeOuterNumberSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -123,6 +126,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await fakeOuterStringSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -159,6 +163,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithFileSchemaWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -196,6 +201,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithQueryParamsWithRequestBuilder(query: query, body: body, apiConfiguration: apiConfiguration).execute().body @@ -236,6 +242,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClientModelWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -287,6 +294,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEndpointParametersWithRequestBuilder(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, apiConfiguration: apiConfiguration).execute().body @@ -433,6 +441,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, apiConfiguration: apiConfiguration).execute().body @@ -497,6 +506,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group, apiConfiguration: apiConfiguration).execute().body @@ -547,6 +557,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testInlineAdditionalPropertiesWithRequestBuilder(param: param, apiConfiguration: apiConfiguration).execute().body @@ -585,6 +596,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testJsonFormDataWithRequestBuilder(param: param, param2: param2, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 77649e663603..2f9145e41282 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -16,6 +16,7 @@ open class FakeClassnameTags123API { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClassnameWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index e7e2b597031e..3c14472c0f99 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -16,6 +16,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await addPetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -60,6 +61,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deletePetWithRequestBuilder(petId: petId, apiKey: apiKey, apiConfiguration: apiConfiguration).execute().body @@ -113,6 +115,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [Pet] */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [Pet] { return try await findPetsByStatusWithRequestBuilder(status: status, apiConfiguration: apiConfiguration).execute().body @@ -157,6 +160,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [Pet] */ + @concurrent @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [Pet] { @@ -203,6 +207,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Pet */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Pet { return try await getPetByIdWithRequestBuilder(petId: petId, apiConfiguration: apiConfiguration).execute().body @@ -247,6 +252,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -289,6 +295,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status, apiConfiguration: apiConfiguration).execute().body @@ -342,6 +349,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file, apiConfiguration: apiConfiguration).execute().body @@ -395,6 +403,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 06e30274cec6..2560b0fdf01e 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -16,6 +16,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteOrderWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -56,6 +57,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [String: Int] */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [String: Int] { return try await getInventoryWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -96,6 +98,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await getOrderByIdWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -137,6 +140,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await placeOrderWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index bb05d9be0a52..1628261eab48 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -16,6 +16,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUserWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -54,6 +55,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithArrayInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -91,6 +93,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithListInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -128,6 +131,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteUserWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -169,6 +173,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: User */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> User { return try await getUserByNameWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -210,6 +215,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await loginUserWithRequestBuilder(username: username, password: password, apiConfiguration: apiConfiguration).execute().body @@ -252,6 +258,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await logoutUserWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -289,6 +296,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updateUserWithRequestBuilder(username: username, body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index 1d94b12a8166..1b449cffd4a7 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -83,6 +83,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift b/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift index dc5bc46564c7..3a62d0027b0a 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/combineLibrary/Package.swift b/samples/client/petstore/swift6/combineLibrary/Package.swift index dc3d9db7cf9b..1571d32c7523 100644 --- a/samples/client/petstore/swift6/combineLibrary/Package.swift +++ b/samples/client/petstore/swift6/combineLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/default/Package.swift b/samples/client/petstore/swift6/default/Package.swift index 0c83fdb87472..42b7351bfd85 100644 --- a/samples/client/petstore/swift6/default/Package.swift +++ b/samples/client/petstore/swift6/default/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index b4a5ba18dbb0..f9654378e193 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -17,6 +17,7 @@ open class AnotherFakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(uuidTest: UUID, body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await call123testSpecialTagsWithRequestBuilder(uuidTest: uuidTest, body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift index 1a841ea0b02d..a8244e172794 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -16,6 +16,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createXmlItem(xmlItem: XmlItem, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createXmlItemWithRequestBuilder(xmlItem: xmlItem, apiConfiguration: apiConfiguration).execute().body @@ -53,6 +54,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Bool */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Bool { return try await fakeOuterBooleanSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -89,6 +91,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: OuterComposite */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> OuterComposite { return try await fakeOuterCompositeSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -125,6 +128,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Double */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Double { return try await fakeOuterNumberSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -161,6 +165,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await fakeOuterStringSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -197,6 +202,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithFileSchemaWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -234,6 +240,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithQueryParamsWithRequestBuilder(query: query, body: body, apiConfiguration: apiConfiguration).execute().body @@ -274,6 +281,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClientModelWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -325,6 +333,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEndpointParametersWithRequestBuilder(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, apiConfiguration: apiConfiguration).execute().body @@ -471,6 +480,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, apiConfiguration: apiConfiguration).execute().body @@ -535,6 +545,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group, apiConfiguration: apiConfiguration).execute().body @@ -585,6 +596,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testInlineAdditionalPropertiesWithRequestBuilder(param: param, apiConfiguration: apiConfiguration).execute().body @@ -623,6 +635,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testJsonFormDataWithRequestBuilder(param: param, param2: param2, apiConfiguration: apiConfiguration).execute().body @@ -670,6 +683,7 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testQueryParameterCollectionFormatWithRequestBuilder(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 77649e663603..2f9145e41282 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -16,6 +16,7 @@ open class FakeClassnameTags123API { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClassnameWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift index 7127e038bd30..444b653d8b3c 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift @@ -16,6 +16,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await addPetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -57,6 +58,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deletePetWithRequestBuilder(petId: petId, apiKey: apiKey, apiConfiguration: apiConfiguration).execute().body @@ -110,6 +112,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [Pet] */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [Pet] { return try await findPetsByStatusWithRequestBuilder(status: status, apiConfiguration: apiConfiguration).execute().body @@ -154,6 +157,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Set */ + @concurrent @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: Set, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Set { @@ -200,6 +204,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Pet */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Pet { return try await getPetByIdWithRequestBuilder(petId: petId, apiConfiguration: apiConfiguration).execute().body @@ -244,6 +249,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -286,6 +292,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status, apiConfiguration: apiConfiguration).execute().body @@ -339,6 +346,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file, apiConfiguration: apiConfiguration).execute().body @@ -392,6 +400,7 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift index 06e30274cec6..2560b0fdf01e 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -16,6 +16,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteOrderWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -56,6 +57,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [String: Int] */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [String: Int] { return try await getInventoryWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -96,6 +98,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await getOrderByIdWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -137,6 +140,7 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await placeOrderWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift index bb05d9be0a52..1628261eab48 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift @@ -16,6 +16,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUserWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -54,6 +55,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithArrayInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -91,6 +93,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithListInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -128,6 +131,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteUserWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -169,6 +173,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: User */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> User { return try await getUserByNameWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -210,6 +215,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await loginUserWithRequestBuilder(username: username, password: password, apiConfiguration: apiConfiguration).execute().body @@ -252,6 +258,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await logoutUserWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -289,6 +296,7 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updateUserWithRequestBuilder(username: username, body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift index 1d94b12a8166..1b449cffd4a7 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -83,6 +83,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { diff --git a/samples/client/petstore/swift6/objcCompatible/Package.swift b/samples/client/petstore/swift6/objcCompatible/Package.swift index 0c83fdb87472..42b7351bfd85 100644 --- a/samples/client/petstore/swift6/objcCompatible/Package.swift +++ b/samples/client/petstore/swift6/objcCompatible/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/oneOf/Package.swift b/samples/client/petstore/swift6/oneOf/Package.swift index dc5bc46564c7..3a62d0027b0a 100644 --- a/samples/client/petstore/swift6/oneOf/Package.swift +++ b/samples/client/petstore/swift6/oneOf/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/promisekitLibrary/Package.swift b/samples/client/petstore/swift6/promisekitLibrary/Package.swift index efc43e9be1d0..6af0f335f87c 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/Package.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/resultLibrary/Package.swift b/samples/client/petstore/swift6/resultLibrary/Package.swift index dc5bc46564c7..3a62d0027b0a 100644 --- a/samples/client/petstore/swift6/resultLibrary/Package.swift +++ b/samples/client/petstore/swift6/resultLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/rxswiftLibrary/Package.swift b/samples/client/petstore/swift6/rxswiftLibrary/Package.swift index 378f1f5691f3..0beb90883eeb 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/Package.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Package.swift b/samples/client/petstore/swift6/urlsessionLibrary/Package.swift index 0c83fdb87472..42b7351bfd85 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Package.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/validation/Package.swift b/samples/client/petstore/swift6/validation/Package.swift index dc5bc46564c7..3a62d0027b0a 100644 --- a/samples/client/petstore/swift6/validation/Package.swift +++ b/samples/client/petstore/swift6/validation/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift index 3ac2200c3a62..0ad2de1d44bb 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift @@ -14,6 +14,7 @@ open class DefaultAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Banana */ + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func rootGet(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Banana { return try await rootGetWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 98c27f3af422..0c3d041151b9 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -83,6 +83,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { diff --git a/samples/client/petstore/swift6/vaporLibrary/Package.swift b/samples/client/petstore/swift6/vaporLibrary/Package.swift index 5f2d61faba90..c79e3e9dff52 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Package.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.2 import PackageDescription From fd94fca3e8f4bfc172956616a460ed29a4a501f3 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Fri, 23 Jan 2026 15:04:03 +0000 Subject: [PATCH 2/3] [swift6][client] improve swift 6 thread safety --- .../main/resources/swift6/APIHelper.mustache | 2 +- .../src/main/resources/swift6/APIs.mustache | 21 +++++++++++++++---- .../src/main/resources/swift6/Models.mustache | 6 +++--- .../resources/swift6/Package.swift.mustache | 2 +- .../main/resources/swift6/Validation.mustache | 10 ++++----- .../src/main/resources/swift6/api.mustache | 1 - .../AlamofireImplementations.mustache | 6 +++--- .../URLSessionImplementations.mustache | 6 +++--- .../swift6/alamofireLibrary/Package.swift | 2 +- .../Infrastructure/APIHelper.swift | 2 +- .../PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../AlamofireImplementations.swift | 6 +++--- .../Infrastructure/Models.swift | 6 +++--- .../Infrastructure/Validation.swift | 10 ++++----- .../swift6/apiNonStaticMethod/Package.swift | 2 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 - .../Sources/PetstoreClient/APIs/FakeAPI.swift | 12 ----------- .../APIs/FakeClassnameTags123API.swift | 1 - .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 -------- .../PetstoreClient/APIs/StoreAPI.swift | 4 ---- .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ------- .../Infrastructure/APIHelper.swift | 2 +- .../PetstoreClient/Infrastructure/APIs.swift | 21 +++++++++++++++---- .../AlamofireImplementations.swift | 6 +++--- .../Infrastructure/Models.swift | 6 +++--- .../Infrastructure/Validation.swift | 10 ++++----- .../swift6/asyncAwaitLibrary/Package.swift | 2 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 - .../Sources/PetstoreClient/APIs/FakeAPI.swift | 12 ----------- .../APIs/FakeClassnameTags123API.swift | 1 - .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 -------- .../PetstoreClient/APIs/StoreAPI.swift | 4 ---- .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ------- .../Infrastructure/APIHelper.swift | 2 +- .../PetstoreClient/Infrastructure/APIs.swift | 21 +++++++++++++++---- .../Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../Infrastructure/Validation.swift | 10 ++++----- .../combineDeferredLibrary/Package.swift | 2 +- .../OpenAPIs/Infrastructure/APIHelper.swift | 2 +- .../OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../OpenAPIs/Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../OpenAPIs/Infrastructure/Validation.swift | 10 ++++----- .../swift6/combineLibrary/Package.swift | 2 +- .../Infrastructure/APIHelper.swift | 2 +- .../CombineLibrary/Infrastructure/APIs.swift | 4 ++-- .../Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../Infrastructure/Validation.swift | 10 ++++----- .../petstore/swift6/default/Package.swift | 2 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 - .../Sources/PetstoreClient/APIs/FakeAPI.swift | 14 ------------- .../APIs/FakeClassnameTags123API.swift | 1 - .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 -------- .../PetstoreClient/APIs/StoreAPI.swift | 4 ---- .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ------- .../Infrastructure/APIHelper.swift | 2 +- .../PetstoreClient/Infrastructure/APIs.swift | 21 +++++++++++++++---- .../Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../Infrastructure/Validation.swift | 10 ++++----- .../swift6/objcCompatible/Package.swift | 2 +- .../Infrastructure/APIHelper.swift | 2 +- .../PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../Infrastructure/Validation.swift | 10 ++++----- .../petstore/swift6/oneOf/Package.swift | 2 +- .../OpenAPIs/Infrastructure/APIHelper.swift | 2 +- .../OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../OpenAPIs/Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../OpenAPIs/Infrastructure/Validation.swift | 10 ++++----- .../swift6/promisekitLibrary/Package.swift | 2 +- .../OpenAPIs/Infrastructure/APIHelper.swift | 2 +- .../OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../OpenAPIs/Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../OpenAPIs/Infrastructure/Validation.swift | 10 ++++----- .../swift6/resultLibrary/Package.swift | 2 +- .../OpenAPIs/Infrastructure/APIHelper.swift | 2 +- .../OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../OpenAPIs/Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../OpenAPIs/Infrastructure/Validation.swift | 10 ++++----- .../swift6/rxswiftLibrary/Package.swift | 2 +- .../OpenAPIs/Infrastructure/APIHelper.swift | 2 +- .../OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../OpenAPIs/Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../OpenAPIs/Infrastructure/Validation.swift | 10 ++++----- .../swift6/urlsessionLibrary/Package.swift | 2 +- .../Infrastructure/APIHelper.swift | 2 +- .../PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../Infrastructure/Validation.swift | 10 ++++----- .../petstore/swift6/validation/Package.swift | 2 +- .../Classes/OpenAPIs/APIs/DefaultAPI.swift | 1 - .../OpenAPIs/Infrastructure/APIHelper.swift | 2 +- .../OpenAPIs/Infrastructure/APIs.swift | 21 +++++++++++++++---- .../OpenAPIs/Infrastructure/Models.swift | 6 +++--- .../URLSessionImplementations.swift | 6 +++--- .../OpenAPIs/Infrastructure/Validation.swift | 10 ++++----- .../swift6/vaporLibrary/Package.swift | 2 +- .../Infrastructure/Validation.swift | 10 ++++----- 107 files changed, 294 insertions(+), 338 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache b/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache index 04c8f841528b..f25c30b2ae6b 100644 --- a/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache @@ -7,7 +7,7 @@ import Foundation{{#useVapor}} import Vapor{{/useVapor}} -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct APIHelper { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct APIHelper: Sendable { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache index 451194bf5329..22626aa8dc3b 100644 --- a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache @@ -82,7 +82,7 @@ import Alamofire{{/useAlamofire}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static let shared = {{projectName}}APIConfiguration() }{{^useVapor}} -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class RequestBuilder: @unchecked Sendable, Identifiable { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class RequestBuilder: @unchecked Sendable, Identifiable { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var credential: URLCredential? {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var headers: [String: String] {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String: any Sendable]? @@ -119,10 +119,24 @@ import Alamofire{{/useAlamofire}} } {{#useAsyncAwait}} + #if compiler(>=6.2) @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #else + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #endif + + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + private func _execute() async throws(ErrorResponse) -> Response { do { let requestTask = self.requestTask return try await withTaskCancellationHandler { @@ -136,7 +150,6 @@ import Alamofire{{/useAlamofire}} self.execute { result in switch result { case let .success(response): - nonisolated(unsafe) let response = response continuation.resume(returning: response) case let .failure(error): continuation.resume(throwing: error) @@ -154,7 +167,7 @@ import Alamofire{{/useAlamofire}} } } } - + {{/useAsyncAwait}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func addHeader(name: String, value: String) -> Self { if !value.isEmpty { @@ -168,7 +181,7 @@ import Alamofire{{/useAlamofire}} } } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol RequestBuilderFactory { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type }{{/useVapor}} diff --git a/modules/openapi-generator/src/main/resources/swift6/Models.mustache b/modules/openapi-generator/src/main/resources/swift6/Models.mustache index c8a80a636fb7..06576779dc40 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Models.mustache @@ -70,11 +70,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ErrorResponse: Error { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum DownloadException: Error { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -82,7 +82,7 @@ extension NullEncodable: Codable where Wrapped: Codable { case requestMissingURL } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum DecodableRequestBuilderError: Error { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode 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 ed7fa1806d18..000f495b48f0 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/modules/openapi-generator/src/main/resources/swift6/Validation.mustache b/modules/openapi-generator/src/main/resources/swift6/Validation.mustache index 9d60c6098f13..adfb876f001b 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Validation.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Validation.mustache @@ -27,23 +27,23 @@ extension NumericRule: Sendable where T: Sendable {} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var uniqueItems: Bool } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum StringValidationErrorKind: Error { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum NumericValidationErrorKind: Error { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ArrayValidationErrorKind: Error { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct ValidationError: Error { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct ValidationError: Error, Sendable { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} fileprivate(set) var kinds: Set } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct Validator { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/modules/openapi-generator/src/main/resources/swift6/api.mustache b/modules/openapi-generator/src/main/resources/swift6/api.mustache index 59bc2eb78b79..a4728dbfb84a 100644 --- a/modules/openapi-generator/src/main/resources/swift6/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/api.mustache @@ -209,7 +209,6 @@ extension {{projectName}}API { - parameter apiConfiguration: The configuration for the http request.{{/apiStaticMethod}} - returns: {{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}} */ - @concurrent {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/swift6/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift6/libraries/alamofire/AlamofireImplementations.mustache index f2db4445678a..a92eb8c13add 100644 --- a/modules/openapi-generator/src/main/resources/swift6/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/libraries/alamofire/AlamofireImplementations.mustache @@ -7,7 +7,7 @@ import Foundation import Alamofire -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class AlamofireRequestBuilderFactory: RequestBuilderFactory { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} final class AlamofireRequestBuilderFactory: RequestBuilderFactory, Sendable { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init() {} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -27,7 +27,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable { var managerStore = SynchronizedDictionary() } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) } @@ -255,7 +255,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable { } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder, @unchecked Sendable { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder, @unchecked Sendable { override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { if let credential = self.credential { diff --git a/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache index 191545c3d70e..f95de842ea64 100644 --- a/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/libraries/urlsession/URLSessionImplementations.mustache @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class URLSessionRequestBuilderFactory: RequestBuilderFactory { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init() {} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { } -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/alamofireLibrary/Package.swift b/samples/client/petstore/swift6/alamofireLibrary/Package.swift index 67796d7d9d42..18f505a86cf9 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Package.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index fff700bc9495..542ab429d641 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -61,7 +61,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -109,7 +109,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift index 6ab188305e2f..1efeb37227d1 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift @@ -7,7 +7,7 @@ import Foundation import Alamofire -public class AlamofireRequestBuilderFactory: RequestBuilderFactory { +public final class AlamofireRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -27,7 +27,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable { var managerStore = SynchronizedDictionary() } -open class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { +open class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) } @@ -255,7 +255,7 @@ open class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder, @unchecked Sendable { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder, @unchecked Sendable { override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { if let credential = self.credential { diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift index 788f242d4be7..a51480e9dbd2 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift @@ -70,11 +70,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -82,7 +82,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift index f32a4b76ea86..58fb81d22bd1 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index f65a8a23c309..e825c12d849f 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -116,7 +116,6 @@ open class AnotherFakeAPI { - parameter body: (body) client model - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func call123testSpecialTags(body: Client) async throws(ErrorResponse) -> Client { return try await call123testSpecialTagsWithRequestBuilder(body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift index 00ee346632aa..d4ba08951590 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -111,7 +111,6 @@ open class FakeAPI { - parameter body: (body) Input boolean as post body (optional) - returns: Bool */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterBooleanSerialize(body: Bool? = nil) async throws(ErrorResponse) -> Bool { return try await fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute().body @@ -251,7 +250,6 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - returns: OuterComposite */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterCompositeSerialize(body: OuterComposite? = nil) async throws(ErrorResponse) -> OuterComposite { return try await fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute().body @@ -391,7 +389,6 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - returns: Double */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterNumberSerialize(body: Double? = nil) async throws(ErrorResponse) -> Double { return try await fakeOuterNumberSerializeWithRequestBuilder(body: body).execute().body @@ -531,7 +528,6 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - returns: String */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func fakeOuterStringSerialize(body: String? = nil) async throws(ErrorResponse) -> String { return try await fakeOuterStringSerializeWithRequestBuilder(body: body).execute().body @@ -671,7 +667,6 @@ open class FakeAPI { - parameter body: (body) - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testBodyWithFileSchema(body: FileSchemaTestClass) async throws(ErrorResponse) { return try await testBodyWithFileSchemaWithRequestBuilder(body: body).execute().body @@ -816,7 +811,6 @@ open class FakeAPI { - parameter body: (body) - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testBodyWithQueryParams(query: String, body: User) async throws(ErrorResponse) { return try await testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute().body @@ -965,7 +959,6 @@ open class FakeAPI { - parameter body: (body) client model - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testClientModel(body: Client) async throws(ErrorResponse) -> Client { return try await testClientModelWithRequestBuilder(body: body).execute().body @@ -1177,7 +1170,6 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open 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) async throws(ErrorResponse) { return try await testEndpointParametersWithRequestBuilder(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).execute().body @@ -1473,7 +1465,6 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open 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) async throws(ErrorResponse) { return try await testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute().body @@ -1673,7 +1664,6 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) async throws(ErrorResponse) { return try await testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute().body @@ -1837,7 +1827,6 @@ open class FakeAPI { - parameter param: (body) request body - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testInlineAdditionalProperties(param: [String: String]) async throws(ErrorResponse) { return try await testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute().body @@ -1988,7 +1977,6 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testJsonFormData(param: String, param2: String) async throws(ErrorResponse) { return try await testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 99d5a76b7521..70fa1efd0ff5 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -116,7 +116,6 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func testClassname(body: Client) async throws(ErrorResponse) -> Client { return try await testClassnameWithRequestBuilder(body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift index 858ba510779d..fb4c4debdc92 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift @@ -116,7 +116,6 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func addPet(body: Pet) async throws(ErrorResponse) { return try await addPetWithRequestBuilder(body: body).execute().body @@ -273,7 +272,6 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deletePet(petId: Int64, apiKey: String? = nil) async throws(ErrorResponse) { return try await deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute().body @@ -436,7 +434,6 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: [Pet] */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func findPetsByStatus(status: [Status_findPetsByStatus]) async throws(ErrorResponse) -> [Pet] { return try await findPetsByStatusWithRequestBuilder(status: status).execute().body @@ -593,7 +590,6 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: [Pet] */ - @concurrent @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func findPetsByTags(tags: [String]) async throws(ErrorResponse) -> [Pet] { @@ -749,7 +745,6 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - returns: Pet */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getPetById(petId: Int64) async throws(ErrorResponse) -> Pet { return try await getPetByIdWithRequestBuilder(petId: petId).execute().body @@ -902,7 +897,6 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func updatePet(body: Pet) async throws(ErrorResponse) { return try await updatePetWithRequestBuilder(body: body).execute().body @@ -1061,7 +1055,6 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) async throws(ErrorResponse) { return try await updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute().body @@ -1233,7 +1226,6 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: ApiResponse */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: Data? = nil) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute().body @@ -1405,7 +1397,6 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: ApiResponse */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func uploadFileWithRequiredFile(petId: Int64, requiredFile: Data, additionalMetadata: String? = nil) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift index e13bc4ce8b46..4b0490a5563a 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -116,7 +116,6 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteOrder(orderId: String) async throws(ErrorResponse) { return try await deleteOrderWithRequestBuilder(orderId: orderId).execute().body @@ -261,7 +260,6 @@ open class StoreAPI { - returns: [String: Int] */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getInventory() async throws(ErrorResponse) -> [String: Int] { return try await getInventoryWithRequestBuilder().execute().body @@ -409,7 +407,6 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - returns: Order */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getOrderById(orderId: Int64) async throws(ErrorResponse) -> Order { return try await getOrderByIdWithRequestBuilder(orderId: orderId).execute().body @@ -559,7 +556,6 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - returns: Order */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func placeOrder(body: Order) async throws(ErrorResponse) -> Order { return try await placeOrderWithRequestBuilder(body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift index c40ac39efe68..eec7a4630485 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift @@ -116,7 +116,6 @@ open class UserAPI { - parameter body: (body) Created user object - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func createUser(body: User) async throws(ErrorResponse) { return try await createUserWithRequestBuilder(body: body).execute().body @@ -263,7 +262,6 @@ open class UserAPI { - parameter body: (body) List of user object - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func createUsersWithArrayInput(body: [User]) async throws(ErrorResponse) { return try await createUsersWithArrayInputWithRequestBuilder(body: body).execute().body @@ -409,7 +407,6 @@ open class UserAPI { - parameter body: (body) List of user object - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func createUsersWithListInput(body: [User]) async throws(ErrorResponse) { return try await createUsersWithListInputWithRequestBuilder(body: body).execute().body @@ -555,7 +552,6 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteUser(username: String) async throws(ErrorResponse) { return try await deleteUserWithRequestBuilder(username: username).execute().body @@ -705,7 +701,6 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: User */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func getUserByName(username: String) async throws(ErrorResponse) -> User { return try await getUserByNameWithRequestBuilder(username: username).execute().body @@ -859,7 +854,6 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: String */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func loginUser(username: String, password: String) async throws(ErrorResponse) -> String { return try await loginUserWithRequestBuilder(username: username, password: password).execute().body @@ -1007,7 +1001,6 @@ open class UserAPI { - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func logoutUser() async throws(ErrorResponse) { return try await logoutUserWithRequestBuilder().execute().body @@ -1156,7 +1149,6 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func updateUser(username: String, body: User) async throws(ErrorResponse) { return try await updateUserWithRequestBuilder(username: username, body: body).execute().body diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift index af22680eecd6..485bc20e0a40 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -61,7 +61,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -97,10 +97,24 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + #if compiler(>=6.2) @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #else + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #endif + + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + private func _execute() async throws(ErrorResponse) -> Response { do { let requestTask = self.requestTask return try await withTaskCancellationHandler { @@ -114,7 +128,6 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { self.execute { result in switch result { case let .success(response): - nonisolated(unsafe) let response = response continuation.resume(returning: response) case let .failure(error): continuation.resume(throwing: error) @@ -132,7 +145,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } } - + public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { headers[name] = value @@ -145,7 +158,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift index 6ab188305e2f..1efeb37227d1 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/AlamofireImplementations.swift @@ -7,7 +7,7 @@ import Foundation import Alamofire -public class AlamofireRequestBuilderFactory: RequestBuilderFactory { +public final class AlamofireRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -27,7 +27,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable { var managerStore = SynchronizedDictionary() } -open class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { +open class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) } @@ -255,7 +255,7 @@ open class AlamofireRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder, @unchecked Sendable { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder, @unchecked Sendable { override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { if let credential = self.credential { diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift index 788f242d4be7..a51480e9dbd2 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift @@ -70,11 +70,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -82,7 +82,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift index 42b7351bfd85..0c83fdb87472 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index e16d323fbeb1..961bc491b4ea 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -16,7 +16,6 @@ open class AnotherFakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await call123testSpecialTagsWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 852b2eeaf979..8c2a987f7c77 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -15,7 +15,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Bool */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Bool { return try await fakeOuterBooleanSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -52,7 +51,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: OuterComposite */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> OuterComposite { return try await fakeOuterCompositeSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -89,7 +87,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Double */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Double { return try await fakeOuterNumberSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -126,7 +123,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await fakeOuterStringSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -163,7 +159,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithFileSchemaWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -201,7 +196,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithQueryParamsWithRequestBuilder(query: query, body: body, apiConfiguration: apiConfiguration).execute().body @@ -242,7 +236,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClientModelWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -294,7 +287,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEndpointParametersWithRequestBuilder(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, apiConfiguration: apiConfiguration).execute().body @@ -441,7 +433,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, apiConfiguration: apiConfiguration).execute().body @@ -506,7 +497,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group, apiConfiguration: apiConfiguration).execute().body @@ -557,7 +547,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testInlineAdditionalPropertiesWithRequestBuilder(param: param, apiConfiguration: apiConfiguration).execute().body @@ -596,7 +585,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testJsonFormDataWithRequestBuilder(param: param, param2: param2, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 2f9145e41282..77649e663603 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -16,7 +16,6 @@ open class FakeClassnameTags123API { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClassnameWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 3c14472c0f99..e7e2b597031e 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -16,7 +16,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await addPetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -61,7 +60,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deletePetWithRequestBuilder(petId: petId, apiKey: apiKey, apiConfiguration: apiConfiguration).execute().body @@ -115,7 +113,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [Pet] */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [Pet] { return try await findPetsByStatusWithRequestBuilder(status: status, apiConfiguration: apiConfiguration).execute().body @@ -160,7 +157,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [Pet] */ - @concurrent @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [Pet] { @@ -207,7 +203,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Pet */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Pet { return try await getPetByIdWithRequestBuilder(petId: petId, apiConfiguration: apiConfiguration).execute().body @@ -252,7 +247,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -295,7 +289,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status, apiConfiguration: apiConfiguration).execute().body @@ -349,7 +342,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file, apiConfiguration: apiConfiguration).execute().body @@ -403,7 +395,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 2560b0fdf01e..06e30274cec6 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -16,7 +16,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteOrderWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -57,7 +56,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [String: Int] */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [String: Int] { return try await getInventoryWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -98,7 +96,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await getOrderByIdWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -140,7 +137,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await placeOrderWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 1628261eab48..bb05d9be0a52 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -16,7 +16,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUserWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -55,7 +54,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithArrayInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -93,7 +91,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithListInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -131,7 +128,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteUserWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -173,7 +169,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: User */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> User { return try await getUserByNameWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -215,7 +210,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await loginUserWithRequestBuilder(username: username, password: password, apiConfiguration: apiConfiguration).execute().body @@ -258,7 +252,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await logoutUserWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -296,7 +289,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updateUserWithRequestBuilder(username: username, body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index 1b449cffd4a7..675c3cf609ed 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -83,10 +83,24 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + #if compiler(>=6.2) @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #else + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #endif + + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + private func _execute() async throws(ErrorResponse) -> Response { do { let requestTask = self.requestTask return try await withTaskCancellationHandler { @@ -100,7 +114,6 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { self.execute { result in switch result { case let .success(response): - nonisolated(unsafe) let response = response continuation.resume(returning: response) case let .failure(error): continuation.resume(throwing: error) @@ -118,7 +131,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } } - + public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { headers[name] = value @@ -131,7 +144,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift b/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift index 3a62d0027b0a..dc5bc46564c7 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 3c4de9c14675..c7f49fa11157 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -95,7 +95,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/combineLibrary/Package.swift b/samples/client/petstore/swift6/combineLibrary/Package.swift index 1571d32c7523..dc3d9db7cf9b 100644 --- a/samples/client/petstore/swift6/combineLibrary/Package.swift +++ b/samples/client/petstore/swift6/combineLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift index 3c4de9c14675..c7f49fa11157 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -95,7 +95,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/default/Package.swift b/samples/client/petstore/swift6/default/Package.swift index 42b7351bfd85..0c83fdb87472 100644 --- a/samples/client/petstore/swift6/default/Package.swift +++ b/samples/client/petstore/swift6/default/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index f9654378e193..b4a5ba18dbb0 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -17,7 +17,6 @@ open class AnotherFakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(uuidTest: UUID, body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await call123testSpecialTagsWithRequestBuilder(uuidTest: uuidTest, body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift index a8244e172794..1a841ea0b02d 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -16,7 +16,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createXmlItem(xmlItem: XmlItem, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createXmlItemWithRequestBuilder(xmlItem: xmlItem, apiConfiguration: apiConfiguration).execute().body @@ -54,7 +53,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Bool */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Bool { return try await fakeOuterBooleanSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -91,7 +89,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: OuterComposite */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> OuterComposite { return try await fakeOuterCompositeSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -128,7 +125,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Double */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Double { return try await fakeOuterNumberSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -165,7 +161,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await fakeOuterStringSerializeWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -202,7 +197,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithFileSchemaWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -240,7 +234,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testBodyWithQueryParamsWithRequestBuilder(query: query, body: body, apiConfiguration: apiConfiguration).execute().body @@ -281,7 +274,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClientModelWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -333,7 +325,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEndpointParametersWithRequestBuilder(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, apiConfiguration: apiConfiguration).execute().body @@ -480,7 +471,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) 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, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, apiConfiguration: apiConfiguration).execute().body @@ -545,7 +535,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group, apiConfiguration: apiConfiguration).execute().body @@ -596,7 +585,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testInlineAdditionalPropertiesWithRequestBuilder(param: param, apiConfiguration: apiConfiguration).execute().body @@ -635,7 +623,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testJsonFormDataWithRequestBuilder(param: param, param2: param2, apiConfiguration: apiConfiguration).execute().body @@ -683,7 +670,6 @@ open class FakeAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await testQueryParameterCollectionFormatWithRequestBuilder(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 2f9145e41282..77649e663603 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -16,7 +16,6 @@ open class FakeClassnameTags123API { - parameter apiConfiguration: The configuration for the http request. - returns: Client */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Client { return try await testClassnameWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift index 444b653d8b3c..7127e038bd30 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift @@ -16,7 +16,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await addPetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -58,7 +57,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deletePetWithRequestBuilder(petId: petId, apiKey: apiKey, apiConfiguration: apiConfiguration).execute().body @@ -112,7 +110,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [Pet] */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [Pet] { return try await findPetsByStatusWithRequestBuilder(status: status, apiConfiguration: apiConfiguration).execute().body @@ -157,7 +154,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Set */ - @concurrent @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: Set, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Set { @@ -204,7 +200,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Pet */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Pet { return try await getPetByIdWithRequestBuilder(petId: petId, apiConfiguration: apiConfiguration).execute().body @@ -249,7 +244,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -292,7 +286,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status, apiConfiguration: apiConfiguration).execute().body @@ -346,7 +339,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file, apiConfiguration: apiConfiguration).execute().body @@ -400,7 +392,6 @@ open class PetAPI { - parameter apiConfiguration: The configuration for the http request. - returns: ApiResponse */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> ApiResponse { return try await uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift index 2560b0fdf01e..06e30274cec6 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -16,7 +16,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteOrderWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -57,7 +56,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: [String: Int] */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> [String: Int] { return try await getInventoryWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -98,7 +96,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await getOrderByIdWithRequestBuilder(orderId: orderId, apiConfiguration: apiConfiguration).execute().body @@ -140,7 +137,6 @@ open class StoreAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Order */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Order { return try await placeOrderWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift index 1628261eab48..bb05d9be0a52 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift @@ -16,7 +16,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUserWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -55,7 +54,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithArrayInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -93,7 +91,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await createUsersWithListInputWithRequestBuilder(body: body, apiConfiguration: apiConfiguration).execute().body @@ -131,7 +128,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await deleteUserWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -173,7 +169,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: User */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> User { return try await getUserByNameWithRequestBuilder(username: username, apiConfiguration: apiConfiguration).execute().body @@ -215,7 +210,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: String */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> String { return try await loginUserWithRequestBuilder(username: username, password: password, apiConfiguration: apiConfiguration).execute().body @@ -258,7 +252,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await logoutUserWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body @@ -296,7 +289,6 @@ open class UserAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Void */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) { return try await updateUserWithRequestBuilder(username: username, body: body, apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift index 1b449cffd4a7..675c3cf609ed 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -83,10 +83,24 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + #if compiler(>=6.2) @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #else + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #endif + + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + private func _execute() async throws(ErrorResponse) -> Response { do { let requestTask = self.requestTask return try await withTaskCancellationHandler { @@ -100,7 +114,6 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { self.execute { result in switch result { case let .success(response): - nonisolated(unsafe) let response = response continuation.resume(returning: response) case let .failure(error): continuation.resume(throwing: error) @@ -118,7 +131,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } } - + public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { headers[name] = value @@ -131,7 +144,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/objcCompatible/Package.swift b/samples/client/petstore/swift6/objcCompatible/Package.swift index 42b7351bfd85..0c83fdb87472 100644 --- a/samples/client/petstore/swift6/objcCompatible/Package.swift +++ b/samples/client/petstore/swift6/objcCompatible/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift index 3c4de9c14675..c7f49fa11157 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -95,7 +95,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/oneOf/Package.swift b/samples/client/petstore/swift6/oneOf/Package.swift index 3a62d0027b0a..dc5bc46564c7 100644 --- a/samples/client/petstore/swift6/oneOf/Package.swift +++ b/samples/client/petstore/swift6/oneOf/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index e3a1fd2b8380..2aa84c29d112 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -95,7 +95,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/promisekitLibrary/Package.swift b/samples/client/petstore/swift6/promisekitLibrary/Package.swift index 6af0f335f87c..efc43e9be1d0 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/Package.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 3c4de9c14675..c7f49fa11157 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -95,7 +95,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/resultLibrary/Package.swift b/samples/client/petstore/swift6/resultLibrary/Package.swift index 3a62d0027b0a..dc5bc46564c7 100644 --- a/samples/client/petstore/swift6/resultLibrary/Package.swift +++ b/samples/client/petstore/swift6/resultLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index f576985cdd7e..6a86fc03d8f6 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -internal struct APIHelper { +internal struct APIHelper: Sendable { internal static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 15d7a5af2665..fc4bec788267 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ internal class PetstoreClientAPIConfiguration: @unchecked Sendable { internal static let shared = PetstoreClientAPIConfiguration() } -internal class RequestBuilder: @unchecked Sendable, Identifiable { +internal class RequestBuilder: @unchecked Sendable, Identifiable { internal var credential: URLCredential? internal var headers: [String: String] internal let parameters: [String: any Sendable]? @@ -95,7 +95,7 @@ internal class RequestBuilder: @unchecked Sendable, Identifiable { } } -internal protocol RequestBuilderFactory { +internal protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 0f7fca84583b..74c89f434f10 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -internal enum ErrorResponse: Error { +internal enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -internal enum DownloadException: Error { +internal enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ internal enum DownloadException: Error { case requestMissingURL } -internal enum DecodableRequestBuilderError: Error { +internal enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 06b39a401202..641527d96aff 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -internal class URLSessionRequestBuilderFactory: RequestBuilderFactory { +internal final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { internal init() {} internal func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -internal class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +internal class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required internal init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ internal class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendab } -internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index 38e3460f565e..c52c511100ea 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ internal struct ArrayRule: Sendable { internal var uniqueItems: Bool } -internal enum StringValidationErrorKind: Error { +internal enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -internal enum NumericValidationErrorKind: Error { +internal enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -internal enum ArrayValidationErrorKind: Error { +internal enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -internal struct ValidationError: Error { +internal struct ValidationError: Error, Sendable { internal fileprivate(set) var kinds: Set } -internal struct Validator { +internal struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/rxswiftLibrary/Package.swift b/samples/client/petstore/swift6/rxswiftLibrary/Package.swift index 0beb90883eeb..378f1f5691f3 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/Package.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 3c4de9c14675..c7f49fa11157 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -95,7 +95,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Package.swift b/samples/client/petstore/swift6/urlsessionLibrary/Package.swift index 42b7351bfd85..0c83fdb87472 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Package.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index 5483a1487591..6c19df9add1e 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -49,7 +49,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -97,7 +97,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/validation/Package.swift b/samples/client/petstore/swift6/validation/Package.swift index 3a62d0027b0a..dc5bc46564c7 100644 --- a/samples/client/petstore/swift6/validation/Package.swift +++ b/samples/client/petstore/swift6/validation/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift index 0ad2de1d44bb..3ac2200c3a62 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift @@ -14,7 +14,6 @@ open class DefaultAPI { - parameter apiConfiguration: The configuration for the http request. - returns: Banana */ - @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func rootGet(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) async throws(ErrorResponse) -> Banana { return try await rootGetWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..5308eaac92c0 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -6,7 +6,7 @@ import Foundation -public struct APIHelper { +public struct APIHelper: Sendable { public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { let destination = source.reduce(into: [String: any Sendable]()) { result, item in if let value = item.value { diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 0c3d041151b9..0b3554a37cfd 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable { public static let shared = PetstoreClientAPIConfiguration() } -open class RequestBuilder: @unchecked Sendable, Identifiable { +open class RequestBuilder: @unchecked Sendable, Identifiable { public var credential: URLCredential? public var headers: [String: String] public let parameters: [String: any Sendable]? @@ -83,10 +83,24 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { return requestTask } + #if compiler(>=6.2) @concurrent @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @discardableResult open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #else + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + open func execute() async throws(ErrorResponse) -> Response { + try await _execute() + } + #endif + + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + private func _execute() async throws(ErrorResponse) -> Response { do { let requestTask = self.requestTask return try await withTaskCancellationHandler { @@ -100,7 +114,6 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { self.execute { result in switch result { case let .success(response): - nonisolated(unsafe) let response = response continuation.resume(returning: response) case let .failure(error): continuation.resume(throwing: error) @@ -118,7 +131,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } } - + public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { headers[name] = value @@ -131,7 +144,7 @@ open class RequestBuilder: @unchecked Sendable, Identifiable { } } -public protocol RequestBuilderFactory { +public protocol RequestBuilderFactory: Sendable { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 6e7a6337deb0..2b7940a33af1 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -69,11 +69,11 @@ extension NullEncodable: Codable where Wrapped: Codable { } } -public enum ErrorResponse: Error { +public enum ErrorResponse: Error, @unchecked Sendable { case error(Int, Data?, URLResponse?, Error) } -public enum DownloadException: Error { +public enum DownloadException: Error, Sendable { case responseDataMissing case responseFailed case requestMissing @@ -81,7 +81,7 @@ public enum DownloadException: Error { case requestMissingURL } -public enum DecodableRequestBuilderError: Error { +public enum DecodableRequestBuilderError: Error, @unchecked Sendable { case emptyDataResponse case nilHTTPResponse case unsuccessfulHTTPStatusCode diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift index 93bcea293c65..647904cf267e 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/URLSessionImplementations.swift @@ -40,7 +40,7 @@ extension URLSession: URLSessionProtocol { extension URLSessionDataTask: URLSessionDataTaskProtocol {} -public class URLSessionRequestBuilderFactory: RequestBuilderFactory { +public final class URLSessionRequestBuilderFactory: RequestBuilderFactory, Sendable { public init() {} public func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -69,7 +69,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable { var credentialStore = SynchronizedDictionary() } -open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { +open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration) @@ -319,7 +319,7 @@ open class URLSessionRequestBuilder: RequestBuilder, @unchecked Sendable { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder, @unchecked Sendable { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { switch T.self { diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. diff --git a/samples/client/petstore/swift6/vaporLibrary/Package.swift b/samples/client/petstore/swift6/vaporLibrary/Package.swift index c79e3e9dff52..5f2d61faba90 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Package.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.2 +// swift-tools-version:6.0 import PackageDescription diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index b830e2d31a40..11b7ac6a90be 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -27,23 +27,23 @@ public struct ArrayRule: Sendable { public var uniqueItems: Bool } -public enum StringValidationErrorKind: Error { +public enum StringValidationErrorKind: Error, Sendable { case minLength, maxLength, pattern } -public enum NumericValidationErrorKind: Error { +public enum NumericValidationErrorKind: Error, Sendable { case minimum, maximum, multipleOf } -public enum ArrayValidationErrorKind: Error { +public enum ArrayValidationErrorKind: Error, Sendable { case minItems, maxItems, uniqueItems } -public struct ValidationError: Error { +public struct ValidationError: Error, Sendable { public fileprivate(set) var kinds: Set } -public struct Validator { +public struct Validator: Sendable { /// Validate a string against a rule. /// - Parameter string: The String you wish to validate. /// - Parameter rule: The StringRule you wish to use for validation. From 0100044e2768f96b04d180ce6c52cd94af922c09 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Fri, 23 Jan 2026 16:29:17 +0000 Subject: [PATCH 3/3] [swift6][client] improve swift 6 thread safety --- .../src/main/resources/swift6/modelObject.mustache | 2 +- .../PetstoreClient/Models/AdditionalPropertiesClass.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Animal.swift | 2 +- .../Sources/PetstoreClient/Models/ApiResponse.swift | 2 +- .../PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/ArrayTest.swift | 2 +- .../Sources/PetstoreClient/Models/Capitalization.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Cat.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Category.swift | 2 +- .../Sources/PetstoreClient/Models/ClassModel.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Client.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Dog.swift | 2 +- .../Sources/PetstoreClient/Models/EnumArrays.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/File.swift | 2 +- .../Sources/PetstoreClient/Models/FileSchemaTestClass.swift | 2 +- .../Sources/PetstoreClient/Models/FormatTest.swift | 2 +- .../Sources/PetstoreClient/Models/HasOnlyReadOnly.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/List.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/MapTest.swift | 2 +- .../Models/MixedPropertiesAndAdditionalPropertiesClass.swift | 2 +- .../Sources/PetstoreClient/Models/Model200Response.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Name.swift | 2 +- .../Sources/PetstoreClient/Models/NumberOnly.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Order.swift | 2 +- .../Sources/PetstoreClient/Models/OuterComposite.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Pet.swift | 2 +- .../Sources/PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Return.swift | 2 +- .../Sources/PetstoreClient/Models/SpecialModelName.swift | 2 +- .../Sources/PetstoreClient/Models/StringBooleanMap.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Sources/PetstoreClient/Models/TypeHolderDefault.swift | 2 +- .../Sources/PetstoreClient/Models/TypeHolderExample.swift | 2 +- .../objcCompatible/Sources/PetstoreClient/Models/User.swift | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache index d577636875ba..c1e562c6ca11 100644 --- a/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache @@ -1,5 +1,5 @@ {{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}@unchecked Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} { -{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable { +{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} final class {{classname}}: NSObject, Codable, @unchecked Sendable { {{/objcCompatible}} {{#allVars}} diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index 67363bd51bb6..7e8bbecc09d2 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class AdditionalPropertiesClass: NSObject, Codable { +@objcMembers public final class AdditionalPropertiesClass: NSObject, Codable, @unchecked Sendable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift index 73979b9c7dfa..5452a85517eb 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Animal: NSObject, Codable { +@objcMembers public final class Animal: NSObject, Codable, @unchecked Sendable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift index 99c3cc011f9a..cf1e3d206d31 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ApiResponse: NSObject, Codable { +@objcMembers public final class ApiResponse: NSObject, Codable, @unchecked Sendable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index d99f7676974d..4ece3604ea54 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ArrayOfArrayOfNumberOnly: NSObject, Codable { +@objcMembers public final class ArrayOfArrayOfNumberOnly: NSObject, Codable, @unchecked Sendable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index 8995bbdf2d72..67b719892002 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ArrayOfNumberOnly: NSObject, Codable { +@objcMembers public final class ArrayOfNumberOnly: NSObject, Codable, @unchecked Sendable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift index 03e4b517b264..9d44d508ca2d 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ArrayTest: NSObject, Codable { +@objcMembers public final class ArrayTest: NSObject, Codable, @unchecked Sendable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift index c37099bfb486..67b0a829c450 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Capitalization: NSObject, Codable { +@objcMembers public final class Capitalization: NSObject, Codable, @unchecked Sendable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift index 4c5ac7fbc90a..348917b88da0 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Cat: NSObject, Codable { +@objcMembers public final class Cat: NSObject, Codable, @unchecked Sendable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift index 96fcaff3d401..a015f83a5f66 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Category: NSObject, Codable { +@objcMembers public final class Category: NSObject, Codable, @unchecked Sendable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift index 4978f212ac10..20b9477b854c 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -@objcMembers public class ClassModel: NSObject, Codable { +@objcMembers public final class ClassModel: NSObject, Codable, @unchecked Sendable { public var _class: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift index dbad08f4cee0..b0ffa2ecadf6 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Client: NSObject, Codable { +@objcMembers public final class Client: NSObject, Codable, @unchecked Sendable { public var client: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift index 972028f8d87b..939a335abed5 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Dog: NSObject, Codable { +@objcMembers public final class Dog: NSObject, Codable, @unchecked Sendable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift index 93e9af26ba6a..6b5295f71777 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class EnumArrays: NSObject, Codable { +@objcMembers public final class EnumArrays: NSObject, Codable, @unchecked Sendable { public enum JustSymbol: String, Sendable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift index ecefb6644fb2..3f16a5a51fe1 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class EnumTest: NSObject, Codable { +@objcMembers public final class EnumTest: NSObject, Codable, @unchecked Sendable { public enum EnumString: String, Sendable, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift index c8cb3ec9ca5a..3236733b5b24 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -@objcMembers public class File: NSObject, Codable { +@objcMembers public final class File: NSObject, Codable, @unchecked Sendable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 678e7dc717e2..e10083a40ba9 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class FileSchemaTestClass: NSObject, Codable { +@objcMembers public final class FileSchemaTestClass: NSObject, Codable, @unchecked Sendable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift index 2a229371bf2e..f93c182df2f3 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class FormatTest: NSObject, Codable { +@objcMembers public final class FormatTest: NSObject, Codable, @unchecked Sendable { 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/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index 5539b28b047e..37cb9878d4aa 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class HasOnlyReadOnly: NSObject, Codable { +@objcMembers public final class HasOnlyReadOnly: NSObject, Codable, @unchecked Sendable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift index 437e6e295793..431f13917f87 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class List: NSObject, Codable { +@objcMembers public final class List: NSObject, Codable, @unchecked Sendable { public var _123list: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift index 9a3a4c6f0ab9..2639df5a7711 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class MapTest: NSObject, Codable { +@objcMembers public final class MapTest: NSObject, Codable, @unchecked Sendable { public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 3c209dadf694..9db6a8e59a18 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { +@objcMembers public final class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable, @unchecked Sendable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift index 01417dc973db..4cf09f3d1aec 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -@objcMembers public class Model200Response: NSObject, Codable { +@objcMembers public final class Model200Response: NSObject, Codable, @unchecked Sendable { public var name: Int? public var nameNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift index ea194f23abe9..9d1b18bc6159 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -@objcMembers public class Name: NSObject, Codable { +@objcMembers public final class Name: NSObject, Codable, @unchecked Sendable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift index 0bf7187db5ab..23145cf57472 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class NumberOnly: NSObject, Codable { +@objcMembers public final class NumberOnly: NSObject, Codable, @unchecked Sendable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift index 0a73b6782855..40c33e727967 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Order: NSObject, Codable { +@objcMembers public final class Order: NSObject, Codable, @unchecked Sendable { public enum Status: String, Sendable, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift index 6eecc41fd8b2..7f507d7248fc 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class OuterComposite: NSObject, Codable { +@objcMembers public final class OuterComposite: NSObject, Codable, @unchecked Sendable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift index f41187772fb9..70698fc0136a 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Pet: NSObject, Codable { +@objcMembers public final class Pet: NSObject, Codable, @unchecked Sendable { public enum Status: String, Sendable, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index e7df6a5b1164..0663e2751ff0 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ReadOnlyFirst: NSObject, Codable { +@objcMembers public final class ReadOnlyFirst: NSObject, Codable, @unchecked Sendable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift index d832278eb61f..7058ae9ba6e7 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -@objcMembers public class Return: NSObject, Codable { +@objcMembers public final class Return: NSObject, Codable, @unchecked Sendable { public var _return: Int? public var _returnNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift index 33a6e621028c..6a83870af31b 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class SpecialModelName: NSObject, Codable { +@objcMembers public final class SpecialModelName: NSObject, Codable, @unchecked Sendable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift index a3240d3e3724..e94fc01c4555 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class StringBooleanMap: NSObject, Codable { +@objcMembers public final class StringBooleanMap: NSObject, Codable, @unchecked Sendable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift index 51a4111dbce4..bc2ad89a9040 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Tag: NSObject, Codable { +@objcMembers public final class Tag: NSObject, Codable, @unchecked Sendable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift index c5f3a002a8ad..4c9656ad6904 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class TypeHolderDefault: NSObject, Codable { +@objcMembers public final class TypeHolderDefault: NSObject, Codable, @unchecked Sendable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift index 36ddbd26f366..bac63f74c5cd 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class TypeHolderExample: NSObject, Codable { +@objcMembers public final class TypeHolderExample: NSObject, Codable, @unchecked Sendable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift index 434186d6edb2..c93aa17cc872 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class User: NSObject, Codable { +@objcMembers public final class User: NSObject, Codable, @unchecked Sendable { public var _id: Int64? public var _idNum: NSNumber? {