All serialized values are strings, including integers/booleans in Views

Created on 23 July 2021, about 3 years ago
Updated 5 May 2023, over 1 year ago

Problem/Motivation

When I create a REST EXPORT in Views, all the fields in the result JSON are Strings, including integers and booleans. I was expecting them to be ints, bools etc whenever appropriate. I've read that this is an old issue that has long been fixed ( https://www.drupal.org/node/2837696 β†’ ) prior to Drupal 9.

It looks like the fields are serialized properly in other areas via JSON API (directly through their node), but in Views, all the fields are serialized as Strings...

Steps to reproduce

Create a Rest Export in View, add some Int fields like Content ID or User ID. The fields in that JSON result are all Strings.

πŸ› Bug report
Status

Active

Version

9.5

Component
SerializationΒ  β†’

Last updated 8 days ago

Created by

πŸ‡¦πŸ‡ΊAustralia Irous

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada jigarius MontrΓ©al

    I'm facing the same issue. When I try to use the JSON feeds with the Migrate API, the --sync option is strict with data types, so it doesn't like it when these IDs are string and the migration defines those IDs as int.

Production build 0.71.5 2024