diff --git a/bin/swift4-petstore-promisekit.sh b/bin/swift4-petstore-promisekit.sh
index 6fc3975d9d7..9b1fa3233aa 100755
--- a/bin/swift4-petstore-promisekit.sh
+++ b/bin/swift4-petstore-promisekit.sh
@@ -27,16 +27,16 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
-ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-promisekit.json -o samples/client/petstore/swift4/promisekit --generate-alias-as-model $@"
+ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-promisekit.json -o samples/client/petstore/swift4/promisekitLibrary --generate-alias-as-model $@"
java $JAVA_OPTS -jar $executable $ags
if type "xcodegen" > /dev/null 2>&1; then
- cd samples/client/petstore/swift4/promisekit
+ cd samples/client/petstore/swift4/promisekitLibrary
xcodegen generate
fi
if type "swiftlint" > /dev/null 2>&1; then
- cd samples/client/petstore/swift4/promisekit
+ cd samples/client/petstore/swift4/promisekitLibrary
swiftlint autocorrect
fi
\ No newline at end of file
diff --git a/bin/swift4-petstore-rxswift.sh b/bin/swift4-petstore-rxswift.sh
index 80d2cee49a8..78416f69296 100755
--- a/bin/swift4-petstore-rxswift.sh
+++ b/bin/swift4-petstore-rxswift.sh
@@ -27,16 +27,16 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
-ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-rxswift.json -o samples/client/petstore/swift4/rxswift --generate-alias-as-model $@"
+ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-rxswift.json -o samples/client/petstore/swift4/rxswiftLibrary --generate-alias-as-model $@"
java $JAVA_OPTS -jar $executable $ags
if type "xcodegen" > /dev/null 2>&1; then
- cd samples/client/petstore/swift4/rxswift
+ cd samples/client/petstore/swift4/rxswiftLibrary
xcodegen generate
fi
if type "swiftlint" > /dev/null 2>&1; then
- cd samples/client/petstore/swift4/rxswift
+ cd samples/client/petstore/swift4/rxswiftLibrary
swiftlint autocorrect
fi
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/default/.gitignore b/samples/client/petstore/swift4/default/.gitignore
index 586cc3f2d73..5e5d5cebcf4 100644
--- a/samples/client/petstore/swift4/default/.gitignore
+++ b/samples/client/petstore/swift4/default/.gitignore
@@ -43,18 +43,18 @@ playground.xcworkspace
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
-Pods/
+# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
-Carthage/Checkouts
+# Carthage/Checkouts
Carthage/Build
# fastlane
#
-# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
diff --git a/samples/client/petstore/swift4/default/.openapi-generator/VERSION b/samples/client/petstore/swift4/default/.openapi-generator/VERSION
index c3a2c7076fa..e4955748d3e 100644
--- a/samples/client/petstore/swift4/default/.openapi-generator/VERSION
+++ b/samples/client/petstore/swift4/default/.openapi-generator/VERSION
@@ -1 +1 @@
-4.2.0-SNAPSHOT
\ No newline at end of file
+4.2.2-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/default/Package.resolved b/samples/client/petstore/swift4/default/Package.resolved
new file mode 100644
index 00000000000..ca6137050eb
--- /dev/null
+++ b/samples/client/petstore/swift4/default/Package.resolved
@@ -0,0 +1,16 @@
+{
+ "object": {
+ "pins": [
+ {
+ "package": "Alamofire",
+ "repositoryURL": "https://github.com/Alamofire/Alamofire.git",
+ "state": {
+ "branch": null,
+ "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
+ "version": "4.9.1"
+ }
+ }
+ ]
+ },
+ "version": 1
+}
diff --git a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj
index 334ca2d1924..b606fe1ab10 100644
--- a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj
+++ b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj
@@ -305,6 +305,7 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
+ Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
diff --git a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
index e8ac84fa992..26d510552bb 100644
--- a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
+++ b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
index 75dea243957..20007009680 100644
--- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
+++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
@@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value {
result[item.key] = "\(value)"
@@ -46,7 +46,7 @@ public struct APIHelper {
}
public static func mapValueToPathItem(_ source: Any) -> Any {
- if let collection = source as? Array {
+ if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
}
return source
@@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value {
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
similarity index 100%
rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile
index 29843508b65..77432f9eee9 100644
--- a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile
+++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile
@@ -1,5 +1,8 @@
+platform :ios, '9.0'
+
+source 'https://cdn.cocoapods.org/'
+
use_frameworks!
-source 'https://github.com/CocoaPods/Specs.git'
target 'SwaggerClient' do
pod "PetstoreClient", :path => "../"
diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock
index d61e9910d1c..3999ccf0bb3 100644
--- a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock
+++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock
@@ -7,7 +7,7 @@ DEPENDENCIES:
- PetstoreClient (from `../`)
SPEC REPOS:
- https://github.com/CocoaPods/Specs.git:
+ trunk:
- Alamofire
EXTERNAL SOURCES:
@@ -18,6 +18,6 @@ SPEC CHECKSUMS:
Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321
PetstoreClient: e5c71b862a32097342e341f7088805bbfc033a3e
-PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d
+PODFILE CHECKSUM: 509bec696cc1d8641751b52e4fe4bef04ac4542c
-COCOAPODS: 1.8.0.beta.2
+COCOAPODS: 1.8.4
diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh
index 410c6814dbb..19e1e06dad6 100755
--- a/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh
+++ b/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh
@@ -1,3 +1,5 @@
#!/bin/sh
-xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=12.4" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=12.4" | xcpretty && exit ${PIPESTATUS[0]}
+pod install
+
+xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}
diff --git a/samples/client/petstore/swift4/default/pom.xml b/samples/client/petstore/swift4/default/pom.xml
new file mode 100644
index 00000000000..5caba9cb463
--- /dev/null
+++ b/samples/client/petstore/swift4/default/pom.xml
@@ -0,0 +1,43 @@
+
+ 4.0.0
+ io.swagger
+ Swift4PetstoreClientTests
+ pom
+ 1.0-SNAPSHOT
+ Swift4 Swagger Petstore Client
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ xcodebuild-test
+ integration-test
+
+ exec
+
+
+ ./run_spmbuild.sh
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/swift4/default/run_spmbuild.sh b/samples/client/petstore/swift4/default/run_spmbuild.sh
new file mode 100755
index 00000000000..1a9f585ad05
--- /dev/null
+++ b/samples/client/petstore/swift4/default/run_spmbuild.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+swift build && exit ${PIPESTATUS[0]}
diff --git a/samples/client/petstore/swift4/objcCompatible/.gitignore b/samples/client/petstore/swift4/objcCompatible/.gitignore
index 586cc3f2d73..5e5d5cebcf4 100644
--- a/samples/client/petstore/swift4/objcCompatible/.gitignore
+++ b/samples/client/petstore/swift4/objcCompatible/.gitignore
@@ -43,18 +43,18 @@ playground.xcworkspace
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
-Pods/
+# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
-Carthage/Checkouts
+# Carthage/Checkouts
Carthage/Build
# fastlane
#
-# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
diff --git a/samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore b/samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore
index c5fa491b4c5..7484ee590a3 100644
--- a/samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore
+++ b/samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore
@@ -1,11 +1,11 @@
-# Swagger Codegen Ignore
-# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
-# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
diff --git a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION
index c3a2c7076fa..e4955748d3e 100644
--- a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION
+++ b/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION
@@ -1 +1 @@
-4.2.0-SNAPSHOT
\ No newline at end of file
+4.2.2-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/objcCompatible/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
rename to samples/client/petstore/swift4/objcCompatible/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
diff --git a/samples/client/petstore/swift4/objcCompatible/Package.resolved b/samples/client/petstore/swift4/objcCompatible/Package.resolved
new file mode 100644
index 00000000000..ca6137050eb
--- /dev/null
+++ b/samples/client/petstore/swift4/objcCompatible/Package.resolved
@@ -0,0 +1,16 @@
+{
+ "object": {
+ "pins": [
+ {
+ "package": "Alamofire",
+ "repositoryURL": "https://github.com/Alamofire/Alamofire.git",
+ "state": {
+ "branch": null,
+ "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
+ "version": "4.9.1"
+ }
+ }
+ ]
+ },
+ "version": 1
+}
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj
index b9d30943d8f..458c777c86e 100644
--- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj
+++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj
@@ -28,7 +28,6 @@
40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; };
418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; };
41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; };
- 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; };
4884A65ABBA468278D2450FD /* AdditionalPropertiesString.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */; };
4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; };
4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; };
@@ -68,7 +67,6 @@
DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; };
DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; };
E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; };
- EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; };
EF35D2C67E3BC377DDCC99CB /* AdditionalPropertiesBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC24C01A55F644957196F9F /* AdditionalPropertiesBoolean.swift */; };
FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; };
/* End PBXBuildFile section */
@@ -91,7 +89,6 @@
396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; };
3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; };
3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; };
- 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; };
4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; };
4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; };
4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; };
@@ -109,7 +106,6 @@
84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; };
8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; };
897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; };
- 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; };
95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; };
9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; };
9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; };
@@ -173,7 +169,6 @@
72FEDC94BA0E37214D360871 /* AdditionalPropertiesObject.swift */,
FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */,
95568E7C35F119EB4A12B498 /* Animal.swift */,
- 8D22BE01748F51106DE02332 /* AnimalFarm.swift */,
A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */,
7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */,
B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */,
@@ -206,7 +201,6 @@
6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */,
C81447828475F76C5CF4F08A /* Return.swift */,
386FD590658E90509C121118 /* SpecialModelName.swift */,
- 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */,
B2896F8BFD1AA2965C8A3015 /* Tag.swift */,
EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */,
19B65C66C97F082718DDD703 /* TypeHolderExample.swift */,
@@ -329,6 +323,7 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
+ Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
@@ -357,7 +352,6 @@
4884A65ABBA468278D2450FD /* AdditionalPropertiesString.swift in Sources */,
40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */,
2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */,
- 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */,
CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */,
0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */,
4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */,
@@ -401,7 +395,6 @@
A6E50CC6845FE58D8C236253 /* Return.swift in Sources */,
294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */,
CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */,
- EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */,
B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */,
5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */,
FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */,
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
index e8ac84fa992..26d510552bb 100644
--- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
+++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
index 75dea243957..20007009680 100644
--- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
+++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
@@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value {
result[item.key] = "\(value)"
@@ -46,7 +46,7 @@ public struct APIHelper {
}
public static func mapValueToPathItem(_ source: Any) -> Any {
- if let collection = source as? Array {
+ if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
}
return source
@@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value {
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
new file mode 100644
index 00000000000..f2b7565e2d9
--- /dev/null
+++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -0,0 +1,43 @@
+//
+// Order.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Order: Codable {
+
+ public enum Status: String, Codable {
+ case placed = "placed"
+ case approved = "approved"
+ case delivered = "delivered"
+ }
+ public var _id: Int64?
+ public var petId: Int64?
+ public var quantity: Int?
+ public var shipDate: Date?
+ /** Order Status */
+ public var status: Status?
+ public var complete: Bool? = false
+
+ public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) {
+ self._id = _id
+ self.petId = petId
+ self.quantity = quantity
+ self.shipDate = shipDate
+ self.status = status
+ self.complete = complete
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case _id = "id"
+ case petId
+ case quantity
+ case shipDate
+ case status
+ case complete
+ }
+
+}
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
new file mode 100644
index 00000000000..971ce9d4db6
--- /dev/null
+++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -0,0 +1,43 @@
+//
+// Pet.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Pet: Codable {
+
+ public enum Status: String, Codable {
+ case available = "available"
+ case pending = "pending"
+ case sold = "sold"
+ }
+ public var _id: Int64?
+ public var category: Category?
+ public var name: String
+ public var photoUrls: [String]
+ public var tags: [Tag]?
+ /** pet status in the store */
+ public var status: Status?
+
+ public init(_id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) {
+ self._id = _id
+ self.category = category
+ self.name = name
+ self.photoUrls = photoUrls
+ self.tags = tags
+ self.status = status
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case _id = "id"
+ case category
+ case name
+ case photoUrls
+ case tags
+ case status
+ }
+
+}
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
new file mode 100644
index 00000000000..83efe72b8a4
--- /dev/null
+++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -0,0 +1,25 @@
+//
+// Tag.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Tag: Codable {
+
+ public var _id: Int64?
+ public var name: String?
+
+ public init(_id: Int64?, name: String?) {
+ self._id = _id
+ self.name = name
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case _id = "id"
+ case name
+ }
+
+}
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift
new file mode 100644
index 00000000000..7d6b24b9e10
--- /dev/null
+++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -0,0 +1,44 @@
+//
+// User.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct User: Codable {
+
+ public var _id: Int64?
+ public var username: String?
+ public var firstName: String?
+ public var lastName: String?
+ public var email: String?
+ public var password: String?
+ public var phone: String?
+ /** User Status */
+ public var userStatus: Int?
+
+ public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) {
+ self._id = _id
+ self.username = username
+ self.firstName = firstName
+ self.lastName = lastName
+ self.email = email
+ self.password = password
+ self.phone = phone
+ self.userStatus = userStatus
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case _id = "id"
+ case username
+ case firstName
+ case lastName
+ case email
+ case password
+ case phone
+ case userStatus
+ }
+
+}
diff --git a/samples/client/petstore/swift4/objcCompatible/pom.xml b/samples/client/petstore/swift4/objcCompatible/pom.xml
new file mode 100644
index 00000000000..5caba9cb463
--- /dev/null
+++ b/samples/client/petstore/swift4/objcCompatible/pom.xml
@@ -0,0 +1,43 @@
+
+ 4.0.0
+ io.swagger
+ Swift4PetstoreClientTests
+ pom
+ 1.0-SNAPSHOT
+ Swift4 Swagger Petstore Client
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ xcodebuild-test
+ integration-test
+
+ exec
+
+
+ ./run_spmbuild.sh
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/swift4/objcCompatible/run_spmbuild.sh b/samples/client/petstore/swift4/objcCompatible/run_spmbuild.sh
new file mode 100755
index 00000000000..1a9f585ad05
--- /dev/null
+++ b/samples/client/petstore/swift4/objcCompatible/run_spmbuild.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+swift build && exit ${PIPESTATUS[0]}
diff --git a/samples/client/petstore/swift4/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift4/promisekit/.openapi-generator/VERSION
deleted file mode 100644
index c3a2c7076fa..00000000000
--- a/samples/client/petstore/swift4/promisekit/.openapi-generator/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-4.2.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift
deleted file mode 100644
index aa016683503..00000000000
--- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// XmlItem.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct XmlItem: Codable {
-
- public var attributeString: String?
- public var attributeNumber: Double?
- public var attributeInteger: Int?
- public var attributeBoolean: Bool?
- public var wrappedArray: [Int]?
- public var nameString: String?
- public var nameNumber: Double?
- public var nameInteger: Int?
- public var nameBoolean: Bool?
- public var nameArray: [Int]?
- public var nameWrappedArray: [Int]?
- public var prefixString: String?
- public var prefixNumber: Double?
- public var prefixInteger: Int?
- public var prefixBoolean: Bool?
- public var prefixArray: [Int]?
- public var prefixWrappedArray: [Int]?
- public var namespaceString: String?
- public var namespaceNumber: Double?
- public var namespaceInteger: Int?
- public var namespaceBoolean: Bool?
- public var namespaceArray: [Int]?
- public var namespaceWrappedArray: [Int]?
- public var prefixNsString: String?
- public var prefixNsNumber: Double?
- public var prefixNsInteger: Int?
- public var prefixNsBoolean: Bool?
- public var prefixNsArray: [Int]?
- public var prefixNsWrappedArray: [Int]?
-
- public init(attributeString: String?, attributeNumber: Double?, attributeInteger: Int?, attributeBoolean: Bool?, wrappedArray: [Int]?, nameString: String?, nameNumber: Double?, nameInteger: Int?, nameBoolean: Bool?, nameArray: [Int]?, nameWrappedArray: [Int]?, prefixString: String?, prefixNumber: Double?, prefixInteger: Int?, prefixBoolean: Bool?, prefixArray: [Int]?, prefixWrappedArray: [Int]?, namespaceString: String?, namespaceNumber: Double?, namespaceInteger: Int?, namespaceBoolean: Bool?, namespaceArray: [Int]?, namespaceWrappedArray: [Int]?, prefixNsString: String?, prefixNsNumber: Double?, prefixNsInteger: Int?, prefixNsBoolean: Bool?, prefixNsArray: [Int]?, prefixNsWrappedArray: [Int]?) {
- self.attributeString = attributeString
- self.attributeNumber = attributeNumber
- self.attributeInteger = attributeInteger
- self.attributeBoolean = attributeBoolean
- self.wrappedArray = wrappedArray
- self.nameString = nameString
- self.nameNumber = nameNumber
- self.nameInteger = nameInteger
- self.nameBoolean = nameBoolean
- self.nameArray = nameArray
- self.nameWrappedArray = nameWrappedArray
- self.prefixString = prefixString
- self.prefixNumber = prefixNumber
- self.prefixInteger = prefixInteger
- self.prefixBoolean = prefixBoolean
- self.prefixArray = prefixArray
- self.prefixWrappedArray = prefixWrappedArray
- self.namespaceString = namespaceString
- self.namespaceNumber = namespaceNumber
- self.namespaceInteger = namespaceInteger
- self.namespaceBoolean = namespaceBoolean
- self.namespaceArray = namespaceArray
- self.namespaceWrappedArray = namespaceWrappedArray
- self.prefixNsString = prefixNsString
- self.prefixNsNumber = prefixNsNumber
- self.prefixNsInteger = prefixNsInteger
- self.prefixNsBoolean = prefixNsBoolean
- self.prefixNsArray = prefixNsArray
- self.prefixNsWrappedArray = prefixNsWrappedArray
- }
-
- public enum CodingKeys: String, CodingKey {
- case attributeString = "attribute_string"
- case attributeNumber = "attribute_number"
- case attributeInteger = "attribute_integer"
- case attributeBoolean = "attribute_boolean"
- case wrappedArray = "wrapped_array"
- case nameString = "name_string"
- case nameNumber = "name_number"
- case nameInteger = "name_integer"
- case nameBoolean = "name_boolean"
- case nameArray = "name_array"
- case nameWrappedArray = "name_wrapped_array"
- case prefixString = "prefix_string"
- case prefixNumber = "prefix_number"
- case prefixInteger = "prefix_integer"
- case prefixBoolean = "prefix_boolean"
- case prefixArray = "prefix_array"
- case prefixWrappedArray = "prefix_wrapped_array"
- case namespaceString = "namespace_string"
- case namespaceNumber = "namespace_number"
- case namespaceInteger = "namespace_integer"
- case namespaceBoolean = "namespace_boolean"
- case namespaceArray = "namespace_array"
- case namespaceWrappedArray = "namespace_wrapped_array"
- case prefixNsString = "prefix_ns_string"
- case prefixNsNumber = "prefix_ns_number"
- case prefixNsInteger = "prefix_ns_integer"
- case prefixNsBoolean = "prefix_ns_boolean"
- case prefixNsArray = "prefix_ns_array"
- case prefixNsWrappedArray = "prefix_ns_wrapped_array"
- }
-
-}
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock
deleted file mode 100644
index 11db93632ec..00000000000
--- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock
+++ /dev/null
@@ -1,27 +0,0 @@
-PODS:
- - Alamofire (4.9.0)
- - PetstoreClient (1.0.0):
- - Alamofire (~> 4.9.0)
- - PromiseKit/CorePromise (~> 4.4.0)
- - PromiseKit/CorePromise (4.4.4)
-
-DEPENDENCIES:
- - PetstoreClient (from `../`)
-
-SPEC REPOS:
- https://github.com/CocoaPods/Specs.git:
- - Alamofire
- - PromiseKit
-
-EXTERNAL SOURCES:
- PetstoreClient:
- :path: "../"
-
-SPEC CHECKSUMS:
- Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321
- PetstoreClient: 16d0f56d050fe19acef55197555f60526cf4a71b
- PromiseKit: 6178219c4c7457ae90d7d8b34b7ac5eb36916519
-
-PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d
-
-COCOAPODS: 1.8.0.beta.2
diff --git a/samples/client/petstore/swift4/rxswift/.gitignore b/samples/client/petstore/swift4/promisekitLibrary/.gitignore
similarity index 94%
rename from samples/client/petstore/swift4/rxswift/.gitignore
rename to samples/client/petstore/swift4/promisekitLibrary/.gitignore
index 586cc3f2d73..5e5d5cebcf4 100644
--- a/samples/client/petstore/swift4/rxswift/.gitignore
+++ b/samples/client/petstore/swift4/promisekitLibrary/.gitignore
@@ -43,18 +43,18 @@ playground.xcworkspace
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
-Pods/
+# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
-Carthage/Checkouts
+# Carthage/Checkouts
Carthage/Build
# fastlane
#
-# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
diff --git a/samples/client/petstore/swift4/rxswift/.openapi-generator-ignore b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator-ignore
similarity index 78%
rename from samples/client/petstore/swift4/rxswift/.openapi-generator-ignore
rename to samples/client/petstore/swift4/promisekitLibrary/.openapi-generator-ignore
index c5fa491b4c5..7484ee590a3 100644
--- a/samples/client/petstore/swift4/rxswift/.openapi-generator-ignore
+++ b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator-ignore
@@ -1,11 +1,11 @@
-# Swagger Codegen Ignore
-# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
-# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
diff --git a/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION
new file mode 100644
index 00000000000..e4955748d3e
--- /dev/null
+++ b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION
@@ -0,0 +1 @@
+4.2.2-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/promisekitLibrary/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
rename to samples/client/petstore/swift4/promisekitLibrary/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
diff --git a/samples/client/petstore/swift4/promisekit/Cartfile b/samples/client/petstore/swift4/promisekitLibrary/Cartfile
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/Cartfile
rename to samples/client/petstore/swift4/promisekitLibrary/Cartfile
diff --git a/samples/client/petstore/swift4/promisekit/Info.plist b/samples/client/petstore/swift4/promisekitLibrary/Info.plist
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/Info.plist
rename to samples/client/petstore/swift4/promisekitLibrary/Info.plist
diff --git a/samples/client/petstore/swift4/promisekitLibrary/Package.resolved b/samples/client/petstore/swift4/promisekitLibrary/Package.resolved
new file mode 100644
index 00000000000..1537327e953
--- /dev/null
+++ b/samples/client/petstore/swift4/promisekitLibrary/Package.resolved
@@ -0,0 +1,25 @@
+{
+ "object": {
+ "pins": [
+ {
+ "package": "Alamofire",
+ "repositoryURL": "https://github.com/Alamofire/Alamofire.git",
+ "state": {
+ "branch": null,
+ "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
+ "version": "4.9.1"
+ }
+ },
+ {
+ "package": "PromiseKit",
+ "repositoryURL": "https://github.com/mxcl/PromiseKit.git",
+ "state": {
+ "branch": null,
+ "revision": "80963d4317bcdc03891e0fbaa744f20511d1bc08",
+ "version": "6.12.0"
+ }
+ }
+ ]
+ },
+ "version": 1
+}
diff --git a/samples/client/petstore/swift4/promisekit/Package.swift b/samples/client/petstore/swift4/promisekitLibrary/Package.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/Package.swift
rename to samples/client/petstore/swift4/promisekitLibrary/Package.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.podspec
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient.podspec
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.podspec
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj
similarity index 98%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.pbxproj
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj
index 04f57402a18..c2e04850669 100644
--- a/samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.pbxproj
+++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj
@@ -22,7 +22,6 @@
34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; };
3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; };
37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; };
- 3EA765BDC5A11401D8A16536 /* XmlItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2253391845B73B8BA368049 /* XmlItem.swift */; };
40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; };
40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; };
418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; };
@@ -106,7 +105,6 @@
9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; };
9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; };
A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; };
- A2253391845B73B8BA368049 /* XmlItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XmlItem.swift; sourceTree = ""; };
A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; };
A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; };
A586582C92491DF9C12D27E2 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PromiseKit.framework; sourceTree = ""; };
@@ -193,7 +191,6 @@
EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */,
19B65C66C97F082718DDD703 /* TypeHolderExample.swift */,
E5565A447062C7B8F695F451 /* User.swift */,
- A2253391845B73B8BA368049 /* XmlItem.swift */,
);
path = Models;
sourceTree = "";
@@ -312,6 +309,7 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
+ Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
@@ -383,7 +381,6 @@
FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */,
31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */,
64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */,
- 3EA765BDC5A11401D8A16536 /* XmlItem.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000000..919434a6254
--- /dev/null
+++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
similarity index 98%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
index e8ac84fa992..26d510552bb 100644
--- a/samples/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
+++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
similarity index 92%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
index 75dea243957..20007009680 100644
--- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
+++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
@@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value {
result[item.key] = "\(value)"
@@ -46,7 +46,7 @@ public struct APIHelper {
}
public static func mapValueToPathItem(_ source: Any) -> Any {
- if let collection = source as? Array {
+ if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
}
return source
@@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value {
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
similarity index 100%
rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift
rename to samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
diff --git a/samples/client/petstore/swift4/promisekit/README.md b/samples/client/petstore/swift4/promisekitLibrary/README.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/README.md
rename to samples/client/petstore/swift4/promisekitLibrary/README.md
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/.gitignore b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/.gitignore
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/.gitignore
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/.gitignore
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile
similarity index 73%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile
index 29843508b65..77432f9eee9 100644
--- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile
+++ b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile
@@ -1,5 +1,8 @@
+platform :ios, '9.0'
+
+source 'https://cdn.cocoapods.org/'
+
use_frameworks!
-source 'https://github.com/CocoaPods/Specs.git'
target 'SwaggerClient' do
pod "PetstoreClient", :path => "../"
diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile.lock
new file mode 100644
index 00000000000..a373110b37b
--- /dev/null
+++ b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile.lock
@@ -0,0 +1,27 @@
+PODS:
+ - Alamofire (4.9.0)
+ - PetstoreClient (1.0.0):
+ - Alamofire (~> 4.9.0)
+ - PromiseKit/CorePromise (~> 6.11.0)
+ - PromiseKit/CorePromise (6.11.0)
+
+DEPENDENCIES:
+ - PetstoreClient (from `../`)
+
+SPEC REPOS:
+ trunk:
+ - Alamofire
+ - PromiseKit
+
+EXTERNAL SOURCES:
+ PetstoreClient:
+ :path: "../"
+
+SPEC CHECKSUMS:
+ Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321
+ PetstoreClient: 57248512c92ab99e6079feab8d035215a58535c5
+ PromiseKit: e4863d06976e7dee5e41c04fc7371c16b3600292
+
+PODFILE CHECKSUM: 509bec696cc1d8641751b52e4fe4bef04ac4542c
+
+COCOAPODS: 1.8.4
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Info.plist
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Info.plist
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Info.plist
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
similarity index 86%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
index 22b2e7d605f..46fa30ba0ca 100644
--- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
+++ b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
@@ -31,10 +31,8 @@ class PetAPITests: XCTestCase {
let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")]
let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available)
- PetAPI.addPet(body: newPet).then {
+ PetAPI.addPet(body: newPet).done {
expectation.fulfill()
- }.always {
- // Noop for now
}.catch { _ in
XCTFail("error creating pet")
}
@@ -43,12 +41,10 @@ class PetAPITests: XCTestCase {
func test2GetPet() {
let expectation = self.expectation(description: "testGetPet")
- PetAPI.getPetById(petId: 1000).then { pet -> Void in
+ PetAPI.getPetById(petId: 1000).done { pet in
XCTAssert(pet.id == 1000, "invalid id")
XCTAssert(pet.name == "Fluffy", "invalid name")
expectation.fulfill()
- }.always {
- // Noop for now
}.catch { _ in
XCTFail("error creating pet")
}
@@ -57,10 +53,8 @@ class PetAPITests: XCTestCase {
func test3DeletePet() {
let expectation = self.expectation(description: "testDeletePet")
- PetAPI.deletePet(petId: 1000).then {
+ PetAPI.deletePet(petId: 1000).done {
expectation.fulfill()
- }.always {
- // Noop for now
}.catch { (_) in
XCTFail("error deleting pet")
}
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
similarity index 87%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
index abb09214717..13a57aca3e1 100644
--- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
+++ b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
@@ -22,7 +22,7 @@ class StoreAPITests: XCTestCase {
let shipDate = Date()
let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true)
let expectation = self.expectation(description: "testPlaceOrder")
- StoreAPI.placeOrder(body: order).then { order -> Void in
+ StoreAPI.placeOrder(body: order).done { order in
XCTAssert(order.id == 1000, "invalid id")
XCTAssert(order.quantity == 10, "invalid quantity")
XCTAssert(order.status == .placed, "invalid status")
@@ -30,8 +30,6 @@ class StoreAPITests: XCTestCase {
"Date should be idempotent")
expectation.fulfill()
- }.always {
- // Noop for now
}.catch { _ in
XCTFail("error placing order")
}
@@ -40,13 +38,11 @@ class StoreAPITests: XCTestCase {
func test2GetOrder() {
let expectation = self.expectation(description: "testGetOrder")
- StoreAPI.getOrderById(orderId: 1000).then { order -> Void in
+ StoreAPI.getOrderById(orderId: 1000).done { order in
XCTAssert(order.id == 1000, "invalid id")
XCTAssert(order.quantity == 10, "invalid quantity")
XCTAssert(order.status == .placed, "invalid status")
expectation.fulfill()
- }.always {
- // Noop for now
}.catch { _ in
XCTFail("error placing order")
}
@@ -55,10 +51,8 @@ class StoreAPITests: XCTestCase {
func test3DeleteOrder() {
let expectation = self.expectation(description: "testDeleteOrder")
- StoreAPI.deleteOrder(orderId: "1000").then {
+ StoreAPI.deleteOrder(orderId: "1000").done {
expectation.fulfill()
- }.always {
- // Noop for now
}.catch { (_) in
XCTFail("error deleting order")
}
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
similarity index 78%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
index 2fd0ff0fbb4..d369895def7 100644
--- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
+++ b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
@@ -17,11 +17,9 @@ class UserAPITests: XCTestCase {
func testLogin() {
let expectation = self.expectation(description: "testLogin")
- UserAPI.loginUser(username: "swiftTester", password: "swift").then { _ -> Void in
+ UserAPI.loginUser(username: "swiftTester", password: "swift").done { _ in
expectation.fulfill()
- }.always {
- // Noop for now
- }.catch { (_) in
+ }.catch { _ in
XCTFail("login error")
}
self.waitForExpectations(timeout: testTimeout, handler: nil)
@@ -29,11 +27,9 @@ class UserAPITests: XCTestCase {
func testLogout() {
let expectation = self.expectation(description: "testLogout")
- UserAPI.logoutUser().then {
+ UserAPI.logoutUser().done {
expectation.fulfill()
- }.always {
- // Noop for now
- }.catch { (_) in
+ }.catch { _ in
XCTFail("")
}
self.waitForExpectations(timeout: testTimeout, handler: nil)
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/pom.xml b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/pom.xml
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/pom.xml
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/pom.xml
diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh
similarity index 69%
rename from samples/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh
rename to samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh
index dce4932ae62..79520c7fc38 100755
--- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh
+++ b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh
@@ -1,3 +1,5 @@
#!/bin/sh
-xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]}
+pod install
+
+xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}
diff --git a/samples/client/petstore/swift4/promisekit/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/AdditionalPropertiesClass.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/AdditionalPropertiesClass.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/AdditionalPropertiesClass.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Animal.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Animal.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Animal.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Animal.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/AnimalFarm.md b/samples/client/petstore/swift4/promisekitLibrary/docs/AnimalFarm.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/AnimalFarm.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/AnimalFarm.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/AnotherFakeAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/AnotherFakeAPI.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/AnotherFakeAPI.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/ApiResponse.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ApiResponse.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/ApiResponse.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/ApiResponse.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfArrayOfNumberOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/ArrayOfArrayOfNumberOnly.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfArrayOfNumberOnly.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfNumberOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/ArrayOfNumberOnly.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfNumberOnly.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/ArrayTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayTest.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/ArrayTest.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/ArrayTest.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Capitalization.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Capitalization.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Capitalization.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Capitalization.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Cat.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Cat.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Cat.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Cat.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/CatAllOf.md b/samples/client/petstore/swift4/promisekitLibrary/docs/CatAllOf.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/CatAllOf.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/CatAllOf.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Category.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Category.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Category.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Category.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/ClassModel.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ClassModel.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/ClassModel.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/ClassModel.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Client.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Client.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Client.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Client.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Dog.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Dog.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Dog.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Dog.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/DogAllOf.md b/samples/client/petstore/swift4/promisekitLibrary/docs/DogAllOf.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/DogAllOf.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/DogAllOf.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/EnumArrays.md b/samples/client/petstore/swift4/promisekitLibrary/docs/EnumArrays.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/EnumArrays.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/EnumArrays.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/EnumClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/EnumClass.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/EnumClass.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/EnumClass.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/EnumTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/EnumTest.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/EnumTest.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/EnumTest.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/FakeAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FakeAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/FakeAPI.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/FakeAPI.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FakeClassnameTags123API.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/FakeClassnameTags123API.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/FakeClassnameTags123API.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/File.md b/samples/client/petstore/swift4/promisekitLibrary/docs/File.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/File.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/File.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FileSchemaTestClass.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/FileSchemaTestClass.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/FileSchemaTestClass.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/FormatTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FormatTest.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/FormatTest.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/FormatTest.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/HasOnlyReadOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/HasOnlyReadOnly.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/HasOnlyReadOnly.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/List.md b/samples/client/petstore/swift4/promisekitLibrary/docs/List.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/List.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/List.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/MapTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/MapTest.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/MapTest.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/MapTest.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/MixedPropertiesAndAdditionalPropertiesClass.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Model200Response.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Model200Response.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Model200Response.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Model200Response.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Name.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Name.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Name.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Name.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/NumberOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/NumberOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/NumberOnly.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/NumberOnly.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Order.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Order.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Order.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Order.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/OuterComposite.md b/samples/client/petstore/swift4/promisekitLibrary/docs/OuterComposite.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/OuterComposite.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/OuterComposite.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/OuterEnum.md b/samples/client/petstore/swift4/promisekitLibrary/docs/OuterEnum.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/OuterEnum.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/OuterEnum.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Pet.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Pet.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Pet.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Pet.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/PetAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/PetAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/PetAPI.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/PetAPI.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ReadOnlyFirst.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/ReadOnlyFirst.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/ReadOnlyFirst.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Return.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Return.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Return.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Return.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/SpecialModelName.md b/samples/client/petstore/swift4/promisekitLibrary/docs/SpecialModelName.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/SpecialModelName.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/SpecialModelName.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/StoreAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/StoreAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/StoreAPI.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/StoreAPI.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/StringBooleanMap.md b/samples/client/petstore/swift4/promisekitLibrary/docs/StringBooleanMap.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/StringBooleanMap.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/StringBooleanMap.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/Tag.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Tag.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/Tag.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/Tag.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderDefault.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/TypeHolderDefault.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderDefault.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/TypeHolderExample.md b/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderExample.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/TypeHolderExample.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderExample.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/User.md b/samples/client/petstore/swift4/promisekitLibrary/docs/User.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/User.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/User.md
diff --git a/samples/client/petstore/swift4/promisekit/docs/UserAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/UserAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/docs/UserAPI.md
rename to samples/client/petstore/swift4/promisekitLibrary/docs/UserAPI.md
diff --git a/samples/client/petstore/swift4/promisekit/git_push.sh b/samples/client/petstore/swift4/promisekitLibrary/git_push.sh
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/git_push.sh
rename to samples/client/petstore/swift4/promisekitLibrary/git_push.sh
diff --git a/samples/client/petstore/swift4/promisekitLibrary/pom.xml b/samples/client/petstore/swift4/promisekitLibrary/pom.xml
new file mode 100644
index 00000000000..5caba9cb463
--- /dev/null
+++ b/samples/client/petstore/swift4/promisekitLibrary/pom.xml
@@ -0,0 +1,43 @@
+
+ 4.0.0
+ io.swagger
+ Swift4PetstoreClientTests
+ pom
+ 1.0-SNAPSHOT
+ Swift4 Swagger Petstore Client
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ xcodebuild-test
+ integration-test
+
+ exec
+
+
+ ./run_spmbuild.sh
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/swift4/promisekit/project.yml b/samples/client/petstore/swift4/promisekitLibrary/project.yml
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/project.yml
rename to samples/client/petstore/swift4/promisekitLibrary/project.yml
diff --git a/samples/client/petstore/swift4/promisekitLibrary/run_spmbuild.sh b/samples/client/petstore/swift4/promisekitLibrary/run_spmbuild.sh
new file mode 100755
index 00000000000..1a9f585ad05
--- /dev/null
+++ b/samples/client/petstore/swift4/promisekitLibrary/run_spmbuild.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+swift build && exit ${PIPESTATUS[0]}
diff --git a/samples/client/petstore/swift4/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift4/rxswift/.openapi-generator/VERSION
deleted file mode 100644
index c3a2c7076fa..00000000000
--- a/samples/client/petstore/swift4/rxswift/.openapi-generator/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-4.2.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift
deleted file mode 100644
index 94295c495c5..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesAnyType.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesAnyType: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Any] = [:]
-
- public subscript(key: String) -> Any? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Any.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift
deleted file mode 100644
index cde9824ddb3..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesArray.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesArray: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Array] = [:]
-
- public subscript(key: String) -> Array? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Array.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift
deleted file mode 100644
index 76791a9ddd3..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesBoolean.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesBoolean: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Bool] = [:]
-
- public subscript(key: String) -> Bool? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift
deleted file mode 100644
index 4a0f2acaa41..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesInteger.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesInteger: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Int] = [:]
-
- public subscript(key: String) -> Int? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift
deleted file mode 100644
index 95e491000ab..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesNumber.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesNumber: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Double] = [:]
-
- public subscript(key: String) -> Double? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Double.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift
deleted file mode 100644
index f45888a4101..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesObject.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesObject: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Dictionary] = [:]
-
- public subscript(key: String) -> Dictionary? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Dictionary.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift
deleted file mode 100644
index 7af63cc7152..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesString.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesString: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: String] = [:]
-
- public subscript(key: String) -> String? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
deleted file mode 100644
index 3f1237fee47..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// StringBooleanMap.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct StringBooleanMap: Codable {
-
- public var additionalProperties: [String: Bool] = [:]
-
- public subscript(key: String) -> Bool? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- var nonAdditionalPropertyKeys = Set()
- additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift
deleted file mode 100644
index aa016683503..00000000000
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// XmlItem.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct XmlItem: Codable {
-
- public var attributeString: String?
- public var attributeNumber: Double?
- public var attributeInteger: Int?
- public var attributeBoolean: Bool?
- public var wrappedArray: [Int]?
- public var nameString: String?
- public var nameNumber: Double?
- public var nameInteger: Int?
- public var nameBoolean: Bool?
- public var nameArray: [Int]?
- public var nameWrappedArray: [Int]?
- public var prefixString: String?
- public var prefixNumber: Double?
- public var prefixInteger: Int?
- public var prefixBoolean: Bool?
- public var prefixArray: [Int]?
- public var prefixWrappedArray: [Int]?
- public var namespaceString: String?
- public var namespaceNumber: Double?
- public var namespaceInteger: Int?
- public var namespaceBoolean: Bool?
- public var namespaceArray: [Int]?
- public var namespaceWrappedArray: [Int]?
- public var prefixNsString: String?
- public var prefixNsNumber: Double?
- public var prefixNsInteger: Int?
- public var prefixNsBoolean: Bool?
- public var prefixNsArray: [Int]?
- public var prefixNsWrappedArray: [Int]?
-
- public init(attributeString: String?, attributeNumber: Double?, attributeInteger: Int?, attributeBoolean: Bool?, wrappedArray: [Int]?, nameString: String?, nameNumber: Double?, nameInteger: Int?, nameBoolean: Bool?, nameArray: [Int]?, nameWrappedArray: [Int]?, prefixString: String?, prefixNumber: Double?, prefixInteger: Int?, prefixBoolean: Bool?, prefixArray: [Int]?, prefixWrappedArray: [Int]?, namespaceString: String?, namespaceNumber: Double?, namespaceInteger: Int?, namespaceBoolean: Bool?, namespaceArray: [Int]?, namespaceWrappedArray: [Int]?, prefixNsString: String?, prefixNsNumber: Double?, prefixNsInteger: Int?, prefixNsBoolean: Bool?, prefixNsArray: [Int]?, prefixNsWrappedArray: [Int]?) {
- self.attributeString = attributeString
- self.attributeNumber = attributeNumber
- self.attributeInteger = attributeInteger
- self.attributeBoolean = attributeBoolean
- self.wrappedArray = wrappedArray
- self.nameString = nameString
- self.nameNumber = nameNumber
- self.nameInteger = nameInteger
- self.nameBoolean = nameBoolean
- self.nameArray = nameArray
- self.nameWrappedArray = nameWrappedArray
- self.prefixString = prefixString
- self.prefixNumber = prefixNumber
- self.prefixInteger = prefixInteger
- self.prefixBoolean = prefixBoolean
- self.prefixArray = prefixArray
- self.prefixWrappedArray = prefixWrappedArray
- self.namespaceString = namespaceString
- self.namespaceNumber = namespaceNumber
- self.namespaceInteger = namespaceInteger
- self.namespaceBoolean = namespaceBoolean
- self.namespaceArray = namespaceArray
- self.namespaceWrappedArray = namespaceWrappedArray
- self.prefixNsString = prefixNsString
- self.prefixNsNumber = prefixNsNumber
- self.prefixNsInteger = prefixNsInteger
- self.prefixNsBoolean = prefixNsBoolean
- self.prefixNsArray = prefixNsArray
- self.prefixNsWrappedArray = prefixNsWrappedArray
- }
-
- public enum CodingKeys: String, CodingKey {
- case attributeString = "attribute_string"
- case attributeNumber = "attribute_number"
- case attributeInteger = "attribute_integer"
- case attributeBoolean = "attribute_boolean"
- case wrappedArray = "wrapped_array"
- case nameString = "name_string"
- case nameNumber = "name_number"
- case nameInteger = "name_integer"
- case nameBoolean = "name_boolean"
- case nameArray = "name_array"
- case nameWrappedArray = "name_wrapped_array"
- case prefixString = "prefix_string"
- case prefixNumber = "prefix_number"
- case prefixInteger = "prefix_integer"
- case prefixBoolean = "prefix_boolean"
- case prefixArray = "prefix_array"
- case prefixWrappedArray = "prefix_wrapped_array"
- case namespaceString = "namespace_string"
- case namespaceNumber = "namespace_number"
- case namespaceInteger = "namespace_integer"
- case namespaceBoolean = "namespace_boolean"
- case namespaceArray = "namespace_array"
- case namespaceWrappedArray = "namespace_wrapped_array"
- case prefixNsString = "prefix_ns_string"
- case prefixNsNumber = "prefix_ns_number"
- case prefixNsInteger = "prefix_ns_integer"
- case prefixNsBoolean = "prefix_ns_boolean"
- case prefixNsArray = "prefix_ns_array"
- case prefixNsWrappedArray = "prefix_ns_wrapped_array"
- }
-
-}
diff --git a/samples/client/petstore/swift4/promisekit/.gitignore b/samples/client/petstore/swift4/rxswiftLibrary/.gitignore
similarity index 93%
rename from samples/client/petstore/swift4/promisekit/.gitignore
rename to samples/client/petstore/swift4/rxswiftLibrary/.gitignore
index fb589c9d53c..5e5d5cebcf4 100644
--- a/samples/client/petstore/swift4/promisekit/.gitignore
+++ b/samples/client/petstore/swift4/rxswiftLibrary/.gitignore
@@ -43,18 +43,18 @@ playground.xcworkspace
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
-Pods/
+# Pods/
-Carthage
+# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
-Carthage/Checkouts
+# Carthage/Checkouts
Carthage/Build
# fastlane
#
-# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
diff --git a/samples/client/petstore/swift4/promisekit/.openapi-generator-ignore b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator-ignore
similarity index 78%
rename from samples/client/petstore/swift4/promisekit/.openapi-generator-ignore
rename to samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator-ignore
index c5fa491b4c5..7484ee590a3 100644
--- a/samples/client/petstore/swift4/promisekit/.openapi-generator-ignore
+++ b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator-ignore
@@ -1,11 +1,11 @@
-# Swagger Codegen Ignore
-# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
-# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION
new file mode 100644
index 00000000000..e4955748d3e
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION
@@ -0,0 +1 @@
+4.2.2-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/rxswift/Cartfile b/samples/client/petstore/swift4/rxswiftLibrary/Cartfile
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/Cartfile
rename to samples/client/petstore/swift4/rxswiftLibrary/Cartfile
diff --git a/samples/client/petstore/swift4/rxswift/Info.plist b/samples/client/petstore/swift4/rxswiftLibrary/Info.plist
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/Info.plist
rename to samples/client/petstore/swift4/rxswiftLibrary/Info.plist
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/Package.resolved b/samples/client/petstore/swift4/rxswiftLibrary/Package.resolved
new file mode 100644
index 00000000000..41ab73313b8
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/Package.resolved
@@ -0,0 +1,25 @@
+{
+ "object": {
+ "pins": [
+ {
+ "package": "Alamofire",
+ "repositoryURL": "https://github.com/Alamofire/Alamofire.git",
+ "state": {
+ "branch": null,
+ "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
+ "version": "4.9.1"
+ }
+ },
+ {
+ "package": "RxSwift",
+ "repositoryURL": "https://github.com/ReactiveX/RxSwift.git",
+ "state": {
+ "branch": null,
+ "revision": "cce95dd704bc08cd3d69c087a05a6fc3118e2722",
+ "version": "4.5.0"
+ }
+ }
+ ]
+ },
+ "version": 1
+}
diff --git a/samples/client/petstore/swift4/rxswift/Package.swift b/samples/client/petstore/swift4/rxswiftLibrary/Package.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/Package.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/Package.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.podspec
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient.podspec
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.podspec
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj
similarity index 89%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.pbxproj
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj
index 36443e510a8..43e65668d5a 100644
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.pbxproj
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj
@@ -11,7 +11,6 @@
081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; };
0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; };
0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; };
- 1A3562EDD07FF7D64BCD7A59 /* AdditionalPropertiesObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72FEDC94BA0E37214D360871 /* AdditionalPropertiesObject.swift */; };
1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; };
22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; };
248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; };
@@ -23,13 +22,11 @@
34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; };
3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; };
37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; };
- 3EA765BDC5A11401D8A16536 /* XmlItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2253391845B73B8BA368049 /* XmlItem.swift */; };
40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; };
40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; };
418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; };
41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; };
45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; };
- 4884A65ABBA468278D2450FD /* AdditionalPropertiesString.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */; };
4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; };
4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; };
555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; };
@@ -38,13 +35,10 @@
64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; };
6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; };
6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; };
- 7244DA68425DE3B3727C1990 /* AdditionalPropertiesNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0512B3582586B4C0C598D5 /* AdditionalPropertiesNumber.swift */; };
72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; };
72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; };
7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; };
7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; };
- 7F7BE063B514EF4A90D75B7F /* AdditionalPropertiesInteger.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA2F3566156A4ABC465F201B /* AdditionalPropertiesInteger.swift */; };
- 83BBA452D761D61542F297CC /* AdditionalPropertiesArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FEE553331890581C2FF366F /* AdditionalPropertiesArray.swift */; };
86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; };
914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; };
922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; };
@@ -55,7 +49,6 @@
A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; };
A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; };
A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; };
- AB3B26F5E373BC8C0A0A617E /* AdditionalPropertiesAnyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5AB1037D937AADF8B4A70C9 /* AdditionalPropertiesAnyType.swift */; };
ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; };
AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; };
B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; };
@@ -70,17 +63,14 @@
DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; };
E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; };
EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; };
- EF35D2C67E3BC377DDCC99CB /* AdditionalPropertiesBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC24C01A55F644957196F9F /* AdditionalPropertiesBoolean.swift */; };
FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; };
- 0CC24C01A55F644957196F9F /* AdditionalPropertiesBoolean.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesBoolean.swift; sourceTree = ""; };
10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; };
164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; };
- 1E0512B3582586B4C0C598D5 /* AdditionalPropertiesNumber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesNumber.swift; sourceTree = ""; };
212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; };
27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; };
28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; };
@@ -96,13 +86,11 @@
4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; };
4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; };
4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; };
- 4FEE553331890581C2FF366F /* AdditionalPropertiesArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesArray.swift; sourceTree = ""; };
5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; };
69DB3E1D94EB0566C0052331 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxSwift.framework; sourceTree = ""; };
6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; };
6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; };
6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; };
- 72FEDC94BA0E37214D360871 /* AdditionalPropertiesObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesObject.swift; sourceTree = ""; };
7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; };
7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; };
7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; };
@@ -118,7 +106,6 @@
9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; };
9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; };
A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; };
- A2253391845B73B8BA368049 /* XmlItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XmlItem.swift; sourceTree = ""; };
A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; };
A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; };
A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; };
@@ -137,10 +124,7 @@
ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; };
F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; };
F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; };
- F5AB1037D937AADF8B4A70C9 /* AdditionalPropertiesAnyType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesAnyType.swift; sourceTree = ""; };
- FA2F3566156A4ABC465F201B /* AdditionalPropertiesInteger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesInteger.swift; sourceTree = ""; };
FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; };
- FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesString.swift; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -167,14 +151,7 @@
4FBDCF1330A9AB9122780DB3 /* Models */ = {
isa = PBXGroup;
children = (
- F5AB1037D937AADF8B4A70C9 /* AdditionalPropertiesAnyType.swift */,
- 4FEE553331890581C2FF366F /* AdditionalPropertiesArray.swift */,
- 0CC24C01A55F644957196F9F /* AdditionalPropertiesBoolean.swift */,
396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */,
- FA2F3566156A4ABC465F201B /* AdditionalPropertiesInteger.swift */,
- 1E0512B3582586B4C0C598D5 /* AdditionalPropertiesNumber.swift */,
- 72FEDC94BA0E37214D360871 /* AdditionalPropertiesObject.swift */,
- FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */,
95568E7C35F119EB4A12B498 /* Animal.swift */,
8D22BE01748F51106DE02332 /* AnimalFarm.swift */,
A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */,
@@ -214,7 +191,6 @@
EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */,
19B65C66C97F082718DDD703 /* TypeHolderExample.swift */,
E5565A447062C7B8F695F451 /* User.swift */,
- A2253391845B73B8BA368049 /* XmlItem.swift */,
);
path = Models;
sourceTree = "";
@@ -333,6 +309,7 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
+ Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
@@ -351,14 +328,7 @@
files = (
1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */,
40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */,
- AB3B26F5E373BC8C0A0A617E /* AdditionalPropertiesAnyType.swift in Sources */,
- 83BBA452D761D61542F297CC /* AdditionalPropertiesArray.swift in Sources */,
- EF35D2C67E3BC377DDCC99CB /* AdditionalPropertiesBoolean.swift in Sources */,
248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */,
- 7F7BE063B514EF4A90D75B7F /* AdditionalPropertiesInteger.swift in Sources */,
- 7244DA68425DE3B3727C1990 /* AdditionalPropertiesNumber.swift in Sources */,
- 1A3562EDD07FF7D64BCD7A59 /* AdditionalPropertiesObject.swift in Sources */,
- 4884A65ABBA468278D2450FD /* AdditionalPropertiesString.swift in Sources */,
40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */,
2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */,
45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */,
@@ -411,7 +381,6 @@
FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */,
31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */,
64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */,
- 3EA765BDC5A11401D8A16536 /* XmlItem.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000000..919434a6254
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
similarity index 98%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
index e8ac84fa992..26d510552bb 100644
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
similarity index 92%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
index 75dea243957..20007009680 100644
--- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
@@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value {
result[item.key] = "\(value)"
@@ -46,7 +46,7 @@ public struct APIHelper {
}
public static func mapValueToPathItem(_ source: Any) -> Any {
- if let collection = source as? Array {
+ if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
}
return source
@@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value {
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
similarity index 100%
rename from samples/client/test/swift4/default/TestClient/Classes/Swaggers/JSONEncodableEncoding.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/JSONEncodingHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
similarity index 100%
rename from samples/client/test/swift4/default/TestClient/Classes/Swaggers/JSONEncodingHelper.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
new file mode 100644
index 00000000000..5ed9f31e2a3
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift
@@ -0,0 +1,20 @@
+//
+// Animal.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Animal: Codable {
+
+ public var className: String
+ public var color: String? = "red"
+
+ public init(className: String, color: String?) {
+ self.className = className
+ self.color = color
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
similarity index 50%
rename from samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
index a603717abe6..ec270da8907 100644
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
@@ -1,5 +1,5 @@
//
-// ErrorInfo.swift
+// ApiResponse.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
@@ -7,18 +7,16 @@
import Foundation
-/** Example Error object */
-
-public struct ErrorInfo: Codable {
+public struct ApiResponse: Codable {
public var code: Int?
+ public var type: String?
public var message: String?
- public var details: [String]?
- public init(code: Int?, message: String?, details: [String]?) {
+ public init(code: Int?, type: String?, message: String?) {
self.code = code
+ self.type = type
self.message = message
- self.details = details
}
}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
new file mode 100644
index 00000000000..3843287630b
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift
@@ -0,0 +1,22 @@
+//
+// ArrayOfArrayOfNumberOnly.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct ArrayOfArrayOfNumberOnly: Codable {
+
+ public var arrayArrayNumber: [[Double]]?
+
+ public init(arrayArrayNumber: [[Double]]?) {
+ self.arrayArrayNumber = arrayArrayNumber
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case arrayArrayNumber = "ArrayArrayNumber"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
new file mode 100644
index 00000000000..f8b198e81f5
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift
@@ -0,0 +1,22 @@
+//
+// ArrayOfNumberOnly.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct ArrayOfNumberOnly: Codable {
+
+ public var arrayNumber: [Double]?
+
+ public init(arrayNumber: [Double]?) {
+ self.arrayNumber = arrayNumber
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case arrayNumber = "ArrayNumber"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
new file mode 100644
index 00000000000..67f7f7e5151
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift
@@ -0,0 +1,28 @@
+//
+// ArrayTest.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct ArrayTest: Codable {
+
+ public var arrayOfString: [String]?
+ public var arrayArrayOfInteger: [[Int64]]?
+ public var arrayArrayOfModel: [[ReadOnlyFirst]]?
+
+ public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) {
+ self.arrayOfString = arrayOfString
+ self.arrayArrayOfInteger = arrayArrayOfInteger
+ self.arrayArrayOfModel = arrayArrayOfModel
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case arrayOfString = "array_of_string"
+ case arrayArrayOfInteger = "array_array_of_integer"
+ case arrayArrayOfModel = "array_array_of_model"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
new file mode 100644
index 00000000000..d576b50b1c9
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift
@@ -0,0 +1,38 @@
+//
+// Capitalization.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Capitalization: Codable {
+
+ public var smallCamel: String?
+ public var capitalCamel: String?
+ public var smallSnake: String?
+ public var capitalSnake: String?
+ public var sCAETHFlowPoints: String?
+ /** Name of the pet */
+ public var ATT_NAME: String?
+
+ public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) {
+ self.smallCamel = smallCamel
+ self.capitalCamel = capitalCamel
+ self.smallSnake = smallSnake
+ self.capitalSnake = capitalSnake
+ self.sCAETHFlowPoints = sCAETHFlowPoints
+ self.ATT_NAME = ATT_NAME
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case smallCamel
+ case capitalCamel = "CapitalCamel"
+ case smallSnake = "small_Snake"
+ case capitalSnake = "Capital_Snake"
+ case sCAETHFlowPoints = "SCA_ETH_Flow_Points"
+ case ATT_NAME
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
new file mode 100644
index 00000000000..7ab887f3113
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift
@@ -0,0 +1,22 @@
+//
+// Cat.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Cat: Codable {
+
+ public var className: String
+ public var color: String? = "red"
+ public var declawed: Bool?
+
+ public init(className: String, color: String?, declawed: Bool?) {
+ self.className = className
+ self.color = color
+ self.declawed = declawed
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
new file mode 100644
index 00000000000..28cb30ce7b4
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift
@@ -0,0 +1,20 @@
+//
+// ClassModel.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+/** Model for testing model with \"_class\" property */
+
+public struct ClassModel: Codable {
+
+ public var _class: String?
+
+ public init(_class: String?) {
+ self._class = _class
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
new file mode 100644
index 00000000000..00245ca3728
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift
@@ -0,0 +1,18 @@
+//
+// Client.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Client: Codable {
+
+ public var client: String?
+
+ public init(client: String?) {
+ self.client = client
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
new file mode 100644
index 00000000000..492c1228008
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift
@@ -0,0 +1,22 @@
+//
+// Dog.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct Dog: Codable {
+
+ public var className: String
+ public var color: String? = "red"
+ public var breed: String?
+
+ public init(className: String, color: String?, breed: String?) {
+ self.className = className
+ self.color = color
+ self.breed = breed
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
new file mode 100644
index 00000000000..5034ff0b8c6
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift
@@ -0,0 +1,33 @@
+//
+// EnumArrays.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct EnumArrays: Codable {
+
+ public enum JustSymbol: String, Codable {
+ case greaterThanOrEqualTo = ">="
+ case dollar = "$"
+ }
+ public enum ArrayEnum: String, Codable {
+ case fish = "fish"
+ case crab = "crab"
+ }
+ public var justSymbol: JustSymbol?
+ public var arrayEnum: [ArrayEnum]?
+
+ public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) {
+ self.justSymbol = justSymbol
+ self.arrayEnum = arrayEnum
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case justSymbol = "just_symbol"
+ case arrayEnum = "array_enum"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
new file mode 100644
index 00000000000..3c1dfcac577
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift
@@ -0,0 +1,14 @@
+//
+// EnumClass.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public enum EnumClass: String, Codable {
+ case abc = "_abc"
+ case efg = "-efg"
+ case xyz = "(xyz)"
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
new file mode 100644
index 00000000000..6db9b34d183
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift
@@ -0,0 +1,52 @@
+//
+// EnumTest.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct EnumTest: Codable {
+
+ public enum EnumString: String, Codable {
+ case upper = "UPPER"
+ case lower = "lower"
+ case empty = ""
+ }
+ public enum EnumStringRequired: String, Codable {
+ case upper = "UPPER"
+ case lower = "lower"
+ case empty = ""
+ }
+ public enum EnumInteger: Int, Codable {
+ case _1 = 1
+ case number1 = -1
+ }
+ public enum EnumNumber: Double, Codable {
+ case _11 = 1.1
+ case number12 = -1.2
+ }
+ public var enumString: EnumString?
+ public var enumStringRequired: EnumStringRequired
+ public var enumInteger: EnumInteger?
+ public var enumNumber: EnumNumber?
+ public var outerEnum: OuterEnum?
+
+ public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) {
+ self.enumString = enumString
+ self.enumStringRequired = enumStringRequired
+ self.enumInteger = enumInteger
+ self.enumNumber = enumNumber
+ self.outerEnum = outerEnum
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case enumString = "enum_string"
+ case enumStringRequired = "enum_string_required"
+ case enumInteger = "enum_integer"
+ case enumNumber = "enum_number"
+ case outerEnum
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
new file mode 100644
index 00000000000..20bd6d103b3
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
@@ -0,0 +1,42 @@
+//
+// FormatTest.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct FormatTest: Codable {
+
+ public var integer: Int?
+ public var int32: Int?
+ public var int64: Int64?
+ public var number: Double
+ public var float: Float?
+ public var double: Double?
+ public var string: String?
+ public var byte: Data
+ public var binary: URL?
+ public var date: Date
+ public var dateTime: Date?
+ public var uuid: UUID?
+ public var password: String
+
+ public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) {
+ self.integer = integer
+ self.int32 = int32
+ self.int64 = int64
+ self.number = number
+ self.float = float
+ self.double = double
+ self.string = string
+ self.byte = byte
+ self.binary = binary
+ self.date = date
+ self.dateTime = dateTime
+ self.uuid = uuid
+ self.password = password
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
new file mode 100644
index 00000000000..906ddb06fb1
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift
@@ -0,0 +1,20 @@
+//
+// HasOnlyReadOnly.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct HasOnlyReadOnly: Codable {
+
+ public var bar: String?
+ public var foo: String?
+
+ public init(bar: String?, foo: String?) {
+ self.bar = bar
+ self.foo = foo
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift
new file mode 100644
index 00000000000..08d59953873
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift
@@ -0,0 +1,22 @@
+//
+// List.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct List: Codable {
+
+ public var _123list: String?
+
+ public init(_123list: String?) {
+ self._123list = _123list
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case _123list = "123-list"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
new file mode 100644
index 00000000000..c3deb2f2893
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift
@@ -0,0 +1,22 @@
+//
+// MixedPropertiesAndAdditionalPropertiesClass.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct MixedPropertiesAndAdditionalPropertiesClass: Codable {
+
+ public var uuid: UUID?
+ public var dateTime: Date?
+ public var map: [String: Animal]?
+
+ public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) {
+ self.uuid = uuid
+ self.dateTime = dateTime
+ self.map = map
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
new file mode 100644
index 00000000000..7ed6aad907b
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
@@ -0,0 +1,27 @@
+//
+// Model200Response.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+/** Model for testing model name starting with number */
+
+public struct Model200Response: Codable {
+
+ public var name: Int?
+ public var _class: String?
+
+ public init(name: Int?, _class: String?) {
+ self.name = name
+ self._class = _class
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case name
+ case _class = "class"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
new file mode 100644
index 00000000000..ce9ffe4fb38
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
@@ -0,0 +1,33 @@
+//
+// Name.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+/** Model for testing model name same as property name */
+
+public struct Name: Codable {
+
+ public var name: Int
+ public var snakeCase: Int?
+ public var property: String?
+ public var _123number: Int?
+
+ public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) {
+ self.name = name
+ self.snakeCase = snakeCase
+ self.property = property
+ self._123number = _123number
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case name
+ case snakeCase = "snake_case"
+ case property
+ case _123number = "123Number"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
new file mode 100644
index 00000000000..abd2269e8e7
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift
@@ -0,0 +1,22 @@
+//
+// NumberOnly.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct NumberOnly: Codable {
+
+ public var justNumber: Double?
+
+ public init(justNumber: Double?) {
+ self.justNumber = justNumber
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case justNumber = "JustNumber"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
new file mode 100644
index 00000000000..49aec001c5d
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift
@@ -0,0 +1,28 @@
+//
+// OuterComposite.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct OuterComposite: Codable {
+
+ public var myNumber: Double?
+ public var myString: String?
+ public var myBoolean: Bool?
+
+ public init(myNumber: Double?, myString: String?, myBoolean: Bool?) {
+ self.myNumber = myNumber
+ self.myString = myString
+ self.myBoolean = myBoolean
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case myNumber = "my_number"
+ case myString = "my_string"
+ case myBoolean = "my_boolean"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
new file mode 100644
index 00000000000..9f80fc95ecf
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift
@@ -0,0 +1,14 @@
+//
+// OuterEnum.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public enum OuterEnum: String, Codable {
+ case placed = "placed"
+ case approved = "approved"
+ case delivered = "delivered"
+}
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
new file mode 100644
index 00000000000..0acd21fd100
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift
@@ -0,0 +1,20 @@
+//
+// ReadOnlyFirst.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct ReadOnlyFirst: Codable {
+
+ public var bar: String?
+ public var baz: String?
+
+ public init(bar: String?, baz: String?) {
+ self.bar = bar
+ self.baz = baz
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
new file mode 100644
index 00000000000..076082af842
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
@@ -0,0 +1,24 @@
+//
+// Return.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+/** Model for testing reserved words */
+
+public struct Return: Codable {
+
+ public var _return: Int?
+
+ public init(_return: Int?) {
+ self._return = _return
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case _return = "return"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
new file mode 100644
index 00000000000..e79fc45c0e9
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift
@@ -0,0 +1,22 @@
+//
+// SpecialModelName.swift
+//
+// Generated by openapi-generator
+// https://openapi-generator.tech
+//
+
+import Foundation
+
+public struct SpecialModelName: Codable {
+
+ public var specialPropertyName: Int64?
+
+ public init(specialPropertyName: Int64?) {
+ self.specialPropertyName = specialPropertyName
+ }
+
+ public enum CodingKeys: String, CodingKey {
+ case specialPropertyName = "$special[property.name]"
+ }
+
+}
diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
similarity index 100%
rename from samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift
diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
diff --git a/samples/client/petstore/swift4/rxswift/README.md b/samples/client/petstore/swift4/rxswiftLibrary/README.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/README.md
rename to samples/client/petstore/swift4/rxswiftLibrary/README.md
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/.gitignore b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/.gitignore
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/.gitignore
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/.gitignore
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile
similarity index 73%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile
index 29843508b65..77432f9eee9 100644
--- a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile
+++ b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile
@@ -1,5 +1,8 @@
+platform :ios, '9.0'
+
+source 'https://cdn.cocoapods.org/'
+
use_frameworks!
-source 'https://github.com/CocoaPods/Specs.git'
target 'SwaggerClient' do
pod "PetstoreClient", :path => "../"
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile.lock
similarity index 64%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile.lock
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile.lock
index d96d208dcb2..24d2716656c 100644
--- a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile.lock
+++ b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile.lock
@@ -2,14 +2,14 @@ PODS:
- Alamofire (4.9.0)
- PetstoreClient (1.0.0):
- Alamofire (~> 4.9.0)
- - RxSwift (~> 4.0)
+ - RxSwift (~> 4.5.0)
- RxSwift (4.5.0)
DEPENDENCIES:
- PetstoreClient (from `../`)
SPEC REPOS:
- https://github.com/CocoaPods/Specs.git:
+ trunk:
- Alamofire
- RxSwift
@@ -19,9 +19,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321
- PetstoreClient: 432f1430feb6f893260645040aa967411fea06d9
+ PetstoreClient: c8065402040b3f3604ff959e729637f863227d27
RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575
-PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d
+PODFILE CHECKSUM: 509bec696cc1d8641751b52e4fe4bef04ac4542c
-COCOAPODS: 1.8.0.beta.2
+COCOAPODS: 1.8.4
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Info.plist
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/Info.plist
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Info.plist
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/pom.xml b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/pom.xml
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/pom.xml
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/pom.xml
diff --git a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh
similarity index 69%
rename from samples/client/petstore/swift4/rxswift/SwaggerClientTests/run_xcodebuild.sh
rename to samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh
index dce4932ae62..79520c7fc38 100755
--- a/samples/client/petstore/swift4/rxswift/SwaggerClientTests/run_xcodebuild.sh
+++ b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh
@@ -1,3 +1,5 @@
#!/bin/sh
-xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]}
+pod install
+
+xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}
diff --git a/samples/client/petstore/swift4/rxswift/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/AdditionalPropertiesClass.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/AdditionalPropertiesClass.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/AdditionalPropertiesClass.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Animal.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Animal.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Animal.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Animal.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/AnimalFarm.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/AnimalFarm.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/AnimalFarm.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/AnimalFarm.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/AnotherFakeAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/AnotherFakeAPI.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/AnotherFakeAPI.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/ApiResponse.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ApiResponse.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/ApiResponse.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/ApiResponse.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfArrayOfNumberOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/ArrayOfArrayOfNumberOnly.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfArrayOfNumberOnly.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfNumberOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/ArrayOfNumberOnly.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfNumberOnly.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/ArrayTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayTest.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/ArrayTest.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayTest.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Capitalization.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Capitalization.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Capitalization.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Capitalization.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Cat.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Cat.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Cat.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Cat.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/CatAllOf.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/CatAllOf.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/CatAllOf.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/CatAllOf.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Category.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Category.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Category.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Category.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/ClassModel.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ClassModel.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/ClassModel.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/ClassModel.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Client.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Client.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Client.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Client.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Dog.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Dog.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Dog.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Dog.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/DogAllOf.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/DogAllOf.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/DogAllOf.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/DogAllOf.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/EnumArrays.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumArrays.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/EnumArrays.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/EnumArrays.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/EnumClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumClass.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/EnumClass.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/EnumClass.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/EnumTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumTest.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/EnumTest.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/EnumTest.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/FakeAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/FakeAPI.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/FakeAPI.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeClassnameTags123API.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/FakeClassnameTags123API.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/FakeClassnameTags123API.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/File.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/File.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/File.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/File.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FileSchemaTestClass.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/FileSchemaTestClass.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/FileSchemaTestClass.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/FormatTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FormatTest.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/FormatTest.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/FormatTest.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/HasOnlyReadOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/HasOnlyReadOnly.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/HasOnlyReadOnly.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/List.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/List.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/List.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/List.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/MapTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/MapTest.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/MapTest.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/MapTest.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/MixedPropertiesAndAdditionalPropertiesClass.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Model200Response.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Model200Response.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Model200Response.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Model200Response.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Name.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Name.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Name.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Name.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/NumberOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/NumberOnly.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/NumberOnly.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/NumberOnly.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Order.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Order.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Order.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Order.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/OuterComposite.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterComposite.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/OuterComposite.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/OuterComposite.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/OuterEnum.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterEnum.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/OuterEnum.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/OuterEnum.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Pet.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Pet.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Pet.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Pet.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/PetAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/PetAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/PetAPI.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/PetAPI.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ReadOnlyFirst.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/ReadOnlyFirst.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/ReadOnlyFirst.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Return.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Return.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Return.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Return.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/SpecialModelName.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/SpecialModelName.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/SpecialModelName.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/SpecialModelName.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/StoreAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/StoreAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/StoreAPI.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/StoreAPI.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/StringBooleanMap.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/StringBooleanMap.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/StringBooleanMap.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/StringBooleanMap.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/Tag.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Tag.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/Tag.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/Tag.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderDefault.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/TypeHolderDefault.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderDefault.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/TypeHolderExample.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderExample.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/TypeHolderExample.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderExample.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/User.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/User.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/User.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/User.md
diff --git a/samples/client/petstore/swift4/rxswift/docs/UserAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/UserAPI.md
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/docs/UserAPI.md
rename to samples/client/petstore/swift4/rxswiftLibrary/docs/UserAPI.md
diff --git a/samples/client/petstore/swift4/rxswift/git_push.sh b/samples/client/petstore/swift4/rxswiftLibrary/git_push.sh
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/git_push.sh
rename to samples/client/petstore/swift4/rxswiftLibrary/git_push.sh
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/pom.xml b/samples/client/petstore/swift4/rxswiftLibrary/pom.xml
new file mode 100644
index 00000000000..5caba9cb463
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/pom.xml
@@ -0,0 +1,43 @@
+
+ 4.0.0
+ io.swagger
+ Swift4PetstoreClientTests
+ pom
+ 1.0-SNAPSHOT
+ Swift4 Swagger Petstore Client
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ xcodebuild-test
+ integration-test
+
+ exec
+
+
+ ./run_spmbuild.sh
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/swift4/rxswift/project.yml b/samples/client/petstore/swift4/rxswiftLibrary/project.yml
similarity index 100%
rename from samples/client/petstore/swift4/rxswift/project.yml
rename to samples/client/petstore/swift4/rxswiftLibrary/project.yml
diff --git a/samples/client/petstore/swift4/rxswiftLibrary/run_spmbuild.sh b/samples/client/petstore/swift4/rxswiftLibrary/run_spmbuild.sh
new file mode 100755
index 00000000000..1a9f585ad05
--- /dev/null
+++ b/samples/client/petstore/swift4/rxswiftLibrary/run_spmbuild.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+swift build && exit ${PIPESTATUS[0]}
diff --git a/samples/client/petstore/swift4/swift4_test_all.sh b/samples/client/petstore/swift4/swift4_test_all.sh
index e6b05fdbf33..0b5f7a1a778 100644
--- a/samples/client/petstore/swift4/swift4_test_all.sh
+++ b/samples/client/petstore/swift4/swift4_test_all.sh
@@ -2,6 +2,14 @@
set -e
+# example project with unit tests
mvn -f default/SwaggerClientTests/pom.xml integration-test
-mvn -f promisekit/SwaggerClientTests/pom.xml integration-test
-mvn -f rxswift/SwaggerClientTests/pom.xml integration-test
+mvn -f promisekitLibrary/SwaggerClientTests/pom.xml integration-test
+mvn -f rxswiftLibrary/SwaggerClientTests/pom.xml integration-test
+
+# spm build
+mvn -f default/pom.xml integration-test
+# mvn -f objcCompatible/pom.xml integration-test
+mvn -f promisekitLibrary/pom.xml integration-test
+mvn -f rxswiftLibrary/pom.xml integration-test
+mvn -f unwrapRequired/pom.xml integration-test
diff --git a/samples/client/petstore/swift4/unwrapRequired/.gitignore b/samples/client/petstore/swift4/unwrapRequired/.gitignore
index a94a6b00b35..5e5d5cebcf4 100644
--- a/samples/client/petstore/swift4/unwrapRequired/.gitignore
+++ b/samples/client/petstore/swift4/unwrapRequired/.gitignore
@@ -43,7 +43,7 @@ playground.xcworkspace
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
-Pods/
+# Pods/
# Carthage
#
@@ -54,7 +54,7 @@ Carthage/Build
# fastlane
#
-# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
diff --git a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION
index c3a2c7076fa..e4955748d3e 100644
--- a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION
+++ b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION
@@ -1 +1 @@
-4.2.0-SNAPSHOT
\ No newline at end of file
+4.2.2-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/swift4/unwrapRequired/Package.resolved b/samples/client/petstore/swift4/unwrapRequired/Package.resolved
new file mode 100644
index 00000000000..ca6137050eb
--- /dev/null
+++ b/samples/client/petstore/swift4/unwrapRequired/Package.resolved
@@ -0,0 +1,16 @@
+{
+ "object": {
+ "pins": [
+ {
+ "package": "Alamofire",
+ "repositoryURL": "https://github.com/Alamofire/Alamofire.git",
+ "state": {
+ "branch": null,
+ "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
+ "version": "4.9.1"
+ }
+ }
+ ]
+ },
+ "version": 1
+}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj
index b9d30943d8f..b606fe1ab10 100644
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj
+++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj
@@ -11,7 +11,6 @@
081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; };
0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; };
0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; };
- 1A3562EDD07FF7D64BCD7A59 /* AdditionalPropertiesObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72FEDC94BA0E37214D360871 /* AdditionalPropertiesObject.swift */; };
1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; };
22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; };
248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; };
@@ -23,13 +22,11 @@
34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; };
3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; };
37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; };
- 3EA765BDC5A11401D8A16536 /* XmlItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2253391845B73B8BA368049 /* XmlItem.swift */; };
40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; };
40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; };
418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; };
41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; };
45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; };
- 4884A65ABBA468278D2450FD /* AdditionalPropertiesString.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */; };
4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; };
4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; };
555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; };
@@ -38,13 +35,10 @@
64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; };
6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; };
6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; };
- 7244DA68425DE3B3727C1990 /* AdditionalPropertiesNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0512B3582586B4C0C598D5 /* AdditionalPropertiesNumber.swift */; };
72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; };
72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; };
7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; };
7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; };
- 7F7BE063B514EF4A90D75B7F /* AdditionalPropertiesInteger.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA2F3566156A4ABC465F201B /* AdditionalPropertiesInteger.swift */; };
- 83BBA452D761D61542F297CC /* AdditionalPropertiesArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FEE553331890581C2FF366F /* AdditionalPropertiesArray.swift */; };
86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; };
914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; };
922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; };
@@ -55,7 +49,6 @@
A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; };
A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; };
A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; };
- AB3B26F5E373BC8C0A0A617E /* AdditionalPropertiesAnyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5AB1037D937AADF8B4A70C9 /* AdditionalPropertiesAnyType.swift */; };
ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; };
AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; };
B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; };
@@ -69,17 +62,14 @@
DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; };
E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; };
EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; };
- EF35D2C67E3BC377DDCC99CB /* AdditionalPropertiesBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC24C01A55F644957196F9F /* AdditionalPropertiesBoolean.swift */; };
FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; };
- 0CC24C01A55F644957196F9F /* AdditionalPropertiesBoolean.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesBoolean.swift; sourceTree = ""; };
10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; };
164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; };
- 1E0512B3582586B4C0C598D5 /* AdditionalPropertiesNumber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesNumber.swift; sourceTree = ""; };
212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; };
27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; };
28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; };
@@ -95,12 +85,10 @@
4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; };
4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; };
4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; };
- 4FEE553331890581C2FF366F /* AdditionalPropertiesArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesArray.swift; sourceTree = ""; };
5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; };
6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; };
6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; };
6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; };
- 72FEDC94BA0E37214D360871 /* AdditionalPropertiesObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesObject.swift; sourceTree = ""; };
7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; };
7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; };
7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; };
@@ -116,7 +104,6 @@
9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; };
9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; };
A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; };
- A2253391845B73B8BA368049 /* XmlItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XmlItem.swift; sourceTree = ""; };
A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; };
A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; };
A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; };
@@ -135,10 +122,7 @@
ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; };
F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; };
F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; };
- F5AB1037D937AADF8B4A70C9 /* AdditionalPropertiesAnyType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesAnyType.swift; sourceTree = ""; };
- FA2F3566156A4ABC465F201B /* AdditionalPropertiesInteger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesInteger.swift; sourceTree = ""; };
FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; };
- FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesString.swift; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -164,14 +148,7 @@
4FBDCF1330A9AB9122780DB3 /* Models */ = {
isa = PBXGroup;
children = (
- F5AB1037D937AADF8B4A70C9 /* AdditionalPropertiesAnyType.swift */,
- 4FEE553331890581C2FF366F /* AdditionalPropertiesArray.swift */,
- 0CC24C01A55F644957196F9F /* AdditionalPropertiesBoolean.swift */,
396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */,
- FA2F3566156A4ABC465F201B /* AdditionalPropertiesInteger.swift */,
- 1E0512B3582586B4C0C598D5 /* AdditionalPropertiesNumber.swift */,
- 72FEDC94BA0E37214D360871 /* AdditionalPropertiesObject.swift */,
- FFE215C1B526E0418ED301B1 /* AdditionalPropertiesString.swift */,
95568E7C35F119EB4A12B498 /* Animal.swift */,
8D22BE01748F51106DE02332 /* AnimalFarm.swift */,
A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */,
@@ -211,7 +188,6 @@
EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */,
19B65C66C97F082718DDD703 /* TypeHolderExample.swift */,
E5565A447062C7B8F695F451 /* User.swift */,
- A2253391845B73B8BA368049 /* XmlItem.swift */,
);
path = Models;
sourceTree = "";
@@ -329,6 +305,7 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
+ Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
@@ -347,14 +324,7 @@
files = (
1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */,
40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */,
- AB3B26F5E373BC8C0A0A617E /* AdditionalPropertiesAnyType.swift in Sources */,
- 83BBA452D761D61542F297CC /* AdditionalPropertiesArray.swift in Sources */,
- EF35D2C67E3BC377DDCC99CB /* AdditionalPropertiesBoolean.swift in Sources */,
248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */,
- 7F7BE063B514EF4A90D75B7F /* AdditionalPropertiesInteger.swift in Sources */,
- 7244DA68425DE3B3727C1990 /* AdditionalPropertiesNumber.swift in Sources */,
- 1A3562EDD07FF7D64BCD7A59 /* AdditionalPropertiesObject.swift in Sources */,
- 4884A65ABBA468278D2450FD /* AdditionalPropertiesString.swift in Sources */,
40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */,
2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */,
45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */,
@@ -407,7 +377,6 @@
FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */,
31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */,
64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */,
- 3EA765BDC5A11401D8A16536 /* XmlItem.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
index e8ac84fa992..26d510552bb 100644
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
+++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
index 75dea243957..20007009680 100644
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
+++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift
@@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value {
result[item.key] = "\(value)"
@@ -46,7 +46,7 @@ public struct APIHelper {
}
public static func mapValueToPathItem(_ source: Any) -> Any {
- if let collection = source as? Array {
+ if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
}
return source
@@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value {
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift
deleted file mode 100644
index 94295c495c5..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesAnyType.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesAnyType: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Any] = [:]
-
- public subscript(key: String) -> Any? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Any.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift
deleted file mode 100644
index cde9824ddb3..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesArray.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesArray: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Array] = [:]
-
- public subscript(key: String) -> Array? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Array.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift
deleted file mode 100644
index 76791a9ddd3..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesBoolean.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesBoolean: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Bool] = [:]
-
- public subscript(key: String) -> Bool? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift
deleted file mode 100644
index 4a0f2acaa41..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesInteger.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesInteger: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Int] = [:]
-
- public subscript(key: String) -> Int? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift
deleted file mode 100644
index 95e491000ab..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesNumber.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesNumber: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Double] = [:]
-
- public subscript(key: String) -> Double? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Double.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift
deleted file mode 100644
index f45888a4101..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesObject.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesObject: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: Dictionary] = [:]
-
- public subscript(key: String) -> Dictionary? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(Dictionary.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift
deleted file mode 100644
index 7af63cc7152..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AdditionalPropertiesString.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct AdditionalPropertiesString: Codable {
-
- public var name: String?
-
- public init(name: String?) {
- self.name = name
- }
- public var additionalProperties: [String: String] = [:]
-
- public subscript(key: String) -> String? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeIfPresent(name, forKey: "name")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- name = try container.decodeIfPresent(String.self, forKey: "name")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("name")
- additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift
deleted file mode 100644
index aa016683503..00000000000
--- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// XmlItem.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public struct XmlItem: Codable {
-
- public var attributeString: String?
- public var attributeNumber: Double?
- public var attributeInteger: Int?
- public var attributeBoolean: Bool?
- public var wrappedArray: [Int]?
- public var nameString: String?
- public var nameNumber: Double?
- public var nameInteger: Int?
- public var nameBoolean: Bool?
- public var nameArray: [Int]?
- public var nameWrappedArray: [Int]?
- public var prefixString: String?
- public var prefixNumber: Double?
- public var prefixInteger: Int?
- public var prefixBoolean: Bool?
- public var prefixArray: [Int]?
- public var prefixWrappedArray: [Int]?
- public var namespaceString: String?
- public var namespaceNumber: Double?
- public var namespaceInteger: Int?
- public var namespaceBoolean: Bool?
- public var namespaceArray: [Int]?
- public var namespaceWrappedArray: [Int]?
- public var prefixNsString: String?
- public var prefixNsNumber: Double?
- public var prefixNsInteger: Int?
- public var prefixNsBoolean: Bool?
- public var prefixNsArray: [Int]?
- public var prefixNsWrappedArray: [Int]?
-
- public init(attributeString: String?, attributeNumber: Double?, attributeInteger: Int?, attributeBoolean: Bool?, wrappedArray: [Int]?, nameString: String?, nameNumber: Double?, nameInteger: Int?, nameBoolean: Bool?, nameArray: [Int]?, nameWrappedArray: [Int]?, prefixString: String?, prefixNumber: Double?, prefixInteger: Int?, prefixBoolean: Bool?, prefixArray: [Int]?, prefixWrappedArray: [Int]?, namespaceString: String?, namespaceNumber: Double?, namespaceInteger: Int?, namespaceBoolean: Bool?, namespaceArray: [Int]?, namespaceWrappedArray: [Int]?, prefixNsString: String?, prefixNsNumber: Double?, prefixNsInteger: Int?, prefixNsBoolean: Bool?, prefixNsArray: [Int]?, prefixNsWrappedArray: [Int]?) {
- self.attributeString = attributeString
- self.attributeNumber = attributeNumber
- self.attributeInteger = attributeInteger
- self.attributeBoolean = attributeBoolean
- self.wrappedArray = wrappedArray
- self.nameString = nameString
- self.nameNumber = nameNumber
- self.nameInteger = nameInteger
- self.nameBoolean = nameBoolean
- self.nameArray = nameArray
- self.nameWrappedArray = nameWrappedArray
- self.prefixString = prefixString
- self.prefixNumber = prefixNumber
- self.prefixInteger = prefixInteger
- self.prefixBoolean = prefixBoolean
- self.prefixArray = prefixArray
- self.prefixWrappedArray = prefixWrappedArray
- self.namespaceString = namespaceString
- self.namespaceNumber = namespaceNumber
- self.namespaceInteger = namespaceInteger
- self.namespaceBoolean = namespaceBoolean
- self.namespaceArray = namespaceArray
- self.namespaceWrappedArray = namespaceWrappedArray
- self.prefixNsString = prefixNsString
- self.prefixNsNumber = prefixNsNumber
- self.prefixNsInteger = prefixNsInteger
- self.prefixNsBoolean = prefixNsBoolean
- self.prefixNsArray = prefixNsArray
- self.prefixNsWrappedArray = prefixNsWrappedArray
- }
-
- public enum CodingKeys: String, CodingKey {
- case attributeString = "attribute_string"
- case attributeNumber = "attribute_number"
- case attributeInteger = "attribute_integer"
- case attributeBoolean = "attribute_boolean"
- case wrappedArray = "wrapped_array"
- case nameString = "name_string"
- case nameNumber = "name_number"
- case nameInteger = "name_integer"
- case nameBoolean = "name_boolean"
- case nameArray = "name_array"
- case nameWrappedArray = "name_wrapped_array"
- case prefixString = "prefix_string"
- case prefixNumber = "prefix_number"
- case prefixInteger = "prefix_integer"
- case prefixBoolean = "prefix_boolean"
- case prefixArray = "prefix_array"
- case prefixWrappedArray = "prefix_wrapped_array"
- case namespaceString = "namespace_string"
- case namespaceNumber = "namespace_number"
- case namespaceInteger = "namespace_integer"
- case namespaceBoolean = "namespace_boolean"
- case namespaceArray = "namespace_array"
- case namespaceWrappedArray = "namespace_wrapped_array"
- case prefixNsString = "prefix_ns_string"
- case prefixNsNumber = "prefix_ns_number"
- case prefixNsInteger = "prefix_ns_integer"
- case prefixNsBoolean = "prefix_ns_boolean"
- case prefixNsArray = "prefix_ns_array"
- case prefixNsWrappedArray = "prefix_ns_wrapped_array"
- }
-
-}
diff --git a/samples/client/petstore/swift4/unwrapRequired/pom.xml b/samples/client/petstore/swift4/unwrapRequired/pom.xml
new file mode 100644
index 00000000000..5caba9cb463
--- /dev/null
+++ b/samples/client/petstore/swift4/unwrapRequired/pom.xml
@@ -0,0 +1,43 @@
+
+ 4.0.0
+ io.swagger
+ Swift4PetstoreClientTests
+ pom
+ 1.0-SNAPSHOT
+ Swift4 Swagger Petstore Client
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ xcodebuild-test
+ integration-test
+
+ exec
+
+
+ ./run_spmbuild.sh
+
+
+
+
+
+
+
diff --git a/samples/client/petstore/swift4/unwrapRequired/run_spmbuild.sh b/samples/client/petstore/swift4/unwrapRequired/run_spmbuild.sh
new file mode 100755
index 00000000000..1a9f585ad05
--- /dev/null
+++ b/samples/client/petstore/swift4/unwrapRequired/run_spmbuild.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+swift build && exit ${PIPESTATUS[0]}
diff --git a/samples/client/test/swift4/default/.openapi-generator/VERSION b/samples/client/test/swift4/default/.openapi-generator/VERSION
index c3a2c7076fa..e4955748d3e 100644
--- a/samples/client/test/swift4/default/.openapi-generator/VERSION
+++ b/samples/client/test/swift4/default/.openapi-generator/VERSION
@@ -1 +1 @@
-4.2.0-SNAPSHOT
\ No newline at end of file
+4.2.2-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/test/swift4/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift4/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000000..919434a6254
--- /dev/null
+++ b/samples/client/test/swift4/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/samples/client/test/swift4/default/Package.resolved b/samples/client/test/swift4/default/Package.resolved
new file mode 100644
index 00000000000..ca6137050eb
--- /dev/null
+++ b/samples/client/test/swift4/default/Package.resolved
@@ -0,0 +1,16 @@
+{
+ "object": {
+ "pins": [
+ {
+ "package": "Alamofire",
+ "repositoryURL": "https://github.com/Alamofire/Alamofire.git",
+ "state": {
+ "branch": null,
+ "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4",
+ "version": "4.9.1"
+ }
+ }
+ ]
+ },
+ "version": 1
+}
diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj b/samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj
index 8fa2826af09..75c44d3d7ca 100644
--- a/samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj
+++ b/samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj
@@ -8,27 +8,16 @@
/* Begin PBXBuildFile section */
0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30CDB0CB291617B59C7E29CB /* PersonCard.swift */; };
- 01E212C311902B864527BF13 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191E19C2F89B8663BCF4FBEA /* Extensions.swift */; };
05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */; };
- 1150C15C863519A092B65692 /* PersonCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = E29C3BC88FEAF94FECA67A42 /* PersonCard.swift */; };
1415101700773F07D9E14327 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F6F3F378FFC3FC0AC42268D /* APIs.swift */; };
- 17FBC6CF6E8BFE71D33C9BFC /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EAA1DBBB82C7F083B98595F /* CodableHelper.swift */; };
19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6AD136503821775A39AEEEA /* APIHelper.swift */; };
2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */; };
- 2435C89448D0A9FCF8DB1C3B /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EF84FF97BA833181D55A51A /* APIHelper.swift */; };
27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */; };
- 2DBEE65DD1A3C3495B6F8FD5 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CAA5D350129277E17583C27 /* Models.swift */; };
- 30E7100C057CCFA6402D4070 /* PlaceCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF65F76D52F973768497A243 /* PlaceCard.swift */; };
- 37BEC223016795E28157F751 /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 023CA47DA7B8EA5E67414676 /* ModelWithStringAdditionalPropertiesOnly.swift */; };
3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */; };
- 3E32C71C3B2C7D5E0197E6E2 /* Swift4TestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398F88885A50B33451FCFDF1 /* Swift4TestAPI.swift */; };
3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */; };
4209C8951507A706227F2A85 /* SampleBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */; };
- 4223F35C2545E77A378B1869 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14BAA0CFCF5210DF11F06D3 /* JSONEncodableEncoding.swift */; };
493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */; };
- 4C923639A934AF070072D16E /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69A98ECBBBE9667D9847EEAB /* Configuration.swift */; };
4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C209BA7D3B7026133ACB6149 /* BaseCard.swift */; };
- 5472D271BD16329929A7360D /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 671A11EAF02ED88CFFDAFBC5 /* ErrorInfo.swift */; };
561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */; };
5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = A140137667E350EAFDE010EA /* Models.swift */; };
633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BD76CE1B85046CF575F42B /* StringEnum.swift */; };
@@ -37,89 +26,48 @@
7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A813A17AF964F26FB864212 /* ErrorInfo.swift */; };
7D51DA4415EEB4A0D2CECC95 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7DCE280D9FD953B91C0F18E /* JSONEncodableEncoding.swift */; };
7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */; };
- 8D769292CC09E9192775468F /* SampleSubClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5626F1C9CCDE265EB25BBD47 /* SampleSubClass.swift */; };
- 8DE1F6D479506F95717AC3FB /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54860017185201A4C2A2F544 /* VariableNameTest.swift */; };
8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */; };
9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */; };
- 97B334B37666146CCE9B075D /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2A122B51B1736ACC859570A /* AllPrimitives.swift */; };
- 99E414E731F93EBD6AAA571A /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14100F82AA0E6E697613420A /* ModelWithIntAdditionalPropertiesOnly.swift */; };
- A250E9B7B89D1826DB3868C4 /* ModelStringArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1507AFE9907AC803C06093 /* ModelStringArray.swift */; };
A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */; };
AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BA682C97038055435A32D0 /* CodableHelper.swift */; };
AFB1FE9D61B4F2B80E1C7AB8 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F082FE9586189859619C91E5 /* Alamofire.framework */; };
- C1C0C8C0718BCDC9A5E315CD /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4DAE449BCB032587594847 /* GetAllModelsResult.swift */; };
- C599397B4A6A1B5A403E4C4C /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E7F1C8F69E25D093E56B114 /* AlamofireImplementations.swift */; };
- CC3D7983035E4A5A8FAACFCD /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05A0A03CD4A9113B9D91606F /* ModelWithPropertiesAndAdditionalProperties.swift */; };
- D341F989C214B55970D91FD7 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 282DC97E6B31E9729E891D97 /* JSONEncodingHelper.swift */; };
D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */; };
- D992379A047FFAD1AA619461 /* ModelDoubleArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CB11DB8C924DADEC4055271 /* ModelDoubleArray.swift */; };
- DA5E97FF7C2D9E6F45FEE7BA /* SampleBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF35F63D7105D55BA0D3FD9 /* SampleBase.swift */; };
E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */; };
E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */; };
E6AA92100A56C799A2FCDA59 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1E452EBA4D5D6D227089137 /* AlamofireImplementations.swift */; };
- EE4618E339B918E17DB26094 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F5B983EDA0E1D0C2C8FEDA7 /* APIs.swift */; };
- EE6955D55C741CF1BAD5476C /* ModelErrorInfoArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74ECB05DB9BEC1D5ECEBF8 /* ModelErrorInfoArray.swift */; };
- F44925519D4D408AE4C7CBB2 /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EAE0680C3163069E97D7699 /* StringEnum.swift */; };
- F5FFDB445C4731238EA8AFC5 /* BaseCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C418DE3632EC3A053E7379ED /* BaseCard.swift */; };
FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */; };
FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- 023CA47DA7B8EA5E67414676 /* ModelWithStringAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithStringAdditionalPropertiesOnly.swift; sourceTree = ""; };
042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; };
- 05A0A03CD4A9113B9D91606F /* ModelWithPropertiesAndAdditionalProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithPropertiesAndAdditionalProperties.swift; sourceTree = ""; };
13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCard.swift; sourceTree = ""; };
- 14100F82AA0E6E697613420A /* ModelWithIntAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithIntAdditionalPropertiesOnly.swift; sourceTree = ""; };
17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithPropertiesAndAdditionalProperties.swift; sourceTree = ""; };
- 191E19C2F89B8663BCF4FBEA /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; };
1A813A17AF964F26FB864212 /* ErrorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = ""; };
- 1E7F1C8F69E25D093E56B114 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; };
- 282DC97E6B31E9729E891D97 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; };
2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCardAllOf.swift; sourceTree = ""; };
- 2EAE0680C3163069E97D7699 /* StringEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = ""; };
- 2F5B983EDA0E1D0C2C8FEDA7 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; };
30CDB0CB291617B59C7E29CB /* PersonCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCard.swift; sourceTree = ""; };
- 398F88885A50B33451FCFDF1 /* Swift4TestAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swift4TestAPI.swift; sourceTree = ""; };
- 3CAA5D350129277E17583C27 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; };
- 3CB11DB8C924DADEC4055271 /* ModelDoubleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelDoubleArray.swift; sourceTree = ""; };
- 4B74ECB05DB9BEC1D5ECEBF8 /* ModelErrorInfoArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelErrorInfoArray.swift; sourceTree = ""; };
4F6F3F378FFC3FC0AC42268D /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; };
- 54860017185201A4C2A2F544 /* VariableNameTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = ""; };
- 5626F1C9CCDE265EB25BBD47 /* SampleSubClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClass.swift; sourceTree = ""; };
5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelStringArray.swift; sourceTree = ""; };
- 5EF84FF97BA833181D55A51A /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; };
6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClassAllOf.swift; sourceTree = ""; };
- 671A11EAF02ED88CFFDAFBC5 /* ErrorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = ""; };
68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithIntAdditionalPropertiesOnly.swift; sourceTree = ""; };
- 69A98ECBBBE9667D9847EEAB /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; };
6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithStringAdditionalPropertiesOnly.swift; sourceTree = ""; };
7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = ""; };
7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = ""; };
889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCardAllOf.swift; sourceTree = ""; };
93BA682C97038055435A32D0 /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; };
- 9EAA1DBBB82C7F083B98595F /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; };
9FD147676BF8F2DD7E471810 /* TestClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TestClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A140137667E350EAFDE010EA /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; };
- A14BAA0CFCF5210DF11F06D3 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; };
A3BD76CE1B85046CF575F42B /* StringEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = ""; };
ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = ""; };
B1E452EBA4D5D6D227089137 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; };
- B2A122B51B1736ACC859570A /* AllPrimitives.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = ""; };
- BDF35F63D7105D55BA0D3FD9 /* SampleBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleBase.swift; sourceTree = ""; };
- BF65F76D52F973768497A243 /* PlaceCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCard.swift; sourceTree = ""; };
C209BA7D3B7026133ACB6149 /* BaseCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCard.swift; sourceTree = ""; };
C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelErrorInfoArray.swift; sourceTree = ""; };
- C418DE3632EC3A053E7379ED /* BaseCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCard.swift; sourceTree = ""; };
C6AD136503821775A39AEEEA /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; };
CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleBase.swift; sourceTree = ""; };
- CD4DAE449BCB032587594847 /* GetAllModelsResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = ""; };
CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; };
CF9E03057B35B32AC59ADC1B /* Swift4TestAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swift4TestAPI.swift; sourceTree = ""; };
D3D0164E2EEC228143968A2D /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; };
D7DCE280D9FD953B91C0F18E /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; };
- DE1507AFE9907AC803C06093 /* ModelStringArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelStringArray.swift; sourceTree = ""; };
- E29C3BC88FEAF94FECA67A42 /* PersonCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCard.swift; sourceTree = ""; };
EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClass.swift; sourceTree = ""; };
EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelDoubleArray.swift; sourceTree = ""; };
F082FE9586189859619C91E5 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; };
@@ -137,47 +85,6 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 2539B43B44954BFCB19E44BE /* Models */ = {
- isa = PBXGroup;
- children = (
- B2A122B51B1736ACC859570A /* AllPrimitives.swift */,
- C418DE3632EC3A053E7379ED /* BaseCard.swift */,
- 671A11EAF02ED88CFFDAFBC5 /* ErrorInfo.swift */,
- CD4DAE449BCB032587594847 /* GetAllModelsResult.swift */,
- 3CB11DB8C924DADEC4055271 /* ModelDoubleArray.swift */,
- 4B74ECB05DB9BEC1D5ECEBF8 /* ModelErrorInfoArray.swift */,
- DE1507AFE9907AC803C06093 /* ModelStringArray.swift */,
- 14100F82AA0E6E697613420A /* ModelWithIntAdditionalPropertiesOnly.swift */,
- 05A0A03CD4A9113B9D91606F /* ModelWithPropertiesAndAdditionalProperties.swift */,
- 023CA47DA7B8EA5E67414676 /* ModelWithStringAdditionalPropertiesOnly.swift */,
- E29C3BC88FEAF94FECA67A42 /* PersonCard.swift */,
- BF65F76D52F973768497A243 /* PlaceCard.swift */,
- BDF35F63D7105D55BA0D3FD9 /* SampleBase.swift */,
- 5626F1C9CCDE265EB25BBD47 /* SampleSubClass.swift */,
- 2EAE0680C3163069E97D7699 /* StringEnum.swift */,
- 54860017185201A4C2A2F544 /* VariableNameTest.swift */,
- );
- path = Models;
- sourceTree = "";
- };
- 26F3607B28A0AD360F5100F5 /* Swaggers */ = {
- isa = PBXGroup;
- children = (
- 1E7F1C8F69E25D093E56B114 /* AlamofireImplementations.swift */,
- 5EF84FF97BA833181D55A51A /* APIHelper.swift */,
- 2F5B983EDA0E1D0C2C8FEDA7 /* APIs.swift */,
- 9EAA1DBBB82C7F083B98595F /* CodableHelper.swift */,
- 69A98ECBBBE9667D9847EEAB /* Configuration.swift */,
- 191E19C2F89B8663BCF4FBEA /* Extensions.swift */,
- A14BAA0CFCF5210DF11F06D3 /* JSONEncodableEncoding.swift */,
- 282DC97E6B31E9729E891D97 /* JSONEncodingHelper.swift */,
- 3CAA5D350129277E17583C27 /* Models.swift */,
- 357449309E73CA39C8813961 /* APIs */,
- 2539B43B44954BFCB19E44BE /* Models */,
- );
- path = Swaggers;
- sourceTree = "";
- };
3049D31996790CF8E31B6F01 = {
isa = PBXGroup;
children = (
@@ -187,14 +94,6 @@
);
sourceTree = "";
};
- 357449309E73CA39C8813961 /* APIs */ = {
- isa = PBXGroup;
- children = (
- 398F88885A50B33451FCFDF1 /* Swift4TestAPI.swift */,
- );
- path = APIs;
- sourceTree = "";
- };
3A1CFAB4CC75547815260F88 /* OpenAPIs */ = {
isa = PBXGroup;
children = (
@@ -217,7 +116,6 @@
isa = PBXGroup;
children = (
3A1CFAB4CC75547815260F88 /* OpenAPIs */,
- 26F3607B28A0AD360F5100F5 /* Swaggers */,
);
path = Classes;
sourceTree = "";
@@ -329,6 +227,7 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
+ Base,
en,
);
mainGroup = 3049D31996790CF8E31B6F01;
@@ -345,60 +244,34 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 2435C89448D0A9FCF8DB1C3B /* APIHelper.swift in Sources */,
19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */,
- EE4618E339B918E17DB26094 /* APIs.swift in Sources */,
1415101700773F07D9E14327 /* APIs.swift in Sources */,
- C599397B4A6A1B5A403E4C4C /* AlamofireImplementations.swift in Sources */,
E6AA92100A56C799A2FCDA59 /* AlamofireImplementations.swift in Sources */,
- 97B334B37666146CCE9B075D /* AllPrimitives.swift in Sources */,
561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */,
- F5FFDB445C4731238EA8AFC5 /* BaseCard.swift in Sources */,
4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */,
- 17FBC6CF6E8BFE71D33C9BFC /* CodableHelper.swift in Sources */,
AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */,
- 4C923639A934AF070072D16E /* Configuration.swift in Sources */,
E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */,
- 5472D271BD16329929A7360D /* ErrorInfo.swift in Sources */,
7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */,
- 01E212C311902B864527BF13 /* Extensions.swift in Sources */,
6B1961ED41DFDFDB3029BE6F /* Extensions.swift in Sources */,
- C1C0C8C0718BCDC9A5E315CD /* GetAllModelsResult.swift in Sources */,
3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */,
- 4223F35C2545E77A378B1869 /* JSONEncodableEncoding.swift in Sources */,
7D51DA4415EEB4A0D2CECC95 /* JSONEncodableEncoding.swift in Sources */,
- D341F989C214B55970D91FD7 /* JSONEncodingHelper.swift in Sources */,
FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */,
- D992379A047FFAD1AA619461 /* ModelDoubleArray.swift in Sources */,
7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */,
- EE6955D55C741CF1BAD5476C /* ModelErrorInfoArray.swift in Sources */,
A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */,
- A250E9B7B89D1826DB3868C4 /* ModelStringArray.swift in Sources */,
E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */,
- 99E414E731F93EBD6AAA571A /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */,
27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */,
- CC3D7983035E4A5A8FAACFCD /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */,
493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */,
- 37BEC223016795E28157F751 /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */,
05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */,
- 2DBEE65DD1A3C3495B6F8FD5 /* Models.swift in Sources */,
5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */,
- 1150C15C863519A092B65692 /* PersonCard.swift in Sources */,
0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */,
D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */,
- 30E7100C057CCFA6402D4070 /* PlaceCard.swift in Sources */,
8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */,
9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */,
- DA5E97FF7C2D9E6F45FEE7BA /* SampleBase.swift in Sources */,
4209C8951507A706227F2A85 /* SampleBase.swift in Sources */,
- 8D769292CC09E9192775468F /* SampleSubClass.swift in Sources */,
3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */,
2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */,
- F44925519D4D408AE4C7CBB2 /* StringEnum.swift in Sources */,
633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */,
- 3E32C71C3B2C7D5E0197E6E2 /* Swift4TestAPI.swift in Sources */,
6CADD5CF7C8834F9ACA88E4F /* Swift4TestAPI.swift in Sources */,
- 8DE1F6D479506F95717AC3FB /* VariableNameTest.swift in Sources */,
FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 00000000000..18d981003d6
--- /dev/null
+++ b/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme b/samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme
index 0be5e2334a8..a96ec1a1ddf 100644
--- a/samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme
+++ b/samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift
index 75dea243957..20007009680 100644
--- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift
+++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift
@@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value {
result[item.key] = "\(value)"
@@ -46,7 +46,7 @@ public struct APIHelper {
}
public static func mapValueToPathItem(_ source: Any) -> Any {
- if let collection = source as? Array {
+ if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
}
return source
@@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
- if let collection = item.value as? Array {
+ if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value {
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs.swift
deleted file mode 100644
index 718622c4db4..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs.swift
+++ /dev/null
@@ -1,61 +0,0 @@
-// APIs.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-open class TestClientAPI {
- open static var basePath = "http://api.example.com/basePath"
- open static var credential: URLCredential?
- open static var customHeaders: [String: String] = [:]
- open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory()
-}
-
-open class RequestBuilder {
- var credential: URLCredential?
- var headers: [String: String]
- public let parameters: [String: Any]?
- public let isBody: Bool
- public let method: String
- public let URLString: String
-
- /// Optional block to obtain a reference to the request's progress instance when available.
- public var onProgressReady: ((Progress) -> Void)?
-
- required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) {
- self.method = method
- self.URLString = URLString
- self.parameters = parameters
- self.isBody = isBody
- self.headers = headers
-
- addHeaders(TestClientAPI.customHeaders)
- }
-
- open func addHeaders(_ aHeaders: [String: String]) {
- for (header, value) in aHeaders {
- headers[header] = value
- }
- }
-
- open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { }
-
- public func addHeader(name: String, value: String) -> Self {
- if !value.isEmpty {
- headers[name] = value
- }
- return self
- }
-
- open func addCredential() -> Self {
- self.credential = TestClientAPI.credential
- return self
- }
-}
-
-public protocol RequestBuilderFactory {
- func getNonDecodableBuilder() -> RequestBuilder.Type
- func getBuilder() -> RequestBuilder.Type
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift
deleted file mode 100644
index bcdaad6241a..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// Swift4TestAPI.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-import Alamofire
-
-open class Swift4TestAPI {
- /**
- Get all of the models
-
- - parameter clientId: (query) id that represent the Api client
- - parameter completion: completion handler to receive the data and the error objects
- */
- open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) {
- getAllModelsWithRequestBuilder(clientId: clientId).execute { (response, error) -> Void in
- completion(response?.body, error)
- }
- }
-
- /**
- Get all of the models
- - GET /allModels
- - This endpoint tests get a dictionary which contains examples of all of the models.
- - examples: [{contentType=application/json, example={
- "myPrimitive" : {
- "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ],
- "myStringArray" : [ "myStringArray", "myStringArray" ],
- "myFile" : "",
- "myBytes" : "myBytes",
- "myLong" : 1,
- "myBooleanArray" : [ true, true ],
- "myInteger" : 0,
- "myBytesArray" : [ "myBytesArray", "myBytesArray" ],
- "myDouble" : 7.061401241503109105224211816675961017608642578125,
- "myIntegerArray" : [ 6, 6 ],
- "myInlineStringEnum" : "inlineStringEnumValue1",
- "myFileArray" : [ "", "" ],
- "myFloat" : 5.637377,
- "myStringEnumArray" : [ null, null ],
- "myFloatArray" : [ 2.302136, 2.302136 ],
- "myDoubleArray" : [ 9.301444243932575517419536481611430644989013671875, 9.301444243932575517419536481611430644989013671875 ],
- "myString" : "myString",
- "myDate" : "2000-01-23",
- "myDateArray" : [ "2000-01-23", "2000-01-23" ],
- "myDateTime" : "2000-01-23T04:56:07.000+00:00",
- "myLongArray" : [ 5, 5 ],
- "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
- "myBoolean" : true,
- "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ]
- },
- "myVariableNameTest" : {
- "normalName" : "normalName",
- "for" : "for",
- "example_name" : "example_name"
- },
- "myPrimitiveArray" : [ {
- "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ],
- "myStringArray" : [ "myStringArray", "myStringArray" ],
- "myFile" : "",
- "myBytes" : "myBytes",
- "myLong" : 1,
- "myBooleanArray" : [ true, true ],
- "myInteger" : 0,
- "myBytesArray" : [ "myBytesArray", "myBytesArray" ],
- "myDouble" : 7.061401241503109105224211816675961017608642578125,
- "myIntegerArray" : [ 6, 6 ],
- "myInlineStringEnum" : "inlineStringEnumValue1",
- "myFileArray" : [ "", "" ],
- "myFloat" : 5.637377,
- "myStringEnumArray" : [ null, null ],
- "myFloatArray" : [ 2.302136, 2.302136 ],
- "myDoubleArray" : [ 9.301444243932575517419536481611430644989013671875, 9.301444243932575517419536481611430644989013671875 ],
- "myString" : "myString",
- "myDate" : "2000-01-23",
- "myDateArray" : [ "2000-01-23", "2000-01-23" ],
- "myDateTime" : "2000-01-23T04:56:07.000+00:00",
- "myLongArray" : [ 5, 5 ],
- "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
- "myBoolean" : true,
- "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ]
- }, {
- "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ],
- "myStringArray" : [ "myStringArray", "myStringArray" ],
- "myFile" : "",
- "myBytes" : "myBytes",
- "myLong" : 1,
- "myBooleanArray" : [ true, true ],
- "myInteger" : 0,
- "myBytesArray" : [ "myBytesArray", "myBytesArray" ],
- "myDouble" : 7.061401241503109105224211816675961017608642578125,
- "myIntegerArray" : [ 6, 6 ],
- "myInlineStringEnum" : "inlineStringEnumValue1",
- "myFileArray" : [ "", "" ],
- "myFloat" : 5.637377,
- "myStringEnumArray" : [ null, null ],
- "myFloatArray" : [ 2.302136, 2.302136 ],
- "myDoubleArray" : [ 9.301444243932575517419536481611430644989013671875, 9.301444243932575517419536481611430644989013671875 ],
- "myString" : "myString",
- "myDate" : "2000-01-23",
- "myDateArray" : [ "2000-01-23", "2000-01-23" ],
- "myDateTime" : "2000-01-23T04:56:07.000+00:00",
- "myLongArray" : [ 5, 5 ],
- "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
- "myBoolean" : true,
- "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ]
- } ]
-}}]
- - parameter clientId: (query) id that represent the Api client
- - returns: RequestBuilder
- */
- open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder {
- let path = "/allModels"
- let URLString = TestClientAPI.basePath + path
- let parameters: [String: Any]? = nil
-
- var url = URLComponents(string: URLString)
- url?.queryItems = APIHelper.mapValuesToQueryItems([
- "client_id": clientId
- ])
-
- let requestBuilder: RequestBuilder.Type = TestClientAPI.requestBuilderFactory.getBuilder()
-
- return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift
deleted file mode 100644
index 0087792f206..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// AllPrimitives.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** Object which contains lots of different primitive Swagger types */
-
-public struct AllPrimitives: Codable {
-
- public enum MyInlineStringEnum: String, Codable {
- case inlinestringenumvalue1 = "inlineStringEnumValue1"
- case inlinestringenumvalue2 = "inlineStringEnumValue2"
- case inlinestringenumvalue3 = "inlineStringEnumValue3"
- }
- public var myInteger: Int?
- public var myIntegerArray: [Int]?
- public var myLong: Int64?
- public var myLongArray: [Int64]?
- public var myFloat: Float?
- public var myFloatArray: [Float]?
- public var myDouble: Double?
- public var myDoubleArray: [Double]?
- public var myString: String?
- public var myStringArray: [String]?
- public var myBytes: Data?
- public var myBytesArray: [Data]?
- public var myBoolean: Bool?
- public var myBooleanArray: [Bool]?
- public var myDate: Date?
- public var myDateArray: [Date]?
- public var myDateTime: Date?
- public var myDateTimeArray: [Date]?
- public var myFile: URL?
- public var myFileArray: [URL]?
- public var myUUID: UUID?
- public var myUUIDArray: [UUID]?
- public var myStringEnum: StringEnum?
- public var myStringEnumArray: [StringEnum]?
- public var myInlineStringEnum: MyInlineStringEnum?
-
- public init(myInteger: Int?, myIntegerArray: [Int]?, myLong: Int64?, myLongArray: [Int64]?, myFloat: Float?, myFloatArray: [Float]?, myDouble: Double?, myDoubleArray: [Double]?, myString: String?, myStringArray: [String]?, myBytes: Data?, myBytesArray: [Data]?, myBoolean: Bool?, myBooleanArray: [Bool]?, myDate: Date?, myDateArray: [Date]?, myDateTime: Date?, myDateTimeArray: [Date]?, myFile: URL?, myFileArray: [URL]?, myUUID: UUID?, myUUIDArray: [UUID]?, myStringEnum: StringEnum?, myStringEnumArray: [StringEnum]?, myInlineStringEnum: MyInlineStringEnum?) {
- self.myInteger = myInteger
- self.myIntegerArray = myIntegerArray
- self.myLong = myLong
- self.myLongArray = myLongArray
- self.myFloat = myFloat
- self.myFloatArray = myFloatArray
- self.myDouble = myDouble
- self.myDoubleArray = myDoubleArray
- self.myString = myString
- self.myStringArray = myStringArray
- self.myBytes = myBytes
- self.myBytesArray = myBytesArray
- self.myBoolean = myBoolean
- self.myBooleanArray = myBooleanArray
- self.myDate = myDate
- self.myDateArray = myDateArray
- self.myDateTime = myDateTime
- self.myDateTimeArray = myDateTimeArray
- self.myFile = myFile
- self.myFileArray = myFileArray
- self.myUUID = myUUID
- self.myUUIDArray = myUUIDArray
- self.myStringEnum = myStringEnum
- self.myStringEnumArray = myStringEnumArray
- self.myInlineStringEnum = myInlineStringEnum
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/BaseCard.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/BaseCard.swift
deleted file mode 100644
index 51055d85739..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/BaseCard.swift
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// BaseCard.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This is a base card object which uses a 'cardType' discriminator. */
-
-public struct BaseCard: Codable {
-
- public var cardType: String
-
- public init(cardType: String) {
- self.cardType = cardType
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift
deleted file mode 100644
index cc3992e748a..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// GetAllModelsResult.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** Response object containing AllPrimitives object */
-
-public struct GetAllModelsResult: Codable {
-
- public var myPrimitiveArray: [AllPrimitives]?
- public var myPrimitive: AllPrimitives?
- public var myVariableNameTest: VariableNameTest?
-
- public init(myPrimitiveArray: [AllPrimitives]?, myPrimitive: AllPrimitives?, myVariableNameTest: VariableNameTest?) {
- self.myPrimitiveArray = myPrimitiveArray
- self.myPrimitive = myPrimitive
- self.myVariableNameTest = myVariableNameTest
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelDoubleArray.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelDoubleArray.swift
deleted file mode 100644
index 9e523219a44..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelDoubleArray.swift
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// ModelDoubleArray.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This defines an array of doubles. */
-public typealias ModelDoubleArray = [Double]
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelErrorInfoArray.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelErrorInfoArray.swift
deleted file mode 100644
index 358c83dc7a9..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelErrorInfoArray.swift
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// ModelErrorInfoArray.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This defines an array of ErrorInfo objects. */
-public typealias ModelErrorInfoArray = [ErrorInfo]
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelStringArray.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelStringArray.swift
deleted file mode 100644
index 6a614cc3601..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelStringArray.swift
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// ModelStringArray.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This defines an array of strings. */
-public typealias ModelStringArray = [String]
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift
deleted file mode 100644
index 35834374b0f..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// ModelWithIntAdditionalPropertiesOnly.swift
-//
-// Generated by swagger-codegen
-// https://github.com/swagger-api/swagger-codegen
-//
-
-import Foundation
-
-/** This is an empty model with no properties and only additionalProperties of type int32 */
-
-public struct ModelWithIntAdditionalPropertiesOnly: Codable {
-
- public var additionalProperties: [String: Int] = [:]
-
- public subscript(key: String) -> Int? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- var nonAdditionalPropertyKeys = Set()
- additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift
deleted file mode 100644
index de3ca374508..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// ModelWithPropertiesAndAdditionalProperties.swift
-//
-// Generated by swagger-codegen
-// https://github.com/swagger-api/swagger-codegen
-//
-
-import Foundation
-
-/** This is an empty model with no properties and only additionalProperties of type int32 */
-
-public struct ModelWithPropertiesAndAdditionalProperties: Codable {
-
- public var myIntegerReq: Int
- public var myIntegerOpt: Int?
- public var myPrimitiveReq: AllPrimitives
- public var myPrimitiveOpt: AllPrimitives?
- public var myStringArrayReq: [String]
- public var myStringArrayOpt: [String]?
- public var myPrimitiveArrayReq: [AllPrimitives]
- public var myPrimitiveArrayOpt: [AllPrimitives]?
-
- public init(myIntegerReq: Int, myIntegerOpt: Int?, myPrimitiveReq: AllPrimitives, myPrimitiveOpt: AllPrimitives?, myStringArrayReq: [String], myStringArrayOpt: [String]?, myPrimitiveArrayReq: [AllPrimitives], myPrimitiveArrayOpt: [AllPrimitives]?) {
- self.myIntegerReq = myIntegerReq
- self.myIntegerOpt = myIntegerOpt
- self.myPrimitiveReq = myPrimitiveReq
- self.myPrimitiveOpt = myPrimitiveOpt
- self.myStringArrayReq = myStringArrayReq
- self.myStringArrayOpt = myStringArrayOpt
- self.myPrimitiveArrayReq = myPrimitiveArrayReq
- self.myPrimitiveArrayOpt = myPrimitiveArrayOpt
- }
- public var additionalProperties: [String: String] = [:]
-
- public subscript(key: String) -> String? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encode(myIntegerReq, forKey: "myIntegerReq")
- try container.encodeIfPresent(myIntegerOpt, forKey: "myIntegerOpt")
- try container.encode(myPrimitiveReq, forKey: "myPrimitiveReq")
- try container.encodeIfPresent(myPrimitiveOpt, forKey: "myPrimitiveOpt")
- try container.encode(myStringArrayReq, forKey: "myStringArrayReq")
- try container.encodeIfPresent(myStringArrayOpt, forKey: "myStringArrayOpt")
- try container.encode(myPrimitiveArrayReq, forKey: "myPrimitiveArrayReq")
- try container.encodeIfPresent(myPrimitiveArrayOpt, forKey: "myPrimitiveArrayOpt")
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- myIntegerReq = try container.decode(Int.self, forKey: "myIntegerReq")
- myIntegerOpt = try container.decodeIfPresent(Int.self, forKey: "myIntegerOpt")
- myPrimitiveReq = try container.decode(AllPrimitives.self, forKey: "myPrimitiveReq")
- myPrimitiveOpt = try container.decodeIfPresent(AllPrimitives.self, forKey: "myPrimitiveOpt")
- myStringArrayReq = try container.decode([String].self, forKey: "myStringArrayReq")
- myStringArrayOpt = try container.decodeIfPresent([String].self, forKey: "myStringArrayOpt")
- myPrimitiveArrayReq = try container.decode([AllPrimitives].self, forKey: "myPrimitiveArrayReq")
- myPrimitiveArrayOpt = try container.decodeIfPresent([AllPrimitives].self, forKey: "myPrimitiveArrayOpt")
- var nonAdditionalPropertyKeys = Set()
- nonAdditionalPropertyKeys.insert("myIntegerReq")
- nonAdditionalPropertyKeys.insert("myIntegerOpt")
- nonAdditionalPropertyKeys.insert("myPrimitiveReq")
- nonAdditionalPropertyKeys.insert("myPrimitiveOpt")
- nonAdditionalPropertyKeys.insert("myStringArrayReq")
- nonAdditionalPropertyKeys.insert("myStringArrayOpt")
- nonAdditionalPropertyKeys.insert("myPrimitiveArrayReq")
- nonAdditionalPropertyKeys.insert("myPrimitiveArrayOpt")
- additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift
deleted file mode 100644
index 5f085f47ae3..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// ModelWithStringAdditionalPropertiesOnly.swift
-//
-// Generated by swagger-codegen
-// https://github.com/swagger-api/swagger-codegen
-//
-
-import Foundation
-
-/** This is an empty model with no properties and only additionalProperties of type string */
-
-public struct ModelWithStringAdditionalPropertiesOnly: Codable {
-
- public var additionalProperties: [String: String] = [:]
-
- public subscript(key: String) -> String? {
- get {
- if let value = additionalProperties[key] {
- return value
- }
- return nil
- }
-
- set {
- additionalProperties[key] = newValue
- }
- }
-
- // Encodable protocol methods
-
- public func encode(to encoder: Encoder) throws {
-
- var container = encoder.container(keyedBy: String.self)
-
- try container.encodeMap(additionalProperties)
- }
-
- // Decodable protocol methods
-
- public init(from decoder: Decoder) throws {
- let container = try decoder.container(keyedBy: String.self)
-
- var nonAdditionalPropertyKeys = Set()
- additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys)
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/PersonCard.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/PersonCard.swift
deleted file mode 100644
index dd4196af071..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/PersonCard.swift
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// PersonCard.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This is an card object for a Person derived from BaseCard. */
-
-public struct PersonCard: Codable {
-
- public var cardType: String
- public var firstName: String?
- public var lastName: String?
-
- public init(cardType: String, firstName: String?, lastName: String?) {
- self.cardType = cardType
- self.firstName = firstName
- self.lastName = lastName
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/PlaceCard.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/PlaceCard.swift
deleted file mode 100644
index c1435ae76db..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/PlaceCard.swift
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// PlaceCard.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This is an card object for a Person derived from BaseCard. */
-
-public struct PlaceCard: Codable {
-
- public var cardType: String
- public var placeName: String?
- public var placeAddress: String?
-
- public init(cardType: String, placeName: String?, placeAddress: String?) {
- self.cardType = cardType
- self.placeName = placeName
- self.placeAddress = placeAddress
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/SampleBase.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/SampleBase.swift
deleted file mode 100644
index aea86566802..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/SampleBase.swift
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// SampleBase.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This is an base class object from which other classes will derive. */
-
-public struct SampleBase: Codable {
-
- public var baseClassStringProp: String?
- public var baseClassIntegerProp: Int?
-
- public init(baseClassStringProp: String?, baseClassIntegerProp: Int?) {
- self.baseClassStringProp = baseClassStringProp
- self.baseClassIntegerProp = baseClassIntegerProp
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/SampleSubClass.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/SampleSubClass.swift
deleted file mode 100644
index fa000279e04..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/SampleSubClass.swift
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// SampleSubClass.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This is an subclass defived from the SampleBase class. */
-
-public struct SampleSubClass: Codable {
-
- public var baseClassStringProp: String?
- public var baseClassIntegerProp: Int?
- public var subClassStringProp: String?
- public var subClassIntegerProp: Int?
-
- public init(baseClassStringProp: String?, baseClassIntegerProp: Int?, subClassStringProp: String?, subClassIntegerProp: Int?) {
- self.baseClassStringProp = baseClassStringProp
- self.baseClassIntegerProp = baseClassIntegerProp
- self.subClassStringProp = subClassStringProp
- self.subClassIntegerProp = subClassIntegerProp
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/StringEnum.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/StringEnum.swift
deleted file mode 100644
index 67c1c22deda..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/StringEnum.swift
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// StringEnum.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-public enum StringEnum: String, Codable {
- case stringenumvalue1 = "stringEnumValue1"
- case stringenumvalue2 = "stringEnumValue2"
- case stringenumvalue3 = "stringEnumValue3"
-}
diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift
deleted file mode 100644
index 6592d3f1eef..00000000000
--- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// VariableNameTest.swift
-//
-// Generated by openapi-generator
-// https://openapi-generator.tech
-//
-
-import Foundation
-
-/** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */
-
-public struct VariableNameTest: Codable {
-
- /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */
- public var exampleName: String?
- /** This property name is a reserved word in most languages, including Swift 4. */
- public var _for: String?
- /** This model object property name should be unchanged from the JSON property name. */
- public var normalName: String?
-
- public init(exampleName: String?, _for: String?, normalName: String?) {
- self.exampleName = exampleName
- self._for = _for
- self.normalName = normalName
- }
-
- public enum CodingKeys: String, CodingKey {
- case exampleName = "example_name"
- case _for = "for"
- case normalName
- }
-
-}
diff --git a/samples/client/test/swift4/default/TestClientApp/Podfile b/samples/client/test/swift4/default/TestClientApp/Podfile
index 9d5223c3301..4c786a266c9 100644
--- a/samples/client/test/swift4/default/TestClientApp/Podfile
+++ b/samples/client/test/swift4/default/TestClientApp/Podfile
@@ -1,19 +1,13 @@
+platform :ios, '9.0'
+
+source 'https://cdn.cocoapods.org/'
+
use_frameworks!
-source 'https://github.com/CocoaPods/Specs.git'
target 'TestClientApp' do
pod "TestClient", :path => "../"
- pod 'Alamofire', '~> 4.5'
target 'TestClientAppTests' do
inherit! :search_paths
end
end
-
-post_install do |installer|
- installer.pods_project.targets.each do |target|
- target.build_configurations.each do |configuration|
- configuration.build_settings['SWIFT_VERSION'] = "4.0"
- end
- end
-end
diff --git a/samples/client/test/swift4/default/TestClientApp/Podfile.lock b/samples/client/test/swift4/default/TestClientApp/Podfile.lock
index 4e6ae435e3a..52635b1df2f 100644
--- a/samples/client/test/swift4/default/TestClientApp/Podfile.lock
+++ b/samples/client/test/swift4/default/TestClientApp/Podfile.lock
@@ -1,20 +1,23 @@
PODS:
- - Alamofire (4.5.1)
- - TestClient (0.0.1):
- - Alamofire (~> 4.5.0)
+ - Alamofire (4.9.0)
+ - TestClient (1.0):
+ - Alamofire (~> 4.9.0)
DEPENDENCIES:
- - Alamofire (~> 4.5)
- TestClient (from `../`)
+SPEC REPOS:
+ trunk:
+ - Alamofire
+
EXTERNAL SOURCES:
TestClient:
- :path: ../
+ :path: "../"
SPEC CHECKSUMS:
- Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a
- TestClient: 410e69b600d7aa37590bc4077dc148d7f314ac84
+ Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321
+ TestClient: 4923530f672e09a8d020c93372c5ecc195a00ff2
-PODFILE CHECKSUM: a4351ac5e001fd96f35ed7e647981803864100b5
+PODFILE CHECKSUM: 837b06bfc9f93ccd7664fd918d113c8e3824bde3
-COCOAPODS: 1.4.0.beta.2
+COCOAPODS: 1.8.4
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE
index 1654602752b..38a301a1db8 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md
index f190df923ba..9fdc9c73873 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md
@@ -4,7 +4,7 @@
[](https://img.shields.io/cocoapods/v/Alamofire.svg)
[](https://github.com/Carthage/Carthage)
[](https://alamofire.github.io/Alamofire)
-[](http://twitter.com/AlamofireSF)
+[](https://twitter.com/AlamofireSF)
[](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Alamofire is an HTTP networking library written in Swift.
@@ -15,16 +15,16 @@ Alamofire is an HTTP networking library written in Swift.
- [Migration Guides](#migration-guides)
- [Communication](#communication)
- [Installation](#installation)
-- [Usage](#usage)
- - **Intro -** [Making a Request](#making-a-request), [Response Handling](#response-handling), [Response Validation](#response-validation), [Response Caching](#response-caching)
- - **HTTP -** [HTTP Methods](#http-methods), [Parameter Encoding](#parameter-encoding), [HTTP Headers](#http-headers), [Authentication](#authentication)
- - **Large Data -** [Downloading Data to a File](#downloading-data-to-a-file), [Uploading Data to a Server](#uploading-data-to-a-server)
- - **Tools -** [Statistical Metrics](#statistical-metrics), [cURL Command Output](#curl-command-output)
-- [Advanced Usage](#advanced-usage)
- - **URL Session -** [Session Manager](#session-manager), [Session Delegate](#session-delegate), [Request](#request)
- - **Routing -** [Routing Requests](#routing-requests), [Adapting and Retrying Requests](#adapting-and-retrying-requests)
- - **Model Objects -** [Custom Response Serialization](#custom-response-serialization)
- - **Connection -** [Security](#security), [Network Reachability](#network-reachability)
+- [Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md)
+ - **Intro -** [Making a Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#making-a-request), [Response Handling](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-handling), [Response Validation](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-validation), [Response Caching](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-caching)
+ - **HTTP -** [HTTP Methods](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-methods), [Parameter Encoding](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#parameter-encoding), [HTTP Headers](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-headers), [Authentication](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#authentication)
+ - **Large Data -** [Downloading Data to a File](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#downloading-data-to-a-file), [Uploading Data to a Server](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#uploading-data-to-a-server)
+ - **Tools -** [Statistical Metrics](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#statistical-metrics), [cURL Command Output](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#curl-command-output)
+- [Advanced Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md)
+ - **URL Session -** [Session Manager](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-manager), [Session Delegate](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-delegate), [Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#request)
+ - **Routing -** [Routing Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#routing-requests), [Adapting and Retrying Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#adapting-and-retrying-requests)
+ - **Model Objects -** [Custom Response Serialization](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#custom-response-serialization)
+ - **Connection -** [Security](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#security), [Network Reachability](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#network-reachability)
- [Open Radars](#open-radars)
- [FAQ](#faq)
- [Credits](#credits)
@@ -67,24 +67,25 @@ In order to keep Alamofire focused specifically on core networking implementatio
- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md)
## Communication
-
-- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire')
-- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire).
-- If you **found a bug**, open an issue.
-- If you **have a feature request**, open an issue.
+- If you **need help with making network requests**, use [Stack Overflow](https://stackoverflow.com/questions/tagged/alamofire) and tag `alamofire`.
+- If you need to **find or understand an API**, check [our documentation](http://alamofire.github.io/Alamofire/) or [Apple's documentation for `URLSession`](https://developer.apple.com/documentation/foundation/url_loading_system), on top of which Alamofire is built.
+- If you need **help with an Alamofire feature**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire).
+- If you'd like to **discuss Alamofire best practices**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire).
+- If you'd like to **discuss a feature request**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire).
+- If you **found a bug**, open an issue and follow the guide. The more detail the better!
- If you **want to contribute**, submit a pull request.
## Installation
### CocoaPods
-[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
+[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
```bash
$ gem install cocoapods
```
-> CocoaPods 1.1+ is required to build Alamofire 4.0+.
+> CocoaPods 1.7+ is required to build Alamofire 4.9+.
To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`:
@@ -94,7 +95,7 @@ platform :ios, '10.0'
use_frameworks!
target '' do
- pod 'Alamofire', '~> 4.5'
+ pod 'Alamofire', '~> 4.9'
end
```
@@ -108,17 +109,16 @@ $ pod install
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
-You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
+You can install Carthage with [Homebrew](https://brew.sh/) using the following command:
```bash
-$ brew update
$ brew install carthage
```
To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
-github "Alamofire/Alamofire" ~> 4.5
+github "Alamofire/Alamofire" ~> 4.9
```
Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project.
@@ -129,12 +129,22 @@ The [Swift Package Manager](https://swift.org/package-manager/) is a tool for au
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
+#### Swift 3
+
```swift
dependencies: [
.Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4)
]
```
+#### Swift 4
+
+```swift
+dependencies: [
+ .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0")
+]
+```
+
### Manually
If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually.
@@ -147,7 +157,7 @@ If you prefer not to use any of the aforementioned dependency managers, you can
$ git init
```
-- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command:
+- Add Alamofire as a git [submodule](https://git-scm.com/docs/git-submodule) by running the following command:
```bash
$ git submodule add https://github.com/Alamofire/Alamofire.git
@@ -173,1640 +183,6 @@ If you prefer not to use any of the aforementioned dependency managers, you can
> The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.
----
-
-## Usage
-
-### Making a Request
-
-```swift
-import Alamofire
-
-Alamofire.request("https://httpbin.org/get")
-```
-
-### Response Handling
-
-Handling the `Response` of a `Request` made in Alamofire involves chaining a response handler onto the `Request`.
-
-```swift
-Alamofire.request("https://httpbin.org/get").responseJSON { response in
- print("Request: \(String(describing: response.request))") // original url request
- print("Response: \(String(describing: response.response))") // http url response
- print("Result: \(response.result)") // response serialization result
-
- if let json = response.result.value {
- print("JSON: \(json)") // serialized json response
- }
-
- if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) {
- print("Data: \(utf8Text)") // original server data as UTF8 string
- }
-}
-```
-
-In the above example, the `responseJSON` handler is appended to the `Request` to be executed once the `Request` is complete. Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) in the form of a closure is specified to handle the response once it's received. The result of a request is only available inside the scope of a response closure. Any execution contingent on the response or data received from the server must be done within a response closure.
-
-> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way.
-
-Alamofire contains five different response handlers by default including:
-
-```swift
-// Response Handler - Unserialized Response
-func response(
- queue: DispatchQueue?,
- completionHandler: @escaping (DefaultDataResponse) -> Void)
- -> Self
-
-// Response Data Handler - Serialized into Data
-func responseData(
- queue: DispatchQueue?,
- completionHandler: @escaping (DataResponse) -> Void)
- -> Self
-
-// Response String Handler - Serialized into String
-func responseString(
- queue: DispatchQueue?,
- encoding: String.Encoding?,
- completionHandler: @escaping (DataResponse) -> Void)
- -> Self
-
-// Response JSON Handler - Serialized into Any
-func responseJSON(
- queue: DispatchQueue?,
- completionHandler: @escaping (DataResponse) -> Void)
- -> Self
-
-// Response PropertyList (plist) Handler - Serialized into Any
-func responsePropertyList(
- queue: DispatchQueue?,
- completionHandler: @escaping (DataResponse) -> Void))
- -> Self
-```
-
-None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server.
-
-> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this.
-
-#### Response Handler
-
-The `response` handler does NOT evaluate any of the response data. It merely forwards on all information directly from the URL session delegate. It is the Alamofire equivalent of using `cURL` to execute a `Request`.
-
-```swift
-Alamofire.request("https://httpbin.org/get").response { response in
- print("Request: \(response.request)")
- print("Response: \(response.response)")
- print("Error: \(response.error)")
-
- if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) {
- print("Data: \(utf8Text)")
- }
-}
-```
-
-> We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types.
-
-#### Response Data Handler
-
-The `responseData` handler uses the `responseDataSerializer` (the object that serializes the server data into some other type) to extract the `Data` returned by the server. If no errors occur and `Data` is returned, the response `Result` will be a `.success` and the `value` will be of type `Data`.
-
-```swift
-Alamofire.request("https://httpbin.org/get").responseData { response in
- debugPrint("All Response Info: \(response)")
-
- if let data = response.result.value, let utf8Text = String(data: data, encoding: .utf8) {
- print("Data: \(utf8Text)")
- }
-}
-```
-
-#### Response String Handler
-
-The `responseString` handler uses the `responseStringSerializer` to convert the `Data` returned by the server into a `String` with the specified encoding. If no errors occur and the server data is successfully serialized into a `String`, the response `Result` will be a `.success` and the `value` will be of type `String`.
-
-```swift
-Alamofire.request("https://httpbin.org/get").responseString { response in
- print("Success: \(response.result.isSuccess)")
- print("Response String: \(response.result.value)")
-}
-```
-
-> If no encoding is specified, Alamofire will use the text encoding specified in the `HTTPURLResponse` from the server. If the text encoding cannot be determined by the server response, it defaults to `.isoLatin1`.
-
-#### Response JSON Handler
-
-The `responseJSON` handler uses the `responseJSONSerializer` to convert the `Data` returned by the server into an `Any` type using the specified `JSONSerialization.ReadingOptions`. If no errors occur and the server data is successfully serialized into a JSON object, the response `Result` will be a `.success` and the `value` will be of type `Any`.
-
-```swift
-Alamofire.request("https://httpbin.org/get").responseJSON { response in
- debugPrint(response)
-
- if let json = response.result.value {
- print("JSON: \(json)")
- }
-}
-```
-
-> All JSON serialization is handled by the `JSONSerialization` API in the `Foundation` framework.
-
-#### Chained Response Handlers
-
-Response handlers can even be chained:
-
-```swift
-Alamofire.request("https://httpbin.org/get")
- .responseString { response in
- print("Response String: \(response.result.value)")
- }
- .responseJSON { response in
- print("Response JSON: \(response.result.value)")
- }
-```
-
-> It is important to note that using multiple response handlers on the same `Request` requires the server data to be serialized multiple times. Once for each response handler.
-
-#### Response Handler Queue
-
-Response handlers by default are executed on the main dispatch queue. However, a custom dispatch queue can be provided instead.
-
-```swift
-let utilityQueue = DispatchQueue.global(qos: .utility)
-
-Alamofire.request("https://httpbin.org/get").responseJSON(queue: utilityQueue) { response in
- print("Executing response handler on utility queue")
-}
-```
-
-### Response Validation
-
-By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type.
-
-#### Manual Validation
-
-```swift
-Alamofire.request("https://httpbin.org/get")
- .validate(statusCode: 200..<300)
- .validate(contentType: ["application/json"])
- .responseData { response in
- switch response.result {
- case .success:
- print("Validation Successful")
- case .failure(let error):
- print(error)
- }
- }
-```
-
-#### Automatic Validation
-
-Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided.
-
-```swift
-Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in
- switch response.result {
- case .success:
- print("Validation Successful")
- case .failure(let error):
- print(error)
- }
-}
-```
-
-### Response Caching
-
-Response Caching is handled on the system framework level by [`URLCache`](https://developer.apple.com/reference/foundation/urlcache). It provides a composite in-memory and on-disk cache and lets you manipulate the sizes of both the in-memory and on-disk portions.
-
-> By default, Alamofire leverages the shared `URLCache`. In order to customize it, see the [Session Manager Configurations](#session-manager) section.
-
-### HTTP Methods
-
-The `HTTPMethod` enumeration lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3):
-
-```swift
-public enum HTTPMethod: String {
- case options = "OPTIONS"
- case get = "GET"
- case head = "HEAD"
- case post = "POST"
- case put = "PUT"
- case patch = "PATCH"
- case delete = "DELETE"
- case trace = "TRACE"
- case connect = "CONNECT"
-}
-```
-
-These values can be passed as the `method` argument to the `Alamofire.request` API:
-
-```swift
-Alamofire.request("https://httpbin.org/get") // method defaults to `.get`
-
-Alamofire.request("https://httpbin.org/post", method: .post)
-Alamofire.request("https://httpbin.org/put", method: .put)
-Alamofire.request("https://httpbin.org/delete", method: .delete)
-```
-
-> The `Alamofire.request` method parameter defaults to `.get`.
-
-### Parameter Encoding
-
-Alamofire supports three types of parameter encoding including: `URL`, `JSON` and `PropertyList`. It can also support any custom encoding that conforms to the `ParameterEncoding` protocol.
-
-#### URL Encoding
-
-The `URLEncoding` type creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP body of the URL request. Whether the query string is set or appended to any existing URL query string or set as the HTTP body depends on the `Destination` of the encoding. The `Destination` enumeration has three cases:
-
-- `.methodDependent` - Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` requests and sets as the HTTP body for requests with any other HTTP method.
-- `.queryString` - Sets or appends encoded query string result to existing query string.
-- `.httpBody` - Sets encoded query string result as the HTTP body of the URL request.
-
-The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`).
-
-##### GET Request With URL-Encoded Parameters
-
-```swift
-let parameters: Parameters = ["foo": "bar"]
-
-// All three of these calls are equivalent
-Alamofire.request("https://httpbin.org/get", parameters: parameters) // encoding defaults to `URLEncoding.default`
-Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding.default)
-Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding(destination: .methodDependent))
-
-// https://httpbin.org/get?foo=bar
-```
-
-##### POST Request With URL-Encoded Parameters
-
-```swift
-let parameters: Parameters = [
- "foo": "bar",
- "baz": ["a", 1],
- "qux": [
- "x": 1,
- "y": 2,
- "z": 3
- ]
-]
-
-// All three of these calls are equivalent
-Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters)
-Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.default)
-Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.httpBody)
-
-// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3
-```
-
-#### JSON Encoding
-
-The `JSONEncoding` type creates a JSON representation of the parameters object, which is set as the HTTP body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`.
-
-##### POST Request with JSON-Encoded Parameters
-
-```swift
-let parameters: Parameters = [
- "foo": [1,2,3],
- "bar": [
- "baz": "qux"
- ]
-]
-
-// Both calls are equivalent
-Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding.default)
-Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding(options: []))
-
-// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}}
-```
-
-#### Property List Encoding
-
-The `PropertyListEncoding` uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`.
-
-#### Custom Encoding
-
-In the event that the provided `ParameterEncoding` types do not meet your needs, you can create your own custom encoding. Here's a quick example of how you could build a custom `JSONStringArrayEncoding` type to encode a JSON string array onto a `Request`.
-
-```swift
-struct JSONStringArrayEncoding: ParameterEncoding {
- private let array: [String]
-
- init(array: [String]) {
- self.array = array
- }
-
- func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
- var urlRequest = try urlRequest.asURLRequest()
-
- let data = try JSONSerialization.data(withJSONObject: array, options: [])
-
- if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil {
- urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
- }
-
- urlRequest.httpBody = data
-
- return urlRequest
- }
-}
-```
-
-#### Manual Parameter Encoding of a URLRequest
-
-The `ParameterEncoding` APIs can be used outside of making network requests.
-
-```swift
-let url = URL(string: "https://httpbin.org/get")!
-var urlRequest = URLRequest(url: url)
-
-let parameters: Parameters = ["foo": "bar"]
-let encodedURLRequest = try URLEncoding.queryString.encode(urlRequest, with: parameters)
-```
-
-### HTTP Headers
-
-Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing.
-
-```swift
-let headers: HTTPHeaders = [
- "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
- "Accept": "application/json"
-]
-
-Alamofire.request("https://httpbin.org/headers", headers: headers).responseJSON { response in
- debugPrint(response)
-}
-```
-
-> For HTTP headers that do not change, it is recommended to set them on the `URLSessionConfiguration` so they are automatically applied to any `URLSessionTask` created by the underlying `URLSession`. For more information, see the [Session Manager Configurations](#session-manager) section.
-
-The default Alamofire `SessionManager` provides a default set of headers for every `Request`. These include:
-
-- `Accept-Encoding`, which defaults to `gzip;q=1.0, compress;q=0.5`, per [RFC 7230 §4.2.3](https://tools.ietf.org/html/rfc7230#section-4.2.3).
-- `Accept-Language`, which defaults to up to the top 6 preferred languages on the system, formatted like `en;q=1.0`, per [RFC 7231 §5.3.5](https://tools.ietf.org/html/rfc7231#section-5.3.5).
-- `User-Agent`, which contains versioning information about the current app. For example: `iOS Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0`, per [RFC 7231 §5.5.3](https://tools.ietf.org/html/rfc7231#section-5.5.3).
-
-If you need to customize these headers, a custom `URLSessionConfiguration` should be created, the `defaultHTTPHeaders` property updated and the configuration applied to a new `SessionManager` instance.
-
-### Authentication
-
-Authentication is handled on the system framework level by [`URLCredential`](https://developer.apple.com/reference/foundation/nsurlcredential) and [`URLAuthenticationChallenge`](https://developer.apple.com/reference/foundation/urlauthenticationchallenge).
-
-**Supported Authentication Schemes**
-
-- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication)
-- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication)
-- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29)
-- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager)
-
-#### HTTP Basic Authentication
-
-The `authenticate` method on a `Request` will automatically provide a `URLCredential` to a `URLAuthenticationChallenge` when appropriate:
-
-```swift
-let user = "user"
-let password = "password"
-
-Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)")
- .authenticate(user: user, password: password)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-Depending upon your server implementation, an `Authorization` header may also be appropriate:
-
-```swift
-let user = "user"
-let password = "password"
-
-var headers: HTTPHeaders = [:]
-
-if let authorizationHeader = Request.authorizationHeader(user: user, password: password) {
- headers[authorizationHeader.key] = authorizationHeader.value
-}
-
-Alamofire.request("https://httpbin.org/basic-auth/user/password", headers: headers)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-#### Authentication with URLCredential
-
-```swift
-let user = "user"
-let password = "password"
-
-let credential = URLCredential(user: user, password: password, persistence: .forSession)
-
-Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)")
- .authenticate(usingCredential: credential)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-> It is important to note that when using a `URLCredential` for authentication, the underlying `URLSession` will actually end up making two requests if a challenge is issued by the server. The first request will not include the credential which "may" trigger a challenge from the server. The challenge is then received by Alamofire, the credential is appended and the request is retried by the underlying `URLSession`.
-
-### Downloading Data to a File
-
-Requests made in Alamofire that fetch data from a server can download the data in-memory or on-disk. The `Alamofire.request` APIs used in all the examples so far always downloads the server data in-memory. This is great for smaller payloads because it's more efficient, but really bad for larger payloads because the download could run your entire application out-of-memory. Because of this, you can also use the `Alamofire.download` APIs to download the server data to a temporary file on-disk.
-
-> This will only work on `macOS` as is. Other platforms don't allow access to the filesystem outside of your app's sandbox. To download files on other platforms, see the [Download File Destination](#download-file-destination) section.
-
-```swift
-Alamofire.download("https://httpbin.org/image/png").responseData { response in
- if let data = response.result.value {
- let image = UIImage(data: data)
- }
-}
-```
-
-> The `Alamofire.download` APIs should also be used if you need to download data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section.
-
-#### Download File Destination
-
-You can also provide a `DownloadFileDestination` closure to move the file from the temporary directory to a final destination. Before the temporary file is actually moved to the `destinationURL`, the `DownloadOptions` specified in the closure will be executed. The two currently supported `DownloadOptions` are:
-
-- `.createIntermediateDirectories` - Creates intermediate directories for the destination URL if specified.
-- `.removePreviousFile` - Removes a previous file from the destination URL if specified.
-
-```swift
-let destination: DownloadRequest.DownloadFileDestination = { _, _ in
- let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
- let fileURL = documentsURL.appendingPathComponent("pig.png")
-
- return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
-}
-
-Alamofire.download(urlString, to: destination).response { response in
- print(response)
-
- if response.error == nil, let imagePath = response.destinationURL?.path {
- let image = UIImage(contentsOfFile: imagePath)
- }
-}
-```
-
-You can also use the suggested download destination API.
-
-```swift
-let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory)
-Alamofire.download("https://httpbin.org/image/png", to: destination)
-```
-
-#### Download Progress
-
-Many times it can be helpful to report download progress to the user. Any `DownloadRequest` can report download progress using the `downloadProgress` API.
-
-```swift
-Alamofire.download("https://httpbin.org/image/png")
- .downloadProgress { progress in
- print("Download Progress: \(progress.fractionCompleted)")
- }
- .responseData { response in
- if let data = response.result.value {
- let image = UIImage(data: data)
- }
- }
-```
-
-The `downloadProgress` API also takes a `queue` parameter which defines which `DispatchQueue` the download progress closure should be called on.
-
-```swift
-let utilityQueue = DispatchQueue.global(qos: .utility)
-
-Alamofire.download("https://httpbin.org/image/png")
- .downloadProgress(queue: utilityQueue) { progress in
- print("Download Progress: \(progress.fractionCompleted)")
- }
- .responseData { response in
- if let data = response.result.value {
- let image = UIImage(data: data)
- }
- }
-```
-
-#### Resuming a Download
-
-If a `DownloadRequest` is cancelled or interrupted, the underlying URL session may generate resume data for the active `DownloadRequest`. If this happens, the resume data can be re-used to restart the `DownloadRequest` where it left off. The resume data can be accessed through the download response, then reused when trying to restart the request.
-
-> **IMPORTANT:** On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the data is written incorrectly and will always fail to resume the download. For more information about the bug and possible workarounds, please see this Stack Overflow [post](http://stackoverflow.com/a/39347461/1342462).
-
-```swift
-class ImageRequestor {
- private var resumeData: Data?
- private var image: UIImage?
-
- func fetchImage(completion: (UIImage?) -> Void) {
- guard image == nil else { completion(image) ; return }
-
- let destination: DownloadRequest.DownloadFileDestination = { _, _ in
- let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
- let fileURL = documentsURL.appendingPathComponent("pig.png")
-
- return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
- }
-
- let request: DownloadRequest
-
- if let resumeData = resumeData {
- request = Alamofire.download(resumingWith: resumeData)
- } else {
- request = Alamofire.download("https://httpbin.org/image/png")
- }
-
- request.responseData { response in
- switch response.result {
- case .success(let data):
- self.image = UIImage(data: data)
- case .failure:
- self.resumeData = response.resumeData
- }
- }
- }
-}
-```
-
-### Uploading Data to a Server
-
-When sending relatively small amounts of data to a server using JSON or URL encoded parameters, the `Alamofire.request` APIs are usually sufficient. If you need to send much larger amounts of data from a file URL or an `InputStream`, then the `Alamofire.upload` APIs are what you want to use.
-
-> The `Alamofire.upload` APIs should also be used if you need to upload data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section.
-
-#### Uploading Data
-
-```swift
-let imageData = UIImagePNGRepresentation(image)!
-
-Alamofire.upload(imageData, to: "https://httpbin.org/post").responseJSON { response in
- debugPrint(response)
-}
-```
-
-#### Uploading a File
-
-```swift
-let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov")
-
-Alamofire.upload(fileURL, to: "https://httpbin.org/post").responseJSON { response in
- debugPrint(response)
-}
-```
-
-#### Uploading Multipart Form Data
-
-```swift
-Alamofire.upload(
- multipartFormData: { multipartFormData in
- multipartFormData.append(unicornImageURL, withName: "unicorn")
- multipartFormData.append(rainbowImageURL, withName: "rainbow")
- },
- to: "https://httpbin.org/post",
- encodingCompletion: { encodingResult in
- switch encodingResult {
- case .success(let upload, _, _):
- upload.responseJSON { response in
- debugPrint(response)
- }
- case .failure(let encodingError):
- print(encodingError)
- }
- }
-)
-```
-
-#### Upload Progress
-
-While your user is waiting for their upload to complete, sometimes it can be handy to show the progress of the upload to the user. Any `UploadRequest` can report both upload progress and download progress of the response data using the `uploadProgress` and `downloadProgress` APIs.
-
-```swift
-let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov")
-
-Alamofire.upload(fileURL, to: "https://httpbin.org/post")
- .uploadProgress { progress in // main queue by default
- print("Upload Progress: \(progress.fractionCompleted)")
- }
- .downloadProgress { progress in // main queue by default
- print("Download Progress: \(progress.fractionCompleted)")
- }
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-### Statistical Metrics
-
-#### Timeline
-
-Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on all response types.
-
-```swift
-Alamofire.request("https://httpbin.org/get").responseJSON { response in
- print(response.timeline)
-}
-```
-
-The above reports the following `Timeline` info:
-
-- `Latency`: 0.428 seconds
-- `Request Duration`: 0.428 seconds
-- `Serialization Duration`: 0.001 seconds
-- `Total Duration`: 0.429 seconds
-
-#### URL Session Task Metrics
-
-In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetrics](https://developer.apple.com/reference/foundation/urlsessiontaskmetrics) APIs. The task metrics encapsulate some fantastic statistical information about the request and response execution. The API is very similar to the `Timeline`, but provides many more statistics that Alamofire doesn't have access to compute. The metrics can be accessed through any response type.
-
-```swift
-Alamofire.request("https://httpbin.org/get").responseJSON { response in
- print(response.metrics)
-}
-```
-
-It's important to note that these APIs are only available on iOS and tvOS 10 and macOS 10.12. Therefore, depending on your deployment target, you may need to use these inside availability checks:
-
-```swift
-Alamofire.request("https://httpbin.org/get").responseJSON { response in
- if #available(iOS 10.0, *) {
- print(response.metrics)
- }
-}
-```
-
-### cURL Command Output
-
-Debugging platform issues can be frustrating. Thankfully, Alamofire `Request` objects conform to both the `CustomStringConvertible` and `CustomDebugStringConvertible` protocols to provide some VERY helpful debugging tools.
-
-#### CustomStringConvertible
-
-```swift
-let request = Alamofire.request("https://httpbin.org/ip")
-
-print(request)
-// GET https://httpbin.org/ip (200)
-```
-
-#### CustomDebugStringConvertible
-
-```swift
-let request = Alamofire.request("https://httpbin.org/get", parameters: ["foo": "bar"])
-debugPrint(request)
-```
-
-Outputs:
-
-```bash
-$ curl -i \
- -H "User-Agent: Alamofire/4.0.0" \
- -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \
- -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \
- "https://httpbin.org/get?foo=bar"
-```
-
----
-
-## Advanced Usage
-
-Alamofire is built on `URLSession` and the Foundation URL Loading System. To make the most of this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack.
-
-**Recommended Reading**
-
-- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html)
-- [URLSession Class Reference](https://developer.apple.com/reference/foundation/nsurlsession)
-- [URLCache Class Reference](https://developer.apple.com/reference/foundation/urlcache)
-- [URLAuthenticationChallenge Class Reference](https://developer.apple.com/reference/foundation/urlauthenticationchallenge)
-
-### Session Manager
-
-Top-level convenience methods like `Alamofire.request` use a default instance of `Alamofire.SessionManager`, which is configured with the default `URLSessionConfiguration`.
-
-As such, the following two statements are equivalent:
-
-```swift
-Alamofire.request("https://httpbin.org/get")
-```
-
-```swift
-let sessionManager = Alamofire.SessionManager.default
-sessionManager.request("https://httpbin.org/get")
-```
-
-Applications can create session managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`httpAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`).
-
-#### Creating a Session Manager with Default Configuration
-
-```swift
-let configuration = URLSessionConfiguration.default
-let sessionManager = Alamofire.SessionManager(configuration: configuration)
-```
-
-#### Creating a Session Manager with Background Configuration
-
-```swift
-let configuration = URLSessionConfiguration.background(withIdentifier: "com.example.app.background")
-let sessionManager = Alamofire.SessionManager(configuration: configuration)
-```
-
-#### Creating a Session Manager with Ephemeral Configuration
-
-```swift
-let configuration = URLSessionConfiguration.ephemeral
-let sessionManager = Alamofire.SessionManager(configuration: configuration)
-```
-
-#### Modifying the Session Configuration
-
-```swift
-var defaultHeaders = Alamofire.SessionManager.defaultHTTPHeaders
-defaultHeaders["DNT"] = "1 (Do Not Track Enabled)"
-
-let configuration = URLSessionConfiguration.default
-configuration.httpAdditionalHeaders = defaultHeaders
-
-let sessionManager = Alamofire.SessionManager(configuration: configuration)
-```
-
-> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use the `headers` parameter in the top-level `Alamofire.request` APIs, `URLRequestConvertible` and `ParameterEncoding`, respectively.
-
-### Session Delegate
-
-By default, an Alamofire `SessionManager` instance creates a `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `URLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons.
-
-#### Override Closures
-
-The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available:
-
-```swift
-/// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`.
-open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))?
-
-/// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`.
-open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)?
-
-/// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`.
-open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)?
-
-/// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`.
-open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)?
-```
-
-The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains.
-
-```swift
-let sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default)
-let delegate: Alamofire.SessionDelegate = sessionManager.delegate
-
-delegate.taskWillPerformHTTPRedirection = { session, task, response, request in
- var finalRequest = request
-
- if
- let originalRequest = task.originalRequest,
- let urlString = originalRequest.url?.urlString,
- urlString.contains("apple.com")
- {
- finalRequest = originalRequest
- }
-
- return finalRequest
-}
-```
-
-#### Subclassing
-
-Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs.
-
-```swift
-class LoggingSessionDelegate: SessionDelegate {
- override func urlSession(
- _ session: URLSession,
- task: URLSessionTask,
- willPerformHTTPRedirection response: HTTPURLResponse,
- newRequest request: URLRequest,
- completionHandler: @escaping (URLRequest?) -> Void)
- {
- print("URLSession will perform HTTP redirection to request: \(request)")
-
- super.urlSession(
- session,
- task: task,
- willPerformHTTPRedirection: response,
- newRequest: request,
- completionHandler: completionHandler
- )
- }
-}
-```
-
-Generally speaking, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort.
-
-> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks.
-
-### Request
-
-The result of a `request`, `download`, `upload` or `stream` methods are a `DataRequest`, `DownloadRequest`, `UploadRequest` and `StreamRequest` which all inherit from `Request`. All `Request` instances are always created by an owning session manager, and never initialized directly.
-
-Each subclass has specialized methods such as `authenticate`, `validate`, `responseJSON` and `uploadProgress` that each return the caller instance in order to facilitate method chaining.
-
-Requests can be suspended, resumed and cancelled:
-
-- `suspend()`: Suspends the underlying task and dispatch queue.
-- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start.
-- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers.
-
-### Routing Requests
-
-As apps grow in size, it's important to adopt common patterns as you build out your network stack. An important part of that design is how to route your requests. The Alamofire `URLConvertible` and `URLRequestConvertible` protocols along with the `Router` design pattern are here to help.
-
-#### URLConvertible
-
-Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct URL requests internally. `String`, `URL`, and `URLComponents` conform to `URLConvertible` by default, allowing any of them to be passed as `url` parameters to the `request`, `upload`, and `download` methods:
-
-```swift
-let urlString = "https://httpbin.org/post"
-Alamofire.request(urlString, method: .post)
-
-let url = URL(string: urlString)!
-Alamofire.request(url, method: .post)
-
-let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)!
-Alamofire.request(urlComponents, method: .post)
-```
-
-Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLConvertible` as a convenient way to map domain-specific models to server resources.
-
-##### Type-Safe Routing
-
-```swift
-extension User: URLConvertible {
- static let baseURLString = "https://example.com"
-
- func asURL() throws -> URL {
- let urlString = User.baseURLString + "/users/\(username)/"
- return try urlString.asURL()
- }
-}
-```
-
-```swift
-let user = User(username: "mattt")
-Alamofire.request(user) // https://example.com/users/mattt
-```
-
-#### URLRequestConvertible
-
-Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `URLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests):
-
-```swift
-let url = URL(string: "https://httpbin.org/post")!
-var urlRequest = URLRequest(url: url)
-urlRequest.httpMethod = "POST"
-
-let parameters = ["foo": "bar"]
-
-do {
- urlRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: [])
-} catch {
- // No-op
-}
-
-urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
-
-Alamofire.request(urlRequest)
-```
-
-Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state.
-
-##### API Parameter Abstraction
-
-```swift
-enum Router: URLRequestConvertible {
- case search(query: String, page: Int)
-
- static let baseURLString = "https://example.com"
- static let perPage = 50
-
- // MARK: URLRequestConvertible
-
- func asURLRequest() throws -> URLRequest {
- let result: (path: String, parameters: Parameters) = {
- switch self {
- case let .search(query, page) where page > 0:
- return ("/search", ["q": query, "offset": Router.perPage * page])
- case let .search(query, _):
- return ("/search", ["q": query])
- }
- }()
-
- let url = try Router.baseURLString.asURL()
- let urlRequest = URLRequest(url: url.appendingPathComponent(result.path))
-
- return try URLEncoding.default.encode(urlRequest, with: result.parameters)
- }
-}
-```
-
-```swift
-Alamofire.request(Router.search(query: "foo bar", page: 1)) // https://example.com/search?q=foo%20bar&offset=50
-```
-
-##### CRUD & Authorization
-
-```swift
-import Alamofire
-
-enum Router: URLRequestConvertible {
- case createUser(parameters: Parameters)
- case readUser(username: String)
- case updateUser(username: String, parameters: Parameters)
- case destroyUser(username: String)
-
- static let baseURLString = "https://example.com"
-
- var method: HTTPMethod {
- switch self {
- case .createUser:
- return .post
- case .readUser:
- return .get
- case .updateUser:
- return .put
- case .destroyUser:
- return .delete
- }
- }
-
- var path: String {
- switch self {
- case .createUser:
- return "/users"
- case .readUser(let username):
- return "/users/\(username)"
- case .updateUser(let username, _):
- return "/users/\(username)"
- case .destroyUser(let username):
- return "/users/\(username)"
- }
- }
-
- // MARK: URLRequestConvertible
-
- func asURLRequest() throws -> URLRequest {
- let url = try Router.baseURLString.asURL()
-
- var urlRequest = URLRequest(url: url.appendingPathComponent(path))
- urlRequest.httpMethod = method.rawValue
-
- switch self {
- case .createUser(let parameters):
- urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters)
- case .updateUser(_, let parameters):
- urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters)
- default:
- break
- }
-
- return urlRequest
- }
-}
-```
-
-```swift
-Alamofire.request(Router.readUser("mattt")) // GET https://example.com/users/mattt
-```
-
-### Adapting and Retrying Requests
-
-Most web services these days are behind some sort of authentication system. One of the more common ones today is OAuth. This generally involves generating an access token authorizing your application or user to call the various supported web services. While creating these initial access tokens can be laborsome, it can be even more complicated when your access token expires and you need to fetch a new one. There are many thread-safety issues that need to be considered.
-
-The `RequestAdapter` and `RequestRetrier` protocols were created to make it much easier to create a thread-safe authentication system for a specific set of web services.
-
-#### RequestAdapter
-
-The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` to be inspected and adapted before being created. One very specific way to use an adapter is to append an `Authorization` header to requests behind a certain type of authentication.
-
-```swift
-class AccessTokenAdapter: RequestAdapter {
- private let accessToken: String
-
- init(accessToken: String) {
- self.accessToken = accessToken
- }
-
- func adapt(_ urlRequest: URLRequest) throws -> URLRequest {
- var urlRequest = urlRequest
-
- if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") {
- urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization")
- }
-
- return urlRequest
- }
-}
-```
-
-```swift
-let sessionManager = SessionManager()
-sessionManager.adapter = AccessTokenAdapter(accessToken: "1234")
-
-sessionManager.request("https://httpbin.org/get")
-```
-
-#### RequestRetrier
-
-The `RequestRetrier` protocol allows a `Request` that encountered an `Error` while being executed to be retried. When using both the `RequestAdapter` and `RequestRetrier` protocols together, you can create credential refresh systems for OAuth1, OAuth2, Basic Auth and even exponential backoff retry policies. The possibilities are endless. Here's an example of how you could implement a refresh flow for OAuth2 access tokens.
-
-> **DISCLAIMER:** This is **NOT** a global `OAuth2` solution. It is merely an example demonstrating how one could use the `RequestAdapter` in conjunction with the `RequestRetrier` to create a thread-safe refresh system.
-
-> To reiterate, **do NOT copy** this sample code and drop it into a production application. This is merely an example. Each authentication system must be tailored to a particular platform and authentication type.
-
-```swift
-class OAuth2Handler: RequestAdapter, RequestRetrier {
- private typealias RefreshCompletion = (_ succeeded: Bool, _ accessToken: String?, _ refreshToken: String?) -> Void
-
- private let sessionManager: SessionManager = {
- let configuration = URLSessionConfiguration.default
- configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders
-
- return SessionManager(configuration: configuration)
- }()
-
- private let lock = NSLock()
-
- private var clientID: String
- private var baseURLString: String
- private var accessToken: String
- private var refreshToken: String
-
- private var isRefreshing = false
- private var requestsToRetry: [RequestRetryCompletion] = []
-
- // MARK: - Initialization
-
- public init(clientID: String, baseURLString: String, accessToken: String, refreshToken: String) {
- self.clientID = clientID
- self.baseURLString = baseURLString
- self.accessToken = accessToken
- self.refreshToken = refreshToken
- }
-
- // MARK: - RequestAdapter
-
- func adapt(_ urlRequest: URLRequest) throws -> URLRequest {
- if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix(baseURLString) {
- var urlRequest = urlRequest
- urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization")
- return urlRequest
- }
-
- return urlRequest
- }
-
- // MARK: - RequestRetrier
-
- func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) {
- lock.lock() ; defer { lock.unlock() }
-
- if let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401 {
- requestsToRetry.append(completion)
-
- if !isRefreshing {
- refreshTokens { [weak self] succeeded, accessToken, refreshToken in
- guard let strongSelf = self else { return }
-
- strongSelf.lock.lock() ; defer { strongSelf.lock.unlock() }
-
- if let accessToken = accessToken, let refreshToken = refreshToken {
- strongSelf.accessToken = accessToken
- strongSelf.refreshToken = refreshToken
- }
-
- strongSelf.requestsToRetry.forEach { $0(succeeded, 0.0) }
- strongSelf.requestsToRetry.removeAll()
- }
- }
- } else {
- completion(false, 0.0)
- }
- }
-
- // MARK: - Private - Refresh Tokens
-
- private func refreshTokens(completion: @escaping RefreshCompletion) {
- guard !isRefreshing else { return }
-
- isRefreshing = true
-
- let urlString = "\(baseURLString)/oauth2/token"
-
- let parameters: [String: Any] = [
- "access_token": accessToken,
- "refresh_token": refreshToken,
- "client_id": clientID,
- "grant_type": "refresh_token"
- ]
-
- sessionManager.request(urlString, method: .post, parameters: parameters, encoding: JSONEncoding.default)
- .responseJSON { [weak self] response in
- guard let strongSelf = self else { return }
-
- if
- let json = response.result.value as? [String: Any],
- let accessToken = json["access_token"] as? String,
- let refreshToken = json["refresh_token"] as? String
- {
- completion(true, accessToken, refreshToken)
- } else {
- completion(false, nil, nil)
- }
-
- strongSelf.isRefreshing = false
- }
- }
-}
-```
-
-```swift
-let baseURLString = "https://some.domain-behind-oauth2.com"
-
-let oauthHandler = OAuth2Handler(
- clientID: "12345678",
- baseURLString: baseURLString,
- accessToken: "abcd1234",
- refreshToken: "ef56789a"
-)
-
-let sessionManager = SessionManager()
-sessionManager.adapter = oauthHandler
-sessionManager.retrier = oauthHandler
-
-let urlString = "\(baseURLString)/some/endpoint"
-
-sessionManager.request(urlString).validate().responseJSON { response in
- debugPrint(response)
-}
-```
-
-Once the `OAuth2Handler` is applied as both the `adapter` and `retrier` for the `SessionManager`, it will handle an invalid access token error by automatically refreshing the access token and retrying all failed requests in the same order they failed.
-
-> If you needed them to execute in the same order they were created, you could sort them by their task identifiers.
-
-The example above only checks for a `401` response code which is not nearly robust enough, but does demonstrate how one could check for an invalid access token error. In a production application, one would want to check the `realm` and most likely the `www-authenticate` header response although it depends on the OAuth2 implementation.
-
-Another important note is that this authentication system could be shared between multiple session managers. For example, you may need to use both a `default` and `ephemeral` session configuration for the same set of web services. The example above allows the same `oauthHandler` instance to be shared across multiple session managers to manage the single refresh flow.
-
-### Custom Response Serialization
-
-Alamofire provides built-in response serialization for data, strings, JSON, and property lists:
-
-```swift
-Alamofire.request(...).responseData { (resp: DataResponse) in ... }
-Alamofire.request(...).responseString { (resp: DataResponse) in ... }
-Alamofire.request(...).responseJSON { (resp: DataResponse) in ... }
-Alamofire.request(...).responsePropertyList { resp: DataResponse) in ... }
-```
-
-Those responses wrap deserialized *values* (Data, String, Any) or *errors* (network, validation errors), as well as *meta-data* (URL request, HTTP headers, status code, [metrics](#statistical-metrics), ...).
-
-You have several ways to customize all of those response elements:
-
-- [Response Mapping](#response-mapping)
-- [Handling Errors](#handling-errors)
-- [Creating a Custom Response Serializer](#creating-a-custom-response-serializer)
-- [Generic Response Object Serialization](#generic-response-object-serialization)
-
-#### Response Mapping
-
-Response mapping is the simplest way to produce customized responses. It transforms the value of a response, while preserving eventual errors and meta-data. For example, you can turn a json response `DataResponse` into a response that holds an application model, such as `DataResponse`. You perform response mapping with the `DataResponse.map` method:
-
-```swift
-Alamofire.request("https://example.com/users/mattt").responseJSON { (response: DataResponse) in
- let userResponse = response.map { json in
- // We assume an existing User(json: Any) initializer
- return User(json: json)
- }
-
- // Process userResponse, of type DataResponse:
- if let user = userResponse.value {
- print("User: { username: \(user.username), name: \(user.name) }")
- }
-}
-```
-
-When the transformation may throw an error, use `flatMap` instead:
-
-```swift
-Alamofire.request("https://example.com/users/mattt").responseJSON { response in
- let userResponse = response.flatMap { json in
- try User(json: json)
- }
-}
-```
-
-Response mapping is a good fit for your custom completion handlers:
-
-```swift
-@discardableResult
-func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest {
- return Alamofire.request("https://example.com/users/mattt").responseJSON { response in
- let userResponse = response.flatMap { json in
- try User(json: json)
- }
-
- completionHandler(userResponse)
- }
-}
-
-loadUser { response in
- if let user = response.value {
- print("User: { username: \(user.username), name: \(user.name) }")
- }
-}
-```
-
-When the map/flatMap closure may process a big amount of data, make sure you execute it outside of the main thread:
-
-```swift
-@discardableResult
-func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest {
- let utilityQueue = DispatchQueue.global(qos: .utility)
-
- return Alamofire.request("https://example.com/users/mattt").responseJSON(queue: utilityQueue) { response in
- let userResponse = response.flatMap { json in
- try User(json: json)
- }
-
- DispatchQueue.main.async {
- completionHandler(userResponse)
- }
- }
-}
-```
-
-`map` and `flatMap` are also available for [download responses](#downloading-data-to-a-file).
-
-#### Handling Errors
-
-Before implementing custom response serializers or object serialization methods, it's important to consider how to handle any errors that may occur. There are two basic options: passing existing errors along unmodified, to be dealt with at response time; or, wrapping all errors in an `Error` type specific to your app.
-
-For example, here's a simple `BackendError` enum which will be used in later examples:
-
-```swift
-enum BackendError: Error {
- case network(error: Error) // Capture any underlying Error from the URLSession API
- case dataSerialization(error: Error)
- case jsonSerialization(error: Error)
- case xmlSerialization(error: Error)
- case objectSerialization(reason: String)
-}
-```
-
-#### Creating a Custom Response Serializer
-
-Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.DataRequest` and / or `Alamofire.DownloadRequest`.
-
-For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented:
-
-```swift
-extension DataRequest {
- static func xmlResponseSerializer() -> DataResponseSerializer {
- return DataResponseSerializer { request, response, data, error in
- // Pass through any underlying URLSession error to the .network case.
- guard error == nil else { return .failure(BackendError.network(error: error!)) }
-
- // Use Alamofire's existing data serializer to extract the data, passing the error as nil, as it has
- // already been handled.
- let result = Request.serializeResponseData(response: response, data: data, error: nil)
-
- guard case let .success(validData) = result else {
- return .failure(BackendError.dataSerialization(error: result.error! as! AFError))
- }
-
- do {
- let xml = try ONOXMLDocument(data: validData)
- return .success(xml)
- } catch {
- return .failure(BackendError.xmlSerialization(error: error))
- }
- }
- }
-
- @discardableResult
- func responseXMLDocument(
- queue: DispatchQueue? = nil,
- completionHandler: @escaping (DataResponse) -> Void)
- -> Self
- {
- return response(
- queue: queue,
- responseSerializer: DataRequest.xmlResponseSerializer(),
- completionHandler: completionHandler
- )
- }
-}
-```
-
-#### Generic Response Object Serialization
-
-Generics can be used to provide automatic, type-safe response object serialization.
-
-```swift
-protocol ResponseObjectSerializable {
- init?(response: HTTPURLResponse, representation: Any)
-}
-
-extension DataRequest {
- func responseObject(
- queue: DispatchQueue? = nil,
- completionHandler: @escaping (DataResponse) -> Void)
- -> Self
- {
- let responseSerializer = DataResponseSerializer { request, response, data, error in
- guard error == nil else { return .failure(BackendError.network(error: error!)) }
-
- let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments)
- let result = jsonResponseSerializer.serializeResponse(request, response, data, nil)
-
- guard case let .success(jsonObject) = result else {
- return .failure(BackendError.jsonSerialization(error: result.error!))
- }
-
- guard let response = response, let responseObject = T(response: response, representation: jsonObject) else {
- return .failure(BackendError.objectSerialization(reason: "JSON could not be serialized: \(jsonObject)"))
- }
-
- return .success(responseObject)
- }
-
- return response(queue: queue, responseSerializer: responseSerializer, completionHandler: completionHandler)
- }
-}
-```
-
-```swift
-struct User: ResponseObjectSerializable, CustomStringConvertible {
- let username: String
- let name: String
-
- var description: String {
- return "User: { username: \(username), name: \(name) }"
- }
-
- init?(response: HTTPURLResponse, representation: Any) {
- guard
- let username = response.url?.lastPathComponent,
- let representation = representation as? [String: Any],
- let name = representation["name"] as? String
- else { return nil }
-
- self.username = username
- self.name = name
- }
-}
-```
-
-```swift
-Alamofire.request("https://example.com/users/mattt").responseObject { (response: DataResponse) in
- debugPrint(response)
-
- if let user = response.result.value {
- print("User: { username: \(user.username), name: \(user.name) }")
- }
-}
-```
-
-The same approach can also be used to handle endpoints that return a representation of a collection of objects:
-
-```swift
-protocol ResponseCollectionSerializable {
- static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self]
-}
-
-extension ResponseCollectionSerializable where Self: ResponseObjectSerializable {
- static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] {
- var collection: [Self] = []
-
- if let representation = representation as? [[String: Any]] {
- for itemRepresentation in representation {
- if let item = Self(response: response, representation: itemRepresentation) {
- collection.append(item)
- }
- }
- }
-
- return collection
- }
-}
-```
-
-```swift
-extension DataRequest {
- @discardableResult
- func responseCollection(
- queue: DispatchQueue? = nil,
- completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self
- {
- let responseSerializer = DataResponseSerializer<[T]> { request, response, data, error in
- guard error == nil else { return .failure(BackendError.network(error: error!)) }
-
- let jsonSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments)
- let result = jsonSerializer.serializeResponse(request, response, data, nil)
-
- guard case let .success(jsonObject) = result else {
- return .failure(BackendError.jsonSerialization(error: result.error!))
- }
-
- guard let response = response else {
- let reason = "Response collection could not be serialized due to nil response."
- return .failure(BackendError.objectSerialization(reason: reason))
- }
-
- return .success(T.collection(from: response, withRepresentation: jsonObject))
- }
-
- return response(responseSerializer: responseSerializer, completionHandler: completionHandler)
- }
-}
-```
-
-```swift
-struct User: ResponseObjectSerializable, ResponseCollectionSerializable, CustomStringConvertible {
- let username: String
- let name: String
-
- var description: String {
- return "User: { username: \(username), name: \(name) }"
- }
-
- init?(response: HTTPURLResponse, representation: Any) {
- guard
- let username = response.url?.lastPathComponent,
- let representation = representation as? [String: Any],
- let name = representation["name"] as? String
- else { return nil }
-
- self.username = username
- self.name = name
- }
-}
-```
-
-```swift
-Alamofire.request("https://example.com/users").responseCollection { (response: DataResponse<[User]>) in
- debugPrint(response)
-
- if let users = response.result.value {
- users.forEach { print("- \($0)") }
- }
-}
-```
-
-### Security
-
-Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`.
-
-#### ServerTrustPolicy
-
-The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `URLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection.
-
-```swift
-let serverTrustPolicy = ServerTrustPolicy.pinCertificates(
- certificates: ServerTrustPolicy.certificates(),
- validateCertificateChain: true,
- validateHost: true
-)
-```
-
-There are many different cases of server trust evaluation giving you complete control over the validation process:
-
-* `performDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge.
-* `pinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates.
-* `pinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys.
-* `disableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid.
-* `customEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution.
-
-#### Server Trust Policy Manager
-
-The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy.
-
-```swift
-let serverTrustPolicies: [String: ServerTrustPolicy] = [
- "test.example.com": .pinCertificates(
- certificates: ServerTrustPolicy.certificates(),
- validateCertificateChain: true,
- validateHost: true
- ),
- "insecure.expired-apis.com": .disableEvaluation
-]
-
-let sessionManager = SessionManager(
- serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies)
-)
-```
-
-> Make sure to keep a reference to the new `SessionManager` instance, otherwise your requests will all get cancelled when your `sessionManager` is deallocated.
-
-These server trust policies will result in the following behavior:
-
-- `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed:
- - Certificate chain MUST be valid.
- - Certificate chain MUST include one of the pinned certificates.
- - Challenge host MUST match the host in the certificate chain's leaf certificate.
-- `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed.
-- All other hosts will use the default evaluation provided by Apple.
-
-##### Subclassing Server Trust Policy Manager
-
-If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation.
-
-```swift
-class CustomServerTrustPolicyManager: ServerTrustPolicyManager {
- override func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? {
- var policy: ServerTrustPolicy?
-
- // Implement your custom domain matching behavior...
-
- return policy
- }
-}
-```
-
-#### Validating the Host
-
-The `.performDefaultEvaluation`, `.pinCertificates` and `.pinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate.
-
-> It is recommended that `validateHost` always be set to `true` in production environments.
-
-#### Validating the Certificate Chain
-
-Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check.
-
-There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server.
-
-> It is recommended that `validateCertificateChain` always be set to `true` in production environments.
-
-#### App Transport Security
-
-With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust.
-
-If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`.
-
-```xml
-
- NSAppTransportSecurity
-
- NSExceptionDomains
-
- example.com
-
- NSExceptionAllowsInsecureHTTPLoads
-
- NSExceptionRequiresForwardSecrecy
-
- NSIncludesSubdomains
-
-
- NSTemporaryExceptionMinimumTLSVersion
- TLSv1.2
-
-
-
-
-```
-
-Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`.
-
-> It is recommended to always use valid certificates in production environments.
-
-### Network Reachability
-
-The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces.
-
-```swift
-let manager = NetworkReachabilityManager(host: "www.apple.com")
-
-manager?.listener = { status in
- print("Network Status Changed: \(status)")
-}
-
-manager?.startListening()
-```
-
-> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported.
-> Also, do not include the scheme in the `host` string or reachability won't function correctly.
-
-There are some important things to remember when using network reachability to determine what to do next.
-
-- **Do NOT** use Reachability to determine if a network request should be sent.
- - You should **ALWAYS** send it.
-- When Reachability is restored, use the event to retry failed network requests.
- - Even though the network requests may still fail, this is a good moment to retry them.
-- The network reachability status can be useful for determining why a network request may have failed.
- - If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out."
-
-> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info.
-
----
-
## Open Radars
The following radars have some effect on the current implementation of Alamofire.
@@ -1814,6 +190,7 @@ The following radars have some effect on the current implementation of Alamofire
- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case
- `rdar://26870455` - Background URL Session Configurations do not work in the simulator
- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest`
+- [`rdar://36082113`](http://openradar.appspot.com/radar?id=4942308441063424) - `URLSessionTaskMetrics` failing to link on watchOS 3.0+
## Resolved Radars
@@ -1833,8 +210,6 @@ Simple, static data such as paths, parameters and common headers belong in the `
The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`.
----
-
## Credits
Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases.
@@ -1845,17 +220,22 @@ If you believe you have identified a security vulnerability with Alamofire, you
## Donations
-The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to:
+The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially stay registered as a federal non-profit organization.
+Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free.
+Donating to the ASF will enable us to:
-- Pay our legal fees to register as a federal non-profit organization
- Pay our yearly legal fees to keep the non-profit in good status
- Pay for our mail servers to help us stay on top of all questions and security issues
- Potentially fund test servers to make it easier for us to test the edge cases
- Potentially fund developers to work on one of our projects full-time
-The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated.
+The community adoption of the ASF libraries has been amazing.
+We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward.
+With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members.
+If you use any of our libraries for work, see if your employers would be interested in donating.
+Any amount you can donate today to help us reach our goal would be greatly appreciated.
-
+[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W34WPEE74APJQ)
## License
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift
index 585ae145e8a..b163f6038fa 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift
@@ -1,7 +1,7 @@
//
// AFError.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift
index e28ff5f332d..20c3672fbaf 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift
@@ -1,7 +1,7 @@
//
// Alamofire.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -135,7 +135,8 @@ public func request(
parameters: Parameters? = nil,
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil)
- -> DataRequest {
+ -> DataRequest
+{
return SessionManager.default.request(
url,
method: method,
@@ -182,7 +183,8 @@ public func download(
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil,
to destination: DownloadRequest.DownloadFileDestination? = nil)
- -> DownloadRequest {
+ -> DownloadRequest
+{
return SessionManager.default.download(
url,
method: method,
@@ -207,7 +209,8 @@ public func download(
public func download(
_ urlRequest: URLRequestConvertible,
to destination: DownloadRequest.DownloadFileDestination? = nil)
- -> DownloadRequest {
+ -> DownloadRequest
+{
return SessionManager.default.download(urlRequest, to: destination)
}
@@ -236,7 +239,8 @@ public func download(
public func download(
resumingWith resumeData: Data,
to destination: DownloadRequest.DownloadFileDestination? = nil)
- -> DownloadRequest {
+ -> DownloadRequest
+{
return SessionManager.default.download(resumingWith: resumeData, to: destination)
}
@@ -259,7 +263,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
- -> UploadRequest {
+ -> UploadRequest
+{
return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers)
}
@@ -292,7 +297,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
- -> UploadRequest {
+ -> UploadRequest
+{
return SessionManager.default.upload(data, to: url, method: method, headers: headers)
}
@@ -325,7 +331,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil)
- -> UploadRequest {
+ -> UploadRequest
+{
return SessionManager.default.upload(stream, to: url, method: method, headers: headers)
}
@@ -372,7 +379,8 @@ public func upload(
to url: URLConvertible,
method: HTTPMethod = .post,
headers: HTTPHeaders? = nil,
- encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) {
+ encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?)
+{
return SessionManager.default.upload(
multipartFormData: multipartFormData,
usingThreshold: encodingMemoryThreshold,
@@ -408,7 +416,8 @@ public func upload(
multipartFormData: @escaping (MultipartFormData) -> Void,
usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold,
with urlRequest: URLRequestConvertible,
- encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) {
+ encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?)
+{
return SessionManager.default.upload(
multipartFormData: multipartFormData,
usingThreshold: encodingMemoryThreshold,
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift
index 9031395613c..a54673cca61 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift
@@ -1,7 +1,7 @@
//
// DispatchQueue+Alamofire.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift
index 7f559f351c1..b840138ccc1 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift
@@ -1,7 +1,7 @@
//
// MultipartFormData.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -98,7 +98,7 @@ open class MultipartFormData {
public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } }
/// The boundary used to separate the body parts in the encoded form data.
- public let boundary: String
+ public var boundary: String
private var bodyParts: [BodyPart]
private var bodyPartError: AFError?
@@ -275,7 +275,8 @@ open class MultipartFormData {
}
bodyContentLength = fileSize.uint64Value
- } catch {
+ }
+ catch {
setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error))
return
}
@@ -311,7 +312,8 @@ open class MultipartFormData {
withLength length: UInt64,
name: String,
fileName: String,
- mimeType: String) {
+ mimeType: String)
+ {
let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType)
append(stream, withLength: length, headers: headers)
}
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift
index 834c21ed07b..398ca827c2b 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift
@@ -1,7 +1,7 @@
//
// NetworkReachabilityManager.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@ import SystemConfiguration
/// Reachability can be used to determine background information about why a network operation failed, or to retry
/// network requests when a connection is established. It should not be used to prevent a user from initiating a network
/// request, as it's possible that an initial request may be required to establish reachability.
-public class NetworkReachabilityManager {
+open class NetworkReachabilityManager {
/// Defines the various states of network reachability.
///
/// - unknown: It is unknown whether the network is reachable.
@@ -61,27 +61,27 @@ public class NetworkReachabilityManager {
// MARK: - Properties
/// Whether the network is currently reachable.
- public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi }
+ open var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi }
/// Whether the network is currently reachable over the WWAN interface.
- public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) }
+ open var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) }
/// Whether the network is currently reachable over Ethernet or WiFi interface.
- public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) }
+ open var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) }
/// The current network reachability status.
- public var networkReachabilityStatus: NetworkReachabilityStatus {
+ open var networkReachabilityStatus: NetworkReachabilityStatus {
guard let flags = self.flags else { return .unknown }
return networkReachabilityStatusForFlags(flags)
}
/// The dispatch queue to execute the `listener` closure on.
- public var listenerQueue: DispatchQueue = DispatchQueue.main
+ open var listenerQueue: DispatchQueue = DispatchQueue.main
/// A closure executed when the network reachability status changes.
- public var listener: Listener?
+ open var listener: Listener?
- private var flags: SCNetworkReachabilityFlags? {
+ open var flags: SCNetworkReachabilityFlags? {
var flags = SCNetworkReachabilityFlags()
if SCNetworkReachabilityGetFlags(reachability, &flags) {
@@ -92,7 +92,7 @@ public class NetworkReachabilityManager {
}
private let reachability: SCNetworkReachability
- private var previousFlags: SCNetworkReachabilityFlags
+ open var previousFlags: SCNetworkReachabilityFlags
// MARK: - Initialization
@@ -128,7 +128,9 @@ public class NetworkReachabilityManager {
private init(reachability: SCNetworkReachability) {
self.reachability = reachability
- self.previousFlags = SCNetworkReachabilityFlags()
+
+ // Set the previous flags to an unreserved value to represent unknown status
+ self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30)
}
deinit {
@@ -141,12 +143,13 @@ public class NetworkReachabilityManager {
///
/// - returns: `true` if listening was started successfully, `false` otherwise.
@discardableResult
- public func startListening() -> Bool {
+ open func startListening() -> Bool {
var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil)
context.info = Unmanaged.passUnretained(self).toOpaque()
let callbackEnabled = SCNetworkReachabilitySetCallback(
- reachability, { (_, flags, info) in
+ reachability,
+ { (_, flags, info) in
let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue()
reachability.notifyListener(flags)
},
@@ -156,15 +159,18 @@ public class NetworkReachabilityManager {
let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue)
listenerQueue.async {
- self.previousFlags = SCNetworkReachabilityFlags()
- self.notifyListener(self.flags ?? SCNetworkReachabilityFlags())
+ self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30)
+
+ guard let flags = self.flags else { return }
+
+ self.notifyListener(flags)
}
return callbackEnabled && queueEnabled
}
/// Stops listening for changes in network reachability status.
- public func stopListening() {
+ open func stopListening() {
SCNetworkReachabilitySetCallback(reachability, nil, nil)
SCNetworkReachabilitySetDispatchQueue(reachability, nil)
}
@@ -215,7 +221,8 @@ extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {}
public func ==(
lhs: NetworkReachabilityManager.NetworkReachabilityStatus,
rhs: NetworkReachabilityManager.NetworkReachabilityStatus)
- -> Bool {
+ -> Bool
+{
switch (lhs, rhs) {
case (.unknown, .unknown):
return true
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift
index df41505d97f..e1ac31bf327 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift
@@ -1,7 +1,7 @@
//
// Notifications.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -48,5 +48,8 @@ extension Notification {
public struct Key {
/// User info dictionary key representing the `URLSessionTask` associated with the notification.
public static let Task = "org.alamofire.notification.key.task"
+
+ /// User info dictionary key representing the responseData associated with the notification.
+ public static let ResponseData = "org.alamofire.notification.key.responseData"
}
}
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift
index 0cbe7139dd6..6195809c5db 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift
@@ -1,7 +1,7 @@
//
// ParameterEncoding.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -64,9 +64,15 @@ public protocol ParameterEncoding {
/// the HTTP body depends on the destination of the encoding.
///
/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to
-/// `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode
-/// collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending
-/// the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`).
+/// `application/x-www-form-urlencoded; charset=utf-8`.
+///
+/// There is no published specification for how to encode collection types. By default the convention of appending
+/// `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for
+/// nested dictionary values (`foo[bar]=baz`) is used. Optionally, `ArrayEncoding` can be used to omit the
+/// square brackets appended to array keys.
+///
+/// `BoolEncoding` can be used to configure how boolean values are encoded. The default behavior is to encode
+/// `true` as 1 and `false` as 0.
public struct URLEncoding: ParameterEncoding {
// MARK: Helper Types
@@ -82,6 +88,41 @@ public struct URLEncoding: ParameterEncoding {
case methodDependent, queryString, httpBody
}
+ /// Configures how `Array` parameters are encoded.
+ ///
+ /// - brackets: An empty set of square brackets is appended to the key for every value.
+ /// This is the default behavior.
+ /// - noBrackets: No brackets are appended. The key is encoded as is.
+ public enum ArrayEncoding {
+ case brackets, noBrackets
+
+ func encode(key: String) -> String {
+ switch self {
+ case .brackets:
+ return "\(key)[]"
+ case .noBrackets:
+ return key
+ }
+ }
+ }
+
+ /// Configures how `Bool` parameters are encoded.
+ ///
+ /// - numeric: Encode `true` as `1` and `false` as `0`. This is the default behavior.
+ /// - literal: Encode `true` and `false` as string literals.
+ public enum BoolEncoding {
+ case numeric, literal
+
+ func encode(value: Bool) -> String {
+ switch self {
+ case .numeric:
+ return value ? "1" : "0"
+ case .literal:
+ return value ? "true" : "false"
+ }
+ }
+ }
+
// MARK: Properties
/// Returns a default `URLEncoding` instance.
@@ -99,15 +140,25 @@ public struct URLEncoding: ParameterEncoding {
/// The destination defining where the encoded query string is to be applied to the URL request.
public let destination: Destination
+ /// The encoding to use for `Array` parameters.
+ public let arrayEncoding: ArrayEncoding
+
+ /// The encoding to use for `Bool` parameters.
+ public let boolEncoding: BoolEncoding
+
// MARK: Initialization
/// Creates a `URLEncoding` instance using the specified destination.
///
/// - parameter destination: The destination defining where the encoded query string is to be applied.
+ /// - parameter arrayEncoding: The encoding to use for `Array` parameters.
+ /// - parameter boolEncoding: The encoding to use for `Bool` parameters.
///
/// - returns: The new `URLEncoding` instance.
- public init(destination: Destination = .methodDependent) {
+ public init(destination: Destination = .methodDependent, arrayEncoding: ArrayEncoding = .brackets, boolEncoding: BoolEncoding = .numeric) {
self.destination = destination
+ self.arrayEncoding = arrayEncoding
+ self.boolEncoding = boolEncoding
}
// MARK: Encoding
@@ -161,16 +212,16 @@ public struct URLEncoding: ParameterEncoding {
}
} else if let array = value as? [Any] {
for value in array {
- components += queryComponents(fromKey: "\(key)[]", value: value)
+ components += queryComponents(fromKey: arrayEncoding.encode(key: key), value: value)
}
} else if let value = value as? NSNumber {
if value.isBool {
- components.append((escape(key), escape((value.boolValue ? "1" : "0"))))
+ components.append((escape(key), escape(boolEncoding.encode(value: value.boolValue))))
} else {
components.append((escape(key), escape("\(value)")))
}
} else if let bool = value as? Bool {
- components.append((escape(key), escape((bool ? "1" : "0"))))
+ components.append((escape(key), escape(boolEncoding.encode(value: bool))))
} else {
components.append((escape(key), escape("\(value)")))
}
@@ -384,7 +435,8 @@ public struct PropertyListEncoding: ParameterEncoding {
/// - returns: The new `PropertyListEncoding` instance.
public init(
format: PropertyListSerialization.PropertyListFormat = .xml,
- options: PropertyListSerialization.WriteOptions = 0) {
+ options: PropertyListSerialization.WriteOptions = 0)
+ {
self.format = format
self.options = options
}
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift
index 8ed59add4db..2be2ce0106f 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift
@@ -1,7 +1,7 @@
//
// Request.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -102,7 +102,7 @@ open class Request {
open var task: URLSessionTask? { return delegate.task }
/// The session belonging to the underlying task.
- open let session: URLSession
+ public let session: URLSession
/// The request sent or to be sent to the server.
open var request: URLRequest? { return task?.originalRequest }
@@ -161,7 +161,8 @@ open class Request {
user: String,
password: String,
persistence: URLCredential.Persistence = .forSession)
- -> Self {
+ -> Self
+ {
let credential = URLCredential(user: user, password: password, persistence: persistence)
return authenticate(usingCredential: credential)
}
@@ -183,7 +184,7 @@ open class Request {
/// - parameter password: The password.
///
/// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise.
- open static func authorizationHeader(user: String, password: String) -> (key: String, value: String)? {
+ open class func authorizationHeader(user: String, password: String) -> (key: String, value: String)? {
guard let data = "\(user):\(password)".data(using: .utf8) else { return nil }
let credential = data.base64EncodedString(options: [])
@@ -319,20 +320,16 @@ extension Request: CustomDebugStringConvertible {
var headers: [AnyHashable: Any] = [:]
- if let additionalHeaders = session.configuration.httpAdditionalHeaders {
- for (field, value) in additionalHeaders where field != AnyHashable("Cookie") {
- headers[field] = value
- }
- }
+ session.configuration.httpAdditionalHeaders?.filter { $0.0 != AnyHashable("Cookie") }
+ .forEach { headers[$0.0] = $0.1 }
- if let headerFields = request.allHTTPHeaderFields {
- for (field, value) in headerFields where field != "Cookie" {
- headers[field] = value
- }
- }
+ request.allHTTPHeaderFields?.filter { $0.0 != "Cookie" }
+ .forEach { headers[$0.0] = $0.1 }
- for (field, value) in headers {
- components.append("-H \"\(field): \(value)\"")
+ components += headers.map {
+ let escapedValue = String(describing: $0.value).replacingOccurrences(of: "\"", with: "\\\"")
+
+ return "-H \"\($0.key): \(escapedValue)\""
}
if let httpBodyData = request.httpBody, let httpBody = String(data: httpBodyData, encoding: .utf8) {
@@ -500,8 +497,19 @@ open class DownloadRequest: Request {
// MARK: State
/// Cancels the request.
- open override func cancel() {
- downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 }
+ override open func cancel() {
+ cancel(createResumeData: true)
+ }
+
+ /// Cancels the request.
+ ///
+ /// - parameter createResumeData: Determines whether resume data is created via the underlying download task or not.
+ open func cancel(createResumeData: Bool) {
+ if createResumeData {
+ downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 }
+ } else {
+ downloadDelegate.downloadTask.cancel()
+ }
NotificationCenter.default.post(
name: Notification.Name.Task.DidCancel,
@@ -536,7 +544,8 @@ open class DownloadRequest: Request {
open class func suggestedDownloadDestination(
for directory: FileManager.SearchPathDirectory = .documentDirectory,
in domain: FileManager.SearchPathDomainMask = .userDomainMask)
- -> DownloadFileDestination {
+ -> DownloadFileDestination
+ {
return { temporaryURL, response in
let directoryURLs = FileManager.default.urls(for: directory, in: domain)
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Response.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Response.swift
index dbfb3c03ae6..747a471a55b 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Response.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Response.swift
@@ -1,7 +1,7 @@
//
// Response.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -58,7 +58,8 @@ public struct DefaultDataResponse {
data: Data?,
error: Error?,
timeline: Timeline = Timeline(),
- metrics: AnyObject? = nil) {
+ metrics: AnyObject? = nil)
+ {
self.request = request
self.response = response
self.data = data
@@ -108,7 +109,8 @@ public struct DataResponse {
response: HTTPURLResponse?,
data: Data?,
result: Result,
- timeline: Timeline = Timeline()) {
+ timeline: Timeline = Timeline())
+ {
self.request = request
self.response = response
self.data = data
@@ -197,6 +199,55 @@ extension DataResponse {
return response
}
+
+ /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter.
+ ///
+ /// Use the `mapError` function with a closure that does not throw. For example:
+ ///
+ /// let possibleData: DataResponse = ...
+ /// let withMyError = possibleData.mapError { MyError.error($0) }
+ ///
+ /// - Parameter transform: A closure that takes the error of the instance.
+ /// - Returns: A `DataResponse` instance containing the result of the transform.
+ public func mapError(_ transform: (Error) -> E) -> DataResponse {
+ var response = DataResponse(
+ request: request,
+ response: self.response,
+ data: data,
+ result: result.mapError(transform),
+ timeline: timeline
+ )
+
+ response._metrics = _metrics
+
+ return response
+ }
+
+ /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter.
+ ///
+ /// Use the `flatMapError` function with a closure that may throw an error. For example:
+ ///
+ /// let possibleData: DataResponse = ...
+ /// let possibleObject = possibleData.flatMapError {
+ /// try someFailableFunction(taking: $0)
+ /// }
+ ///
+ /// - Parameter transform: A throwing closure that takes the error of the instance.
+ ///
+ /// - Returns: A `DataResponse` instance containing the result of the transform.
+ public func flatMapError(_ transform: (Error) throws -> E) -> DataResponse {
+ var response = DataResponse(
+ request: request,
+ response: self.response,
+ data: data,
+ result: result.flatMapError(transform),
+ timeline: timeline
+ )
+
+ response._metrics = _metrics
+
+ return response
+ }
}
// MARK: -
@@ -245,7 +296,8 @@ public struct DefaultDownloadResponse {
resumeData: Data?,
error: Error?,
timeline: Timeline = Timeline(),
- metrics: AnyObject? = nil) {
+ metrics: AnyObject? = nil)
+ {
self.request = request
self.response = response
self.temporaryURL = temporaryURL
@@ -307,7 +359,8 @@ public struct DownloadResponse {
destinationURL: URL?,
resumeData: Data?,
result: Result,
- timeline: Timeline = Timeline()) {
+ timeline: Timeline = Timeline())
+ {
self.request = request
self.response = response
self.temporaryURL = temporaryURL
@@ -405,6 +458,59 @@ extension DownloadResponse {
return response
}
+
+ /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter.
+ ///
+ /// Use the `mapError` function with a closure that does not throw. For example:
+ ///
+ /// let possibleData: DownloadResponse = ...
+ /// let withMyError = possibleData.mapError { MyError.error($0) }
+ ///
+ /// - Parameter transform: A closure that takes the error of the instance.
+ /// - Returns: A `DownloadResponse` instance containing the result of the transform.
+ public func mapError(_ transform: (Error) -> E) -> DownloadResponse {
+ var response = DownloadResponse(
+ request: request,
+ response: self.response,
+ temporaryURL: temporaryURL,
+ destinationURL: destinationURL,
+ resumeData: resumeData,
+ result: result.mapError(transform),
+ timeline: timeline
+ )
+
+ response._metrics = _metrics
+
+ return response
+ }
+
+ /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter.
+ ///
+ /// Use the `flatMapError` function with a closure that may throw an error. For example:
+ ///
+ /// let possibleData: DownloadResponse = ...
+ /// let possibleObject = possibleData.flatMapError {
+ /// try someFailableFunction(taking: $0)
+ /// }
+ ///
+ /// - Parameter transform: A throwing closure that takes the error of the instance.
+ ///
+ /// - Returns: A `DownloadResponse` instance containing the result of the transform.
+ public func flatMapError(_ transform: (Error) throws -> E) -> DownloadResponse {
+ var response = DownloadResponse(
+ request: request,
+ response: self.response,
+ temporaryURL: temporaryURL,
+ destinationURL: destinationURL,
+ resumeData: resumeData,
+ result: result.flatMapError(transform),
+ timeline: timeline
+ )
+
+ response._metrics = _metrics
+
+ return response
+ }
}
// MARK: -
diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ResponseSerialization.swift
index 76d905997cd..9cc105a8205 100644
--- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ResponseSerialization.swift
+++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ResponseSerialization.swift
@@ -1,7 +1,7 @@
//
// ResponseSerialization.swift
//
-// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/)
+// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -144,7 +144,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
responseSerializer: T,
completionHandler: @escaping (DataResponse) -> Void)
- -> Self {
+ -> Self
+ {
delegate.queue.addOperation {
let result = responseSerializer.serializeResponse(
self.request,
@@ -181,7 +182,8 @@ extension DownloadRequest {
public func response(
queue: DispatchQueue? = nil,
completionHandler: @escaping (DefaultDownloadResponse) -> Void)
- -> Self {
+ -> Self
+ {
delegate.queue.addOperation {
(queue ?? DispatchQueue.main).async {
var downloadResponse = DefaultDownloadResponse(
@@ -216,7 +218,8 @@ extension DownloadRequest {
queue: DispatchQueue? = nil,
responseSerializer: T,
completionHandler: @escaping (DownloadResponse) -> Void)
- -> Self {
+ -> Self
+ {
delegate.queue.addOperation {
let result = responseSerializer.serializeResponse(
self.request,
@@ -286,7 +289,8 @@ extension DataRequest {
public func responseData(
queue: DispatchQueue? = nil,
completionHandler: @escaping (DataResponse) -> Void)
- -> Self {
+ -> Self
+ {
return response(
queue: queue,
responseSerializer: DataRequest.dataResponseSerializer(),
@@ -325,7 +329,8 @@ extension DownloadRequest {
public func responseData(
queue: DispatchQueue? = nil,
completionHandler: @escaping (DownloadResponse) -> Void)
- -> Self {
+ -> Self
+ {
return response(
queue: queue,
responseSerializer: DownloadRequest.dataResponseSerializer(),
@@ -351,7 +356,8 @@ extension Request {
response: HTTPURLResponse?,
data: Data?,
error: Error?)
- -> Result {
+ -> Result
+ {
guard error == nil else { return .failure(error!) }
if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") }
@@ -362,13 +368,13 @@ extension Request {
var convertedEncoding = encoding
- if let encodingName = response?.textEncodingName as CFString!, convertedEncoding == nil {
+ if let encodingName = response?.textEncodingName as CFString?, convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName))
)
}
- let actualEncoding = convertedEncoding ?? String.Encoding.isoLatin1
+ let actualEncoding = convertedEncoding ?? .isoLatin1
if let string = String(data: validData, encoding: actualEncoding) {
return .success(string)
@@ -405,7 +411,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
encoding: String.Encoding? = nil,
completionHandler: @escaping (DataResponse) -> Void)
- -> Self {
+ -> Self
+ {
return response(
queue: queue,
responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding),
@@ -452,7 +459,8 @@ extension DownloadRequest {
queue: DispatchQueue? = nil,
encoding: String.Encoding? = nil,
completionHandler: @escaping (DownloadResponse) -> Void)
- -> Self {
+ -> Self
+ {
return response(
queue: queue,
responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding),
@@ -478,7 +486,8 @@ extension Request {
response: HTTPURLResponse?,
data: Data?,
error: Error?)
- -> Result {
+ -> Result
+ {
guard error == nil else { return .failure(error!) }
if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) }
@@ -505,7 +514,8 @@ extension DataRequest {
/// - returns: A JSON object response serializer.
public static func jsonResponseSerializer(
options: JSONSerialization.ReadingOptions = .allowFragments)
- -> DataResponseSerializer {
+ -> DataResponseSerializer
+ {
return DataResponseSerializer { _, response, data, error in
return Request.serializeResponseJSON(options: options, response: response, data: data, error: error)
}
@@ -522,7 +532,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
options: JSONSerialization.ReadingOptions = .allowFragments,
completionHandler: @escaping (DataResponse) -> Void)
- -> Self {
+ -> Self
+ {
return response(
queue: queue,
responseSerializer: DataRequest.jsonResponseSerializer(options: options),
@@ -540,7 +551,8 @@ extension DownloadRequest {
/// - returns: A JSON object response serializer.
public static func jsonResponseSerializer(
options: JSONSerialization.ReadingOptions = .allowFragments)
- -> DownloadResponseSerializer {
+ -> DownloadResponseSerializer
+ {
return DownloadResponseSerializer { _, response, fileURL, error in
guard error == nil else { return .failure(error!) }
@@ -568,7 +580,8 @@ extension DownloadRequest {
queue: DispatchQueue? = nil,
options: JSONSerialization.ReadingOptions = .allowFragments,
completionHandler: @escaping (DownloadResponse) -> Void)
- -> Self {
+ -> Self
+ {
return response(
queue: queue,
responseSerializer: DownloadRequest.jsonResponseSerializer(options: options),
@@ -594,7 +607,8 @@ extension Request {
response: HTTPURLResponse?,
data: Data?,
error: Error?)
- -> Result {
+ -> Result
+ {
guard error == nil else { return .failure(error!) }
if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) }
@@ -621,7 +635,8 @@ extension DataRequest {
/// - returns: A property list object response serializer.
public static func propertyListResponseSerializer(
options: PropertyListSerialization.ReadOptions = [])
- -> DataResponseSerializer {
+ -> DataResponseSerializer
+ {
return DataResponseSerializer { _, response, data, error in
return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error)
}
@@ -638,7 +653,8 @@ extension DataRequest {
queue: DispatchQueue? = nil,
options: PropertyListSerialization.ReadOptions = [],
completionHandler: @escaping (DataResponse