An arrow optics related question, but using the Ko...
# arrow
g
An arrow optics related question, but using the Kotlin-serialization-jsonpath library: it does not seem to be possible to build up an object from an empty object.
Copy code
val name: Optional<JsonElement, String> = JsonPath.select("name").string
name.set(JsonObject(emptyMap()), “bla”)
Since this is an optic Optional, this is as expected. From the optics documentation: To modify the value (only if present), use set and modify. But is there no other way to do this? It seems very useful.