I have a few questions about this thread: https://groups.google.com/forum/#!topic/wagtail-developers/Z4oaCIJXYuI
I am building a headless Wagtail, with a React-based frontend, that calls Wagtail API in order to parse JSON and display content. Pretty basic.
I was wondering if it was possible to custom the output of streamfield in rest API. A few examples:
- Get a image URL based on this example from wagtaildemo: https://github.com/wagtail/wagtaildemo/blob/api-tweaks/demo/models.py#L713-L716 (I got it working for single URLs)
- PageChooserBlock: get a field from the targetted page
As I read in the topic linked above, the Wagtail API v1 was not ready for custom representation of Streamfield in it. Did it change since v2 ? (I didn't notice anything related in changelogs) If not, does anyone have some tips about how I could achieve such a thing?
I already planned on build a custom image model to get URL by calling api/v2/images/id
, but I would love to get all these into one JSON response ????.