Guest User

json

a guest
Nov 5th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.27 KB | None | 0 0
  1. import json
  2. type
  3.   Person = object
  4.     user_id: string
  5.     custom_user_id: string
  6.  
  7. let jsonNode = parseJson("""
  8.   {
  9.     "user_id": "123"
  10.   }
  11. """)
  12.  
  13. var data = to(jsonNode, Person) # Error: unhandled exception: key not found: custom_user_id [KeyError]
  14. echo data
Advertisement
Add Comment
Please, Sign In to add comment