cancel
Showing results for 
Search instead for 
Did you mean: 

Serialise `null-value` Swift4 JSONEncoding

Frequent Visitor

Serialise `null-value` Swift4 JSONEncoding

Hi,

 

Language - Swift 4

 

I am using Swagger codegen to generate my request-response models, I actually came across a scenario where I need to pass null-value in my request JSON if the optional parameter is `nil` - which means i could not use the default encoding offered by `Codable` protocol, instead would need to add my own encode function to the request model's.

 

Is there a way to acheive this using swagger-codegen but still avoid manual modification on the generated models? 

 

Thank you.

Tags (1)
New Here?
Join us and watch the welcome video:
SeptemberNews
Join our online event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win