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

Support for Unmarshalling Slices of floats/ints/bools #209

Open
Gamma169 opened this issue Aug 24, 2021 · 0 comments
Open

Support for Unmarshalling Slices of floats/ints/bools #209

Gamma169 opened this issue Aug 24, 2021 · 0 comments

Comments

@Gamma169
Copy link

Unless I'm mistaken, it seems that this library cannot support types of a slice of primitives other than strings.

Looking into request.go, I see functions for handling string slices and struct slices, but not slices for floats or ints or bools.

I have a struct as such:

type MyStruct struct {
  MyAttr   []string   `jsonapi:"attr,my-attr"`
}

but when I try to unmarshall it, it throws this error:
data is not a jsonapi representation of '*main.MyStruct'

Any way we could get support for this? Possibly in a more extensible fashion than just creating a new function for each.

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

1 participant