David is there an option for the lenses to have op...
# http4k
r
David is there an option for the lenses to have optional variables inside of them? or is the data class reflected entirely only? Also, I noticed that the variable names eg “val user_name: String” will have a field “user_name” of type String. What if I wanted a variable called “user::name” its not possible to call the variable by that, is there a way around that kind of thing?
d
If you use a nullable field, (String?), then null/missing fields should be accepted. For naming, you can probably use the Kotlin backticks
Copy code
val `my great name` : String
, although I'm not sure on the limits of what you can use in those
❤️ 1
r
Sadly both of these things didn’t work 😞 I’ll have to figure out a different way
d
Let's try to break it down. Firstly, does a nullable field work for you?
👍 1
r
Sorry david, actually the nullable thing did work, I think it was just a caching issue 😞 sorry for bothering you with that. Regarding the kotlin feature for special variable names work if I can not define a var/val
first::name
, I’m assuming because :: is used by kotlin itself