import json
import json_serialization
type
RpcResponse*[T] = ref object
result*: T
id*: int
error*: string
when isMainModule:
echo("Hello, World!")
let jsn = %* {
"result": "0x0",
"id": 0
}
echo Json.decode($jsn, RpcResponse[string])
Error:
/usr/local/Cellar/nim/1.2.0/nim/lib/system.nim(850, 11) Error: invalid type: 'T' in this context: 'ref RpcResponse:ObjectType' for var