# Extra attributes sent from client

**URL:** <https://discuss.jsonapi.org/t/extra-attributes-sent-from-client/1795>\
**Category:** Uncategorized\
**Created:** [December 18, 2019, 8:55pm UTC](https://discuss.jsonapi.org/t/extra-attributes-sent-from-client/1795 "2019-12-18T20:55:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bednic](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@Bednic](https://discuss.jsonapi.org/u/Bednic)\
**Post date:** [December 18, 2019, 8:55pm UTC](https://discuss.jsonapi.org/t/extra-attributes-sent-from-client/1795/1 "2019-12-18T20:55:56Z")

</div>

I have a question about Server-side behavior on extra attributes, or fields in general, in request body resource data.

The case is:  
I have a resource that has field A, but client send me resouce object that has field A and field B.

The question:  
How should server respond to this? Of cource I can ignore it, and just process fields I know. Or I can send back a response with exception that field was not recognized, or whole resource linkage is wrong, because resource with field A and field B does not exist. Documentation unfortunatelly does not include answer what to do if request contains extra field data.

Thanks for advice

---

<div class="post-metadata">

**Author:** ![panman82](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/panman82/32/789_2.png) [@panman82](https://discuss.jsonapi.org/u/panman82)\
**Post date:** [December 18, 2019, 9:39pm UTC](https://discuss.jsonapi.org/t/extra-attributes-sent-from-client/1795/2 "2019-12-18T21:39:11Z")

</div>

Technically I think the spec says the server should ignore anything it doesn’t understand, but I plan to error in these cases so the client knows it did something wrong that won’t get “saved”.

---

<div class="post-metadata">

**Author:** ![Bednic](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@Bednic](https://discuss.jsonapi.org/u/Bednic)\
**Post date:** [December 18, 2019, 9:58pm UTC](https://discuss.jsonapi.org/t/extra-attributes-sent-from-client/1795/3 "2019-12-18T21:58:46Z")

</div>

Documentation says:

> Unless otherwise noted, objects defined by this specification **MUST NOT** contain any additional members. Client and server implementations **MUST** ignore members not recognized by this specification.

But additional field in attributes is not additional member. The **attributes** is member, or **data**. So in this case documentation is not clear. But for implementation purpose is better to aware client that he is doing something wrong. That should ensure consistency.

---

<div class="post-metadata">

**Author:** ![panman82](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/panman82/32/789_2.png) [@panman82](https://discuss.jsonapi.org/u/panman82)\
**Post date:** [December 18, 2019, 10:01pm UTC](https://discuss.jsonapi.org/t/extra-attributes-sent-from-client/1795/4 "2019-12-18T22:01:38Z")

</div>

Agreed. The documentation there is a bit contradictory. On one hand it says it MUST NOT have extra members, but if it does the server MUST ignore them… LOL

---

<div class="post-metadata">

**Author:** ![Bednic](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@Bednic](https://discuss.jsonapi.org/u/Bednic)\
**Post date:** [December 18, 2019, 10:04pm UTC](https://discuss.jsonapi.org/t/extra-attributes-sent-from-client/1795/5 "2019-12-18T22:04:13Z")

</div>

So I just throw an error. Let that sink…🕶🎤
