Printf "$T" retrieving wrong type via getJSON

With the sample data you provided via DM, this works fine.

{{ $obj := site.Data.nodepage }}
{{ $data := $obj | transform.Remarshal "YAML" | transform.Unmarshal }}

{{ (index $obj.data 0).attributes.drupal_internal__nid | warnf "%[1]v (%[1]T)" }} --> 4 (float64)
{{ (index $data.data 0).attributes.drupal_internal__nid | warnf "%[1]v (%[1]T)" }} --> 4 (int)

As noted above in a previous comment:

JSON Unmarshal Remarshal to YAML + Unmarshal
1 (int) 1.0 (float64) 1 (int)
1.0 (float) 1.0 (float64) 1 (int)
67.42 (float) 67.42 (float64) 67.42 (float64)
"1.0" (string) "1.0" (string) "1.0" (string)
1 Like