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.

Can't get relation to work #7

@yfr

Description

@yfr

I have this setup. I read from a json file with has the defaults. Can you see whats wrong? I can see that in UnmarshalPayload after the decode the relation values are not decoded to payload.

package model

type Get struct {
    Id      int      `jsonapi:"primary,get"`
    Title   string   `jsonapi:"attr,title"`
    Status  string   `jsonapi:"attr,status"`
    Success *Success `jsonapi:"relation,success"`
}

type Success struct {
    Id         string `jsonapi:"primary,success"`
    Systemtime int `jsonapi:"attr,systemtime"`
}
{
  "data": {
    "type": "get",
    "id": "1",
    "attributes": {
      "title": "title2",
      "status": "OK",
      "success": {
        "status": "OK",
        "systemtime": "1378304936929",
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions