- Issue created by @ressa
When exporting data with REST in Views, it would be nice to be able to define an item selector (item_selector
), since it is used in most Migrate examples, like this:
item_selector: product
From migrate_plus.migration.product.yml in Migrate Plus.
See for example How to parse JSON feed from a d8 into another d8 site using Feeds Migrate Module for someone else needing this.
Perhaps item_selector: 0
could function as a workaround?
Create a REST export in Views, and see that there is no targetable item_selector:
[
{
"nid": [
{
"value": 14
}],
[...]
See that most Migrate examples use an item_selector
, and that it's present in the Migrate Plus example:
{
"product": [
{
"upc": "11111",
"name": "Widget",
"description": "Helpful for many things.",
"price": "14.99"
},
[...]
https://git.drupalcode.org/project/migrate_plus/-/blob/6.0.x/migrate_jso...
Add an optional "Item Selector" field in REST export Views, maybe under Format > Settings?
Accepted request formats
[ ] json
[ ] xml
Request formats that will be allowed in responses. If none are selected all formats will be allowed.
Item Selector
[ Products ]
Will wrap the exported data with this value.
Decide if it's a good idea, and add the feature if we think it is.
Active
10.1 ✨