From 577ebb687e412e49fee215c70d5e38af885b2a23 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Fri, 8 May 2020 03:13:13 +0100 Subject: [PATCH] [swift] remove urlsession kvo usage (#6211) --- .../urlsession/URLSessionImplementations.mustache | 9 +-------- .../swift5/alamofireLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../swift5/combineLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../petstore/swift5/default/.openapi-generator/VERSION | 2 +- .../default/PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../swift5/nonPublicApi/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../swift5/objcCompatible/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../swift5/promisekitLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../swift5/readonlyProperties/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../swift5/resultLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../swift5/rxswiftLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../swift5/urlsessionLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +++-- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/PetstoreClient.xcscheme | 6 ------ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- .../test/swift5/default/.openapi-generator/VERSION | 2 +- .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +-------- 52 files changed, 62 insertions(+), 189 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 6717283868f0..ca5d529b041c 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -24,8 +24,6 @@ private var urlSessionStore = SynchronizedDictionary() {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ private var urlSessionStore = SynchronizedDictionary() } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj index 5a3cb5019cc4..a03104894c7c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -305,13 +305,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -567,7 +568,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/default/.openapi-generator/VERSION b/samples/client/petstore/swift5/default/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj index 6f8918eb338e..0e4ec79d9849 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj @@ -265,13 +265,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -519,7 +520,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj index 6f8918eb338e..0e4ec79d9849 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj @@ -265,13 +265,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -519,7 +520,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () internal class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj index 6f8918eb338e..0e4ec79d9849 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj @@ -265,13 +265,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -519,7 +520,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj index 31525ebfdc62..7664d648f4f5 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -305,13 +305,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -567,7 +568,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.pbxproj index 6f8918eb338e..0e4ec79d9849 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.pbxproj @@ -265,13 +265,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -519,7 +520,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj index 6f8918eb338e..0e4ec79d9849 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -265,13 +265,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -519,7 +520,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj index 8efc1d35ec6e..a039b69cf53f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -305,13 +305,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -567,7 +568,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj index 6f8918eb338e..0e4ec79d9849 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -265,13 +265,14 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; + TargetAttributes = { + }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -519,7 +520,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; + defaultConfigurationName = Debug; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6254f..59618cad9c0b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:PetstoreClient.xcodeproj"> diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index 26d510552bb0..ce431fd1d1dd 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,10 +41,6 @@ - - - - - - () open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume() diff --git a/samples/client/test/swift5/default/.openapi-generator/VERSION b/samples/client/test/swift5/default/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/test/swift5/default/.openapi-generator/VERSION +++ b/samples/client/test/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift index 3018e3695f9d..e59109dc1fd0 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -24,8 +24,6 @@ private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - let progress = Progress() - private var observation: NSKeyValueObservation? deinit { @@ -161,12 +159,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in - self.progress.totalUnitCount = newProgress.totalUnitCount - self.progress.completedUnitCount = newProgress.completedUnitCount - } - - onProgressReady?(progress) + onProgressReady?(dataTask.progress) } dataTask.resume()