Skip to content

Commit d19f0cd

Browse files
authored
[swift6][client] Increase minimum supported SDK to accommodate swift concurrency (#22802)
* [swift6][client] Increase minimum supported SDK to accommodate swift concurrency * [swift6][client] Increase minimum supported SDK to accommodate swift concurrency
1 parent 17b7790 commit d19f0cd

131 files changed

Lines changed: 167 additions & 462 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/main/resources/swift6/APIs.mustache

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,17 @@ import Alamofire{{/useAlamofire}}
121121
{{#useAsyncAwait}}
122122
#if compiler(>=6.2)
123123
@concurrent
124-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
125124
@discardableResult
126125
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute() async throws(ErrorResponse) -> Response<T> {
127126
try await _execute()
128127
}
129128
#else
130-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
131129
@discardableResult
132130
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute() async throws(ErrorResponse) -> Response<T> {
133131
try await _execute()
134132
}
135133
#endif
136134

137-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
138135
@discardableResult
139136
private func _execute() async throws(ErrorResponse) -> Response<T> {
140137
do {

modules/openapi-generator/src/main/resources/swift6/Package.swift.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ let package = Package(
99
.macOS(.v10_15),
1010
{{/useVapor}}
1111
{{^useVapor}}
12-
.iOS(.v12),
13-
.macOS(.v10_13),
14-
.tvOS(.v12),
15-
.watchOS(.v4),
12+
.iOS(.v13),
13+
.macOS(.v10_15),
14+
.tvOS(.v13),
15+
.watchOS(.v6),
1616
{{/useVapor}}
1717
],
1818
products: [

modules/openapi-generator/src/main/resources/swift6/Podspec.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Pod::Spec.new do |s|
22
s.name = '{{projectName}}'{{#projectDescription}}
33
s.summary = '{{.}}'{{/projectDescription}}
4-
s.ios.deployment_target = '12.0'
5-
s.osx.deployment_target = '10.13'
6-
s.tvos.deployment_target = '12.0'
7-
s.watchos.deployment_target = '4.0'
4+
s.ios.deployment_target = '13.0'
5+
s.osx.deployment_target = '10.15'
6+
s.tvos.deployment_target = '13.0'
7+
s.watchos.deployment_target = '6.0'
88
s.version = '{{podVersion}}{{^podVersion}}{{#apiInfo}}{{version}}{{/apiInfo}}{{^apiInfo}}}0.0.1{{/apiInfo}}{{/podVersion}}'
99
s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v{{#apiInfo}}{{version}}{{/apiInfo}}{{^apiInfo}}}0.0.1{{/apiInfo}}' }{{/podSource}}
1010
{{#podAuthors}}

modules/openapi-generator/src/main/resources/swift6/api.mustache

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ extension {{projectName}}API {
165165
{{#isDeprecated}}
166166
@available(*, deprecated, message: "This operation is deprecated.")
167167
{{/isDeprecated}}
168-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
169168
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#apiStaticMethod}}{{#hasParams}}, {{/hasParams}}apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared{{/apiStaticMethod}}) -> AnyPublisher<{{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error> {
170169
let requestBuilder = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#apiStaticMethod}}{{#hasParams}}, {{/hasParams}}apiConfiguration: apiConfiguration{{/apiStaticMethod}})
171170
let requestTask = requestBuilder.requestTask
@@ -210,7 +209,6 @@ extension {{projectName}}API {
210209
{{#isDeprecated}}
211210
@available(*, deprecated, message: "This operation is deprecated.")
212211
{{/isDeprecated}}
213-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
214212
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#apiStaticMethod}}{{#hasParams}}, {{/hasParams}}apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared{{/apiStaticMethod}}) async throws(ErrorResponse){{#returnType}} -> {{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{/returnType}} {
215213
return try await {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#apiStaticMethod}}{{#hasParams}}, {{/hasParams}}apiConfiguration: apiConfiguration{{/apiStaticMethod}}).execute().body
216214
}

modules/openapi-generator/src/main/resources/swift6/model.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ extension {{projectName}}API {
2525
{{#swiftUseApiNamespace}}
2626
}
2727
{{/swiftUseApiNamespace}}{{#models}}{{#model}}{{#vendorExtensions.x-swift-identifiable}}
28-
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
2928
extension {{#swiftUseApiNamespace}}{{projectName}}API.{{/swiftUseApiNamespace}}{{{classname}}}: Identifiable {}
3029
{{/vendorExtensions.x-swift-identifiable}}{{/model}}{{/models}}

samples/client/petstore/swift6/alamofireLibrary/Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import PackageDescription
55
let package = Package(
66
name: "PetstoreClient",
77
platforms: [
8-
.iOS(.v12),
9-
.macOS(.v10_13),
10-
.tvOS(.v12),
11-
.watchOS(.v4),
8+
.iOS(.v13),
9+
.macOS(.v10_15),
10+
.tvOS(.v13),
11+
.watchOS(.v6),
1212
],
1313
products: [
1414
// Products define the executables and libraries produced by a package, and make them visible to other packages.

samples/client/petstore/swift6/alamofireLibrary/PetstoreClient.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Pod::Spec.new do |s|
22
s.name = 'PetstoreClient'
3-
s.ios.deployment_target = '12.0'
4-
s.osx.deployment_target = '10.13'
5-
s.tvos.deployment_target = '12.0'
6-
s.watchos.deployment_target = '4.0'
3+
s.ios.deployment_target = '13.0'
4+
s.osx.deployment_target = '10.15'
5+
s.tvos.deployment_target = '13.0'
6+
s.watchos.deployment_target = '6.0'
77
s.version = '1.0.0'
88
s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }
99
s.authors = ''

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Category.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ public struct Category: Sendable, Codable, Hashable {
3232
}
3333

3434

35-
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
3635
extension Category: Identifiable {}

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Order.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,4 @@ public struct Order: Sendable, Codable, Hashable {
5454
}
5555

5656

57-
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
5857
extension Order: Identifiable {}

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Pet.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@ public struct Pet: Sendable, Codable, Hashable {
5757
}
5858

5959

60-
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
6160
extension Pet: Identifiable {}

0 commit comments

Comments
 (0)