Set body format for a node when it is updated via REST API I noticed that when I PATCH a node and update the body value, the body format and summary are set to null.

If I try to add the summary and format to the json sent to the API, I receive an error saying:

Unprocessable Entity: validation failed.
Body: this field cannot hold more than 1 values


Any ideas why I get this error and how can I preserve the body format?

This is my js object:

{
  title: { value: this.state.title }, 
  body: { value: this.state.body, format: "basic_html" }, 
  type: { target_id: 'article' },
  _links: {
    type: {
      href: 'http://localsite.dev/rest/type/node/article'
    }
  },
}


If I remove the format: "basic_html" part, I get no errors but the format and summary are set to null.

Thanks.
Kind of surprised this even works. The value of a field is a list of field items. Try something like this:

body: [ { value: this.state.body, format: "basic_html" } ],