This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Improved slice unmarshalling support#129
Closed
blakepettersson wants to merge 1 commit intogoogle:masterfrom
Closed
Improved slice unmarshalling support#129blakepettersson wants to merge 1 commit intogoogle:masterfrom
blakepettersson wants to merge 1 commit intogoogle:masterfrom
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
Author
|
I signed it! |
* All integer slice types are supported JSON number arrays can be unmarshaled as `int`, `int8`, `int16`, `int32` and `int64` slices, as well as `uint`, `uint16`, `uint32` and `uint64` slices, as well as slices that are pointers to the aforementioned types. In the case of `uint8` slices, the assumption is that it is unmarshaled from a base64 encoded string, since that is how a `[]uint8` is marshaled with `json.Marshal`. * JSON arrays can also be unmarshaled as `float32` and `float64` slices, as well as the pointer variants of those types. * `time.Time` slices are also supported, both values and pointers.
e2c956a to
8e3499c
Compare
|
CLAs look good, thanks! |
tianzhou
added a commit
to bytebase/bytebase
that referenced
this pull request
Jun 20, 2021
…onapi doesn’t support unmarshalling int slice BTW, there is an outstanding PR to support this: google/jsonapi#129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSON number arrays can be unmarshaled as
int,int8,int16,int32and
int64slices, as well asuint,uint16,uint32anduint64slices, as well as slices that are pointers to theaforementioned types.
In the case of
uint8slices, the assumption is that it is unmarshaledfrom a base64 encoded string, since that is how a
[]uint8ismarshaled with
json.Marshal.JSON arrays can also be unmarshaled as
float32andfloat64slices,as well as the pointer variants of those types.
time.Timeslices are also supported, both values and pointers.This is similar to #73, but covers more types.