Forum Discussion

arvbhavan's avatar
Regular Visitor
5 years ago

Serialise `null-value` Swift4 JSONEncoding



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.

No RepliesBe the first to reply