Fix example code on scala json

Backport of #2370