Array of resources ids in attributes

Hello,

I was wondering, would this approach be valid according the spec:

{
  "data": {
    "id": "31168",
    "type": "users",
    "attributes": {
      "name": "John",
      "tags": [ 1, 2, 3 ]
    }
  }
}

tags array presents a list of resources ids of type tag.

This approach would avoid creating another resource ( i.e. user-tags ) since I do not need anything just a list of assigned ids.

Spec is quite clear about that one:

Although has-one foreign keys (e.g. author_id ) are often stored internally alongside other information to be represented in a resource object, these keys SHOULD NOT appear as attributes.

I don’t see why creating another resource should be required if using resource linkage as intended by spec:

{
  "data": {
    "id": "31168",
    "type": "users",
    "attributes": {
      "name": "John"
    }
    "relationships": {
     "tags": {
       "data": [
         { "type": "tags", "id": "1" },
         { "type": "tags", "id": "2" },
         { "type": "tags", "id": "3" }
      ]
    }
  }
}

This would also allow usage of related resource links and compound documents, which isn’t supported if you treat a relationship as attribute.