Open mmmoli opened 9 years ago
We've merged this module into Wagtail 1.0 (you can find it in the 1.0rc1 release) and have made a few changes to the way foreign keys are serialised:
...
category: {
id: 3,
meta: {
"type": "blog.Category",
"detail_url": "http://api.example.com/categories/3/"
}
}
Out of the box, this doesn't allow you to stick the name field into that nested mapping. This is a feature that we hope to have implemented in Wagtail API soon.
Just wondering if ability to nest categories has been implemented yet?
Yes, It's implemented in Wagtail API v2. See http://docs.wagtail.io/en/v1.13/advanced_topics/api/v2/usage.html#additional-fields
With the above configuration, you should be able to get the category name nested by adding ?fields=category(name)
to the URL.
I'm trying to get a nested resource into the api output. But I'm only seeing the foreign key.
I've got a structure like so:
This results in an API response like:
I'm looking for something more like:
Any tips? Only see a mention of
relatedLink
in the tests.Thanks
Ace addition to Wagtail btw.