Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would like to be able to serialize int64 as string #120

Open
mylanconnolly opened this issue Nov 8, 2017 · 2 comments
Open

Would like to be able to serialize int64 as string #120

mylanconnolly opened this issue Nov 8, 2017 · 2 comments

Comments

@mylanconnolly
Copy link

Hello all,

I am working on a project that I'd like to utilize jsonapi for.

I'm running into a snag because our ID format is large int64s (like 1362085645204177151). These overflow when just serializing to JSON (the last few digits end up being just zeros), so when using just plain JSON serialization in Go, I'd do something like:

type Example struct {
  SomeID int64 `json:"someId,string"` // The string argument tells the json encoder to format this as a string
}

This doesn't seem to be implemented in this package, and I'd not be opposed to doing the legwork myself, but I just wanted to see if this is something that would be approved before I got too far.

Thanks!

@shwoodard
Copy link
Contributor

Pull requests welcome.

@mylanconnolly
Copy link
Author

Created pull request #121. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants