Skip to content

Commit 64d9719

Browse files
authored
[swift6][client] All models conform to Codable so this method should not be needed anymore (#21117)
* [swift6][client] All models conform to Codable so this method should not be needed anymore * [swift6][client] All models conform to Codable so this method should not be needed anymore
1 parent 7f64d90 commit 64d9719

File tree

14 files changed

+0
-224
lines changed

14 files changed

+0
-224
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ import Foundation
2626
return params
2727
}
2828

29-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/JSONEncodingHelper.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,4 @@ open class JSONEncodingHelper {
2626
return params
2727
}
2828

29-
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
30-
var params: [String: any Sendable]?
31-
32-
if let encodableObj = encodableObj {
33-
do {
34-
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
35-
params = JSONDataEncoding.encodingParameters(jsonData: data)
36-
} catch {
37-
print(error.localizedDescription)
38-
return nil
39-
}
40-
}
41-
42-
return params
43-
}
44-
4529
}

0 commit comments

Comments
 (0)