1/ I wish #golang json serialization marshal/unmarshal an int64 as a string while keeping the int64 representation. Something like,
type User {
UserId int64 `json:"user_id,stringmode"`
}
2/ I think it's a common use case. Twitter does `id_str` for this reason. And, I got burned for it in @dgraphlabs' ratel interface not to long ago because I expected the client to do it automatically since it uses json as an exchange format.https://github.com/dgraph-io/ratel/issues/142 …
-
-
3/ Whether it's worth the complexity to "encoding/json" is a different matter. My guess is: no. But, I'm not going to try an attempt a patch now because 1) not a priority and 2) no desire to play with
#golang reflection code.Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I'm not sure I understand what you expect Dgraph to do in this case. Either we encode the integer as a string and some programs will have issues parsing, or we store them as integers and JavaScript will have a bad time. What option are you proposing? https://play.golang.org/p/lD0Y4HbWMDq
-
dgraph itself: nothing. ratel as UI? not sure. my expectation was violated because I'm consuming dgraph mostly through not-javascript so the integer truncation in ratel was surprising, even though it's obviousy a JS gui. But I'm not sure patching ratel is worth the cost.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.