Field Collection RESTful API rendered in HTML

孤人 提交于 2019-12-11 06:03:57

问题


I'm not sure this is a bug or what. But when I create API view page and add field (which is field collection), it rendered HTML instead of 'neat' JSON.

For example it should be look like :

field_collection_name: [
   {
     "title": "Big Title"
     "field_a": "content"
   },
   {
     "title": "Big Title 2"
     "field_a": "content 2"
   },
   {
     "title": "Big Title 3"
     "field_a": "content 3"
   }
]

Instead, the JSON in api view render like this:

field_collection_name: <div class="field--name-title">Big Title</div><div class="field--name-field_a">content</div><div class="field--name-title">Big Title2</div><div class="field--name-field_a">content 2</div><div class="field--name-title">Big Title 3</div><div class="field--name-field_a">content 3</div>

Anyone experience same problem like this before? Any settings need to set for field collection?

来源:https://stackoverflow.com/questions/44489797/field-collection-restful-api-rendered-in-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!