[Swift][client] add identifier to each request (#20890)

* [Swift][client] add identifier to each request

* [Swift][client] add identifier to each request

* [Swift][client] CI first build the projects then run the unit tests
This commit is contained in:
Bruno Coelho 2025-03-17 21:05:21 +00:00 committed by GitHub
parent 31c1a86736
commit 4c1257a2b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 26 additions and 27 deletions

View File

@ -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<T>: @unchecked Sendable {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class RequestBuilder<T>: @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]?

View File

@ -61,7 +61,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -61,7 +61,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ internal class PetstoreClientAPIConfiguration: @unchecked Sendable {
internal static let shared = PetstoreClientAPIConfiguration()
}
internal class RequestBuilder<T>: @unchecked Sendable {
internal class RequestBuilder<T>: @unchecked Sendable, Identifiable {
internal var credential: URLCredential?
internal var headers: [String: String]
internal let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -3,17 +3,6 @@ set -e
DIRECTORY=`dirname $0`
# example project with unit tests
(cd $DIRECTORY/alamofireLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/apiNonStaticMethod/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/asyncAwaitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
# (cd $DIRECTORY/combineLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/combineDeferredLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/default/SwaggerClientTests/ && ./run_xcodebuild.sh)
# (cd $DIRECTORY/promisekitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/rxswiftLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/urlsessionLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
# spm build
(cd $DIRECTORY/alamofireLibrary/ && ./run_spmbuild.sh)
(cd $DIRECTORY/apiNonStaticMethod/ && ./run_spmbuild.sh)
@ -23,10 +12,20 @@ DIRECTORY=`dirname $0`
(cd $DIRECTORY/default/ && ./run_spmbuild.sh)
(cd $DIRECTORY/objcCompatible/ && ./run_spmbuild.sh)
(cd $DIRECTORY/oneOf/ && ./run_spmbuild.sh)
# (cd $DIRECTORY/promisekitLibrary/ && ./run_spmbuild.sh)
# (cd $DIRECTORY/promisekitLibrary/ && ./run_spmbuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail
(cd $DIRECTORY/resultLibrary/ && ./run_spmbuild.sh)
(cd $DIRECTORY/rxswiftLibrary/ && ./run_spmbuild.sh)
(cd $DIRECTORY/urlsessionLibrary/ && ./run_spmbuild.sh)
(cd $DIRECTORY/validation/ && ./run_spmbuild.sh)
# #(cd $DIRECTORY/vaporLibrary/ && ./run_spmbuild.sh)
# (cd $DIRECTORY/vaporLibrary/ && ./run_spmbuild.sh) # Commented because it's not working
# example project with unit tests
(cd $DIRECTORY/alamofireLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/apiNonStaticMethod/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/asyncAwaitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
# (cd $DIRECTORY/combineLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail
(cd $DIRECTORY/combineDeferredLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/default/SwaggerClientTests/ && ./run_xcodebuild.sh)
# (cd $DIRECTORY/promisekitLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh) # Commented to save time in CI, building Swift5 and Swift6 is taking too much time, and making CI fail
(cd $DIRECTORY/rxswiftLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)
(cd $DIRECTORY/urlsessionLibrary/SwaggerClientTests/ && ./run_xcodebuild.sh)

View File

@ -49,7 +49,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?

View File

@ -47,7 +47,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
public static let shared = PetstoreClientAPIConfiguration()
}
open class RequestBuilder<T>: @unchecked Sendable {
open class RequestBuilder<T>: @unchecked Sendable, Identifiable {
public var credential: URLCredential?
public var headers: [String: String]
public let parameters: [String: any Sendable]?