# Array of numbers in JSON (0.109 vs 0.110)

**URL:** <https://discourse.gohugo.io/t/array-of-numbers-in-json-0-109-vs-0-110/42492>\
**Category:** support\
**Created:** [January 18, 2023, 1:48pm UTC](https://discourse.gohugo.io/t/array-of-numbers-in-json-0-109-vs-0-110/42492 "2023-01-18T13:48:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfriedli](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nfriedli/32/26027_2.png) [@nfriedli](https://discourse.gohugo.io/u/nfriedli)\
**Post date:** [January 18, 2023, 1:48pm UTC](https://discourse.gohugo.io/t/array-of-numbers-in-json-0-109-vs-0-110/42492/1 "2023-01-18T13:48:50Z")

</div>

For a fuse.js search, I create a json file.

With Hugo 0.109:

```auto
[{"NPA":["1853","1856","1860"],...

```

With Hugo 0.110:

```auto
[{"NPA":[1853,1856,1860],...

```

So with 110, I have an array of numbers. With 109 I had an array of strings. The fuse.js is broken with the 110 version (but it is my problem). I’m going to debug.

Here is my question. Where does this change in the final JSON come from:

- YAML metadata parsing?
- the jsonify filter transformation?
- the minification?

My repo is here: [GitHub - nfriedli/ma-paroisse.ch: Un site simple pour retrouver une paroisse réformée de Suisse romande en 5 secondes.](https://github.com/nfriedli/ma-paroisse.ch)  
And the JSON generator is here: [ma-paroisse.ch/index.json.json at main · nfriedli/ma-paroisse.ch · GitHub](https://github.com/nfriedli/ma-paroisse.ch/blob/main/layouts/index.json.json)

Subsidiary question. Is it possible to force an array of strings instead of an array of numbers, even if the input is int / numbers in YAML?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 18, 2023, 1:56pm UTC](https://discourse.gohugo.io/t/array-of-numbers-in-json-0-109-vs-0-110/42492/2 "2023-01-18T13:56:35Z")

</div>

See [https://github.com/gohugoio/hugo/pull/10625](https://github.com/gohugoio/hugo/pull/10625) which fixed [https://github.com/gohugoio/hugo/issues/10624](https://github.com/gohugoio/hugo/issues/10624).

---

<div class="post-metadata">

**Author:** ![nfriedli](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nfriedli/32/26027_2.png) [@nfriedli](https://discourse.gohugo.io/u/nfriedli)\
**Post date:** [January 18, 2023, 2:04pm UTC](https://discourse.gohugo.io/t/array-of-numbers-in-json-0-109-vs-0-110/42492/3 "2023-01-18T14:04:14Z")

</div>

Thank you. I was sure I saw something go by but I couldn’t find it anymore.

And do you have an idea for this? Is it possible to force an array of strings (in the final JSON) instead of an array of numbers, even if the input is int / numbers in YAML?

NB: I may also pass all these numbers in string with a simple regexp in my editor.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 18, 2023, 2:08pm UTC](https://discourse.gohugo.io/t/array-of-numbers-in-json-0-109-vs-0-110/42492/4 "2023-01-18T14:08:22Z")

</div>

> [@nfriedli](#):
>
> NB: I may also pass all these numbers in string with a simple regexp in my editor.

That’s the right way to do it.

Otherwise, I suppose you could do:

```auto
{{ $strings := apply .Params.foo "string" "." }}

```

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [January 20, 2023, 2:08pm UTC](https://discourse.gohugo.io/t/array-of-numbers-in-json-0-109-vs-0-110/42492/5 "2023-01-20T14:08:49Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
