Skip to content

Commit 2e5f5b9

Browse files
committed
[swift6][client] All models conform to Codable so this method should not be needed anymore
1 parent f24f3b1 commit 2e5f5b9

13 files changed

Lines changed: 0 additions & 208 deletions

File tree

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
}

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

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

29-
internal 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)