Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !4577

[Swift] minor fix to scripts

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged William Cheng requested to merge fix_swift into master 5 years ago
  • Overview 0
  • Commits 6
  • Pipelines 0
  • Changes 26
  • minor fix to scripts

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.
Compare
  • master (base)

and
  • latest version
    c2a90add
    6 commits, 2 years ago

26 files
+ 310
- 327

    Preferences

    File browser
    Compare changes
b‎in‎
swift4-‎test.sh‎ +1 -1
docs/ge‎nerators‎
kotl‎in.md‎ +1 -1
samples‎/client‎
petstor‎e/swift4‎
swift4_te‎st_all.sh‎ +1 -1
test/‎swift4‎
def‎ault‎
TestClient/Cl‎asses/OpenAPIs‎
APIHelp‎er.swift‎ +3 -3
TestClien‎tApp/Pods‎
Alamofir‎e/Source‎
Alamofi‎re.swift‎ +9 -18
MultipartFo‎rmData.swift‎ +2 -4
NetworkReachabil‎ityManager.swift‎ +2 -4
ParameterEn‎coding.swift‎ +1 -2
Reques‎t.swift‎ +2 -4
Respons‎e.swift‎ +4 -8
ResponseSeria‎lization.swift‎ +18 -36
ServerTrust‎Policy.swift‎ +0 -1
SessionDel‎egate.swift‎ +12 -24
SessionMan‎ager.swift‎ +13 -26
TaskDeleg‎ate.swift‎ +10 -20
Timelin‎e.swift‎ +1 -2
Validati‎on.swift‎ +2 -4
Pods.xc‎odeproj‎
project‎.pbxproj‎ +176 -166
do‎cs‎
ModelDoub‎leArray.md‎ +9 -0
ModelErrorI‎nfoArray.md‎ +9 -0
ModelStri‎ngArray.md‎ +9 -0
ModelWithIntAdditio‎nalPropertiesOnly.md‎ +9 -0
ModelWithStringAdditi‎onalPropertiesOnly.md‎ +9 -0
READ‎ME.md‎ +5 -0
swift4_te‎st_all.sh‎ +0 -0
bitri‎se.yml‎ +2 -2
bin/swift4-test.sh
+ 1
- 1
  • View file @ c2a90add

  • Edit in single-file editor

  • Open in Web IDE


@@ -27,7 +27,7 @@ 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/swift4Test.json -g swift4 -c ./bin/swift4-test.json -o samples/client/test/swift4/default --generate-alias-as-model $@"
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift4Test.json -g swift4 -c ./bin/swift4-test.json -o samples/client/test/swift4/default --generate-alias-as-model $@"
java $JAVA_OPTS -jar $executable $ags
docs/generators/kotlin.md
+ 1
- 1
  • View file @ c2a90add

  • Edit in single-file editor

  • Open in Web IDE


@@ -17,4 +17,4 @@ sidebar_label: kotlin
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only)</dd><dt>**threetenbp**</dt><dd>Threetenbp (jvm only)</dd><dl>|java8|
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd><dl>|array|
|library|Library template (sub-template) to use|<dl><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.</dd><dl>|jvm-okhttp4|
|library|Library template (sub-template) to use|<dl><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.</dd><dl>|jvm-okhttp4|
samples/client/petstore/swift4/swift4_test_all.sh 100644 → 100755
+ 1
- 1
  • View file @ c2a90add

  • Edit in single-file editor

  • Open in Web IDE


#/bin/bash
#!/bin/bash
set -e
samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift
+ 3
- 3
  • View file @ c2a90add

  • Edit in single-file editor

  • Open in Web IDE


@@ -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? [Any?] {
if let collection = item.value as? Array<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? [Any?] {
if let collection = source as? Array<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? [Any?] {
if let collection = item.value as? Array<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 {
samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift
+ 9
- 18
  • View file @ c2a90add

  • Edit in single-file editor

  • Open in Web IDE


@@ -135,8 +135,7 @@ public func request(
parameters: Parameters? = nil,
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil)
-> DataRequest
{
-> DataRequest {
return SessionManager.default.request(
url,
method: method,
@@ -183,8 +182,7 @@ public func download(
encoding: ParameterEncoding = URLEncoding.default,
headers: HTTPHeaders? = nil,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest
{
-> DownloadRequest {
return SessionManager.default.download(
url,
method: method,
@@ -209,8 +207,7 @@ public func download(
public func download(
_ urlRequest: URLRequestConvertible,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest
{
-> DownloadRequest {
return SessionManager.default.download(urlRequest, to: destination)
}
@@ -239,8 +236,7 @@ public func download(
public func download(
resumingWith resumeData: Data,
to destination: DownloadRequest.DownloadFileDestination? = nil)
-> DownloadRequest
{
-> DownloadRequest {
return SessionManager.default.download(resumingWith: resumeData, to: destination)
}
@@ -263,8 +259,7 @@ 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)
}
@@ -297,8 +292,7 @@ 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)
}
@@ -331,8 +325,7 @@ 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)
}
@@ -379,8 +372,7 @@ 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,
@@ -416,8 +408,7 @@ 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,
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
2
Client: Swift Enhancement: CI/Test
2
Client: Swift Enhancement: CI/Test
    Assign labels
  • Manage project labels

Milestone
4.2.2
4.2.2 (expired)
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
William Cheng
Reference: OpenAPITools/openapi-generator!4577
Source branch: fix_swift

Menu

Explore Projects Groups Snippets