# Clarification on namespece in attribute nested objects

**URL:** <https://discuss.jsonapi.org/t/clarification-on-namespece-in-attribute-nested-objects/1906>\
**Category:** Uncategorized\
**Created:** [April 7, 2020, 11:14pm UTC](https://discuss.jsonapi.org/t/clarification-on-namespece-in-attribute-nested-objects/1906 "2020-04-07T23:14:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![avinav](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@avinav](https://discuss.jsonapi.org/u/avinav)\
**Post date:** [April 7, 2020, 11:14pm UTC](https://discuss.jsonapi.org/t/clarification-on-namespece-in-attribute-nested-objects/1906/1 "2020-04-07T23:14:06Z")

</div>

Hello - I am new to json:api. I understand data fields allow for nested json objects.  
I am looking for some clarification regarding namespace specification for attributes.

From [JSON:API — Latest Specification (v1.1)](https://jsonapi.org/format/#document-resource-object-fields)

> Fields for a [resource object](https://jsonapi.org/format/#document-resource-objects) **MUST** share a common namespace with each other and with `type` and `id` . In other words, a resource can not have an attribute and relationship with the same name, nor can it have an attribute or relationship named `type` or `id` .

Does this apply to nested properties as well, which is to say I cannot have “bar” appear in both “foo” and “foo1” attributes?

```auto
...
"data": {
  "id": "1",
  "type": "yes",
   "attributes": {
     "foo": {
         "bar": "hi"
      },
     "foo1": {
          "bar": "hello"
     }
}

```

---

<div class="post-metadata">

**Author:** ![cmeeren](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/cmeeren/32/596_2.png) [@cmeeren](https://discuss.jsonapi.org/u/cmeeren)\
**Post date:** [April 10, 2020, 7:06pm UTC](https://discuss.jsonapi.org/t/clarification-on-namespece-in-attribute-nested-objects/1906/2 "2020-04-10T19:06:45Z")

</div>

As I understand it, JSON:API is completely agnostic to the value/types of your attributes, so the spec isn’t concerned at all with whether your attributes are primitives, arrays, or objects. Thus, if they are objects, JSON:API is completely agnostic as to what they contain.
