Answers.Body: <p>I just came across this problem and solved it by editing the <strong>JsonExpandService.php</strong> file (located in craft/plugins/jsonexpand/services/) in two places.</p>
  
  <p>Change line 101 from this:</p>
  
  <pre><code>$relatedArray[$subHandle] = $subValue;
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>if($subField['type'] == "RichText") {
      // Rich Text field values need to be converted to a string
      $relatedArray[$subHandle] = (string)$subValue;
  } else {
      $relatedArray[$subHandle] = $subValue;
  }
  </code></pre>
  
  <p>And change line 115 from this:</p>
  
  <pre><code>$entryData[$handle] = $value;
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>if($field['type'] == "RichText") {
      $entryData[$handle] = (string)$value;
  } else {
      $entryData[$handle] = $value;
  }
  </code></pre>
  
  <p>This fixed Rich Text fields coming through as empty objects for me.</p>
  
  <p>This plugin hasn't been updated in 3 years, so Craft probably changed something about how Rich Text fields are outputted and the plugin never adjusted. Just a guess.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-21T15:41:36.727Z
Answers.LastActivityDate: 2017-09-21T15:41:36.727Z
Answers.UserDisplayName: Luke Peters
Body: <p>Is anybody using the <a href="https://github.com/familiar-studio/craft-json-expand" rel="nofollow">json_expand plugin</a> for API functionality?
  For the entry type Rich Text Field its just returning an empty object.</p>
  
  <p>This is my json_expand endpoint:</p>
  
  <pre><code>{% header "Content-Type: application/json" %}
  {% set utensils = craft.entries.section('utensils').find('') %}
  {{ utensils | json_expand | raw  }}
  </code></pre>
  
  <p>It's returning everything except that Rich Text field which just returns this:</p>
  
  <pre><code>"utensil_textbox": {}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-17T17:35:47.160Z
Comments.Text: Total shot in the dark, but scroll to the bottom of [this thread](http://craftcms.stackexchange.com/questions/12515/why-is-the-summary-and-body-returning-an-empty-object-using-the-element-api/12577) I was having a similar problem with using the ElementAPI + rich text field.
Comments.UserDisplayName: Damon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-17T17:37:35.063Z
Comments.Text: Never used JSON Expand plugin, but try this:  `{{ utensils.getRawContent() | json_expand | raw  }}`
Comments.UserDisplayName: Brad Bell
Tags: <plugin-jsonexpand>
Title: Rich Text Field is returning an empty object over api of plugin json_expand
ThreadText: # Rich Text Field is returning an empty object over api of plugin json_expand
  
  (Asked by: username_0 on 2016-02-17)
  
  Is anybody using the [json\_expand plugin](https://github.com/familiar-studio/craft-json-expand) for API functionality?
  For the entry type Rich Text Field its just returning an empty object.
  
  This is my json\_expand endpoint:
  
  ```
  {% header "Content-Type: application/json" %}
  {% set utensils = craft.entries.section('utensils').find('') %}
  {{ utensils | json_expand | raw  }}
  
  ```
  
  It's returning everything except that Rich Text field which just returns this:
  
  ```
  "utensil_textbox": {}
  
  ```
  
  **Tags:** plugin-jsonexpand
  
  > **Comments:**
  > **username_1**: Total shot in the dark, but scroll to the bottom of [this thread](http://craftcms.stackexchange.com/questions/12515/why-is-the-summary-and-body-returning-an-empty-object-using-the-element-api/12577) I was having a similar problem with using the ElementAPI + rich text field.  
  > **username_2**: Never used JSON Expand plugin, but try this:  `{{ utensils.getRawContent() | json_expand | raw  }}`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2017-09-21. Score: 3
  
  I just came across this problem and solved it by editing the **JsonExpandService.php** file (located in craft/plugins/jsonexpand/services/) in two places.
  
  Change line 101 from this:
  
  ```
  $relatedArray[$subHandle] = $subValue;
  
  ```
  
  To this:
  
  ```
  if($subField['type'] == "RichText") {
      // Rich Text field values need to be converted to a string
      $relatedArray[$subHandle] = (string)$subValue;
  } else {
      $relatedArray[$subHandle] = $subValue;
  }
  
  ```
  
  And change line 115 from this:
  
  ```
  $entryData[$handle] = $value;
  
  ```
  
  To this:
  
  ```
  if($field['type'] == "RichText") {
      $entryData[$handle] = (string)$value;
  } else {
      $entryData[$handle] = $value;
  }
  
  ```
  
  This fixed Rich Text fields coming through as empty objects for me.
  
  This plugin hasn't been updated in 3 years, so Craft probably changed something about how Rich Text fields are outputted and the plugin never adjusted. Just a guess.
  
  
  ---
  
  