3

I want to use a custom field in my Views REST export, but rather than having "nothing": "My custom text", I would like "mycustomtext": "My custom text". Is there a way to do this from within the UI?

1 Answer 1

7

Serializer settings: force using field & json

Show: fields

Show settings: type an alias for each field

Above settings are shown in the images below

enter image description here

enter image description here

enter image description here

1
  • 2
    Despite “no code answer” requested, it’s also quite easy to provide your own Normalizer class if this doesn’t exactly suit.
    – Kevin
    Mar 10, 2018 at 23:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.