# JSON decoding a list of objects, just get the keys

**URL:** https://discourse.elm-lang.org/t/json-decoding-a-list-of-objects-just-get-the-keys/9031
**Category:** Learn
**Created:** [March 27, 2023, 3:55pm UTC](https://discourse.elm-lang.org/t/json-decoding-a-list-of-objects-just-get-the-keys/9031 "2023-03-27T15:55:13Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Charlon](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charlon](https://discourse.elm-lang.org/u/Charlon)
#### Post date: [March 27, 2023, 7:11pm UTC](https://discourse.elm-lang.org/t/json-decoding-a-list-of-objects-just-get-the-keys/9031/4 "2023-03-27T19:11:01Z")

</div>

Could you try changing `versionsDecoder` to:

```auto
versionsDecoder =
    Decode.list (Decode.keyValuePairs Decode.value)
        |> Decode.map (List.concatMap identity)
        |> Decode.map buildVersions

```

It feels like it should work.

It’s better to ask this kind of question on [slack](https://elm-lang.org/community/slack) even though it’s a pretty long question. 🙂  
([discourse](https://discourse.elm-lang.org/t/welcome-to-the-elm-discourse/8) rules)

---

_[View the full topic](https://discourse.elm-lang.org/t/json-decoding-a-list-of-objects-just-get-the-keys/9031)._
