Skip to content

Instantly share code, notes, and snippets.

@Akii
Created August 8, 2015 18:16
Show Gist options
  • Save Akii/e096b6a41d6b489e103d to your computer and use it in GitHub Desktop.
Save Akii/e096b6a41d6b489e103d to your computer and use it in GitHub Desktop.
val account = AccountAdded("asdf", Account("blah"))
println(account.asJson) // {"identifier":"asdf","account":{"password":"blah","active":false}}
val map = Map("package.User$AccountAdded" -> AccountAddedCodec)
val encoder = map.get("package.User$AccountAdded").get
println("""{"identifier":"asdf","account":{"password":"blah","active":false}}""".decodeOption(encoder))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment