https://kotlinlang.org logo
#http4k
Title
# http4k
r

Razi Kheir

05/29/2019, 8:58 AM
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

dave

05/29/2019, 9:20 AM
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

Razi Kheir

05/31/2019, 12:12 AM
Sadly both of these things didn’t work 😞 I’ll have to figure out a different way
d

dave

05/31/2019, 12:44 AM
Let's try to break it down. Firstly, does a nullable field work for you?
👍 1
r

Razi Kheir

05/31/2019, 2:35 AM
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