Moya-ModelMapper
Moya-ModelMapper copied to clipboard
How do you convert a mappable object to json?
I'm able to deserialize just fine, but can't seem to figure out how to serialize TO json. Would love some guidance. I'd like to use this json in a POST request body. The examples aren't that clear to me.
Thanks in advance
Hey @gmann1. I'm afraid it is not possible to serialize to JSON. https://github.com/lyft/mapper is just a deserializer. You would have to do it by hand or use Encodable/Decodable (thus this library wouldn't make sense then, as Moya has an extension to Codable).