I'm in Drupal 8. After activating the module rest, and try and receive a response from the route /user/login?_format=json I get this:
{
"current_user": {
"uid": "4",
"name": "cravushedal"
},
"csrf_token": "49TlM-VLnQcErR1W5vW7losJPLHXPpqE2UpLh9_bZzg",
"logout_token": "fkBNWh8iLoTbXPO4Elha86PVe_0I8L1JKIxXQ2KemMo"
}
Now I want to craete a view with all the users, but something like this:
{
"current_user": {
"uid": "3",
"name": "blablabla"
}
}
{
"current_user": {
"uid": "4",
"name": "cravushedal"
}
}
In my rest view, I have the name, uid, and a Global custom text. The name and the uid are hidden, and I am calling both fields in the global custom text. This is my result:
[{"current_user":"1josue"},{"current_user":"2slucuthivili"}]
It doesnt recognize the label, so I had try to include them manually, but the json add \n
or \what ever
and that destroy my json.
Any idea about how can I achieve this?? thanks!