# URLs as Attributes?

**URL:** <https://discuss.jsonapi.org/t/urls-as-attributes/1849>\
**Category:** Uncategorized\
**Created:** [February 26, 2020, 5:38pm UTC](https://discuss.jsonapi.org/t/urls-as-attributes/1849 "2020-02-26T17:38:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![niltz](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/niltz/32/593_2.png) [@niltz](https://discuss.jsonapi.org/u/niltz)\
**Post date:** [February 26, 2020, 5:38pm UTC](https://discuss.jsonapi.org/t/urls-as-attributes/1849/1 "2020-02-26T17:38:52Z")

</div>

I have a resource that has some urls as part of the data structure, and the client can post/patch these to set/update the urls.

Should these urls be part of the attributes? Or part of the links? I’m not sure where JSON:API stands on allowing resource links as part of the POST/PATCH payload

[https://jsonapi.org/format/#document-resource-object-links](https://jsonapi.org/format/#document-resource-object-links)

---

<div class="post-metadata">

**Author:** ![fdrake](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/fdrake/32/654_2.png) [@fdrake](https://discuss.jsonapi.org/u/fdrake)\
**Post date:** [February 27, 2020, 2:21pm UTC](https://discuss.jsonapi.org/t/urls-as-attributes/1849/2 "2020-02-27T14:21:13Z")

</div>

Are the URLs in your data arbitrary URLs, or do they represent relations among the resources & collections presented by your application?

If the former, they should just be attributes.

If the later, they should be presented using the corresponding properties in `links` objects. If they don’t correspond to the specific uses described in the specification, they should be considered arbitrary, and should _not_ be added to `links`.

JSON:API 1.0 `links` are sufficiently anemic that it’s unlikely to be relevant outside the specific JSON:API usages described in the specification. I understand that’s going to be expanded in 1.1, but the defined link relations registered with IANA aren’t that interesting (mostly because each is too vague).

Or at least that’s my understanding from reading the specification.

-Fred

---

<div class="post-metadata">

**Author:** ![niltz](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/niltz/32/593_2.png) [@niltz](https://discuss.jsonapi.org/u/niltz)\
**Post date:** [February 27, 2020, 4:54pm UTC](https://discuss.jsonapi.org/t/urls-as-attributes/1849/3 "2020-02-27T16:54:14Z")

</div>

Imagine you have a “user profile” resource, and as part of the user profile you want to allow the person to add a link to an avatar, or a link to their homepage. The avatar and homepage are external links, and don’t reference any other resource in our api.

Should links like these be part of the attributes, or links?

---

<div class="post-metadata">

**Author:** ![fdrake](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/fdrake/32/654_2.png) [@fdrake](https://discuss.jsonapi.org/u/fdrake)\
**Post date:** [February 27, 2020, 5:20pm UTC](https://discuss.jsonapi.org/t/urls-as-attributes/1849/4 "2020-02-27T17:20:30Z")

</div>

Definitely just attributes.
