Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

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

@Gamma169

Description

@Gamma169

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions