What is the most elegant way to create JSON from this structure with the only one parameter
struct SessionStorage: Encodable {
var value: String
func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
/// the magic
}
enum CodingKeys: String, CodingKey {
case params
}
}
into this JSON-string?
{"params": {"value": "{value}"}}
I don't want to create nested structs.