Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#raw output on rich text fields contains model objects #142

Open
dpikt opened this issue Apr 6, 2020 · 2 comments
Open

#raw output on rich text fields contains model objects #142

dpikt opened this issue Apr 6, 2020 · 2 comments

Comments

@dpikt
Copy link

dpikt commented Apr 6, 2020

Not sure if this is a bug or expected behavior- feel free to close if it's the latter.

I've got a model that has a rich text field with an embedded entry. When I call #raw on an instance of that model, the output contains the entry ruby object:

$ MyModel.raw

{
 "sys"=>{...},
 "fields"=> {
   "richTextField"=>
    {
      "data"=>{},
      "content"=>
      [{"data"=>{}, "content"=>[{"data"=>{}, "marks"=>[], "value"=>"", "nodeType"=>"text"}], "nodeType"=>"paragraph"},
       ...
       # Right here
       {"data"=>{"target"=><RelatedFile[relatedFiles] id=‘1JZpjo5NYPjYlvIZiIM8w5’>}, "content"=>[], "nodeType"=>"embedded-entry-block"},
      ],
     "nodeType"=>"document"
    }
  }
}

Should this just be the JSON of the API response instead?

@asknacho
Copy link

Still happening today, should we switch to Contentful::Client for this?

@dlitvakb
Copy link
Contributor

dlitvakb commented Mar 22, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants