1

I am trying to access a field in json with circe-optics. Issue is the field contains a dash:

root.TAB-NR.string

While if i write

root.TAB_NR.string it works, but the field does not exist.

Any idea how i can handle this case ?

MaatDeamon
  • 9,532
  • 9
  • 60
  • 127

1 Answers1

4

If you need to use special characters in Scala identifiers that would otherwise be illegal, you can use backticks to quote them.

val `my funky value` = root.`TAB-NR`.string
Thilo
  • 257,207
  • 101
  • 511
  • 656