# Flat json with Akka Stream

**URL:** <https://discuss.akka.io/t/flat-json-with-akka-stream/5138>\
**Category:** Akka Streams & Alpakka\
**Created:** [September 26, 2019, 7:57pm UTC](https://discuss.akka.io/t/flat-json-with-akka-stream/5138 "2019-09-26T19:57:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonatasfreitasv](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/jonatasfreitasv/32/1471_2.png) [@jonatasfreitasv](https://discuss.akka.io/u/jonatasfreitasv)\
**Post date:** [September 26, 2019, 7:57pm UTC](https://discuss.akka.io/t/flat-json-with-akka-stream/5138/1 "2019-09-26T19:57:49Z")

</div>

Hello guys,

I’m using Play Json to work with json data.

with Akka Stream I have this input:

```auto
{
          "sku": 0,
          "buffer": 0,
          "consistency": 0,
          "inner": 0,
          "stores": [
            {
                "store": 1,
                "eoh": 0,
                "store_last_received": "yyyy-MM-dd",
                "store_sales_qtd_last_six_weeks": 0,
                "store_size": "G",
                "store_lead_time": 0,
                "vm": 0
            },
            {
                "store": 2,
                "eoh": 0,
                "store_last_received": "yyyy-MM-dd",
                "store_sales_qtd_last_six_weeks": 0,
                "store_size": "G",
                "store_lead_time": 0,
                "vm": 0
            }
          ]
 }

```

I need to make this output, one event per “stores” array, with this example, enter 1 event and out 2 events, with this schema:

```auto
//// EVENT 1
{
    "sku": 0,
    "buffer": 0,
    "consistency": 0,
    "inner": 0,
    "store": 2,
    "eoh": 0,
    "store_last_received": "yyyy-MM-dd",
    "store_sales_qtd_last_six_weeks": 0,
    "store_size": "G",
    "store_lead_time": 0,
    "vm": 0,

    "forecast": 0,
    "vm_fulfilled": false,
    "consistency_fulfilled": false,
    "final_buffer": 0
}

//// EVENT 2
{
    "sku": 0,
    "buffer": 0,
    "consistency": 0,
    "inner": 0,
    "store": 1,
    "eoh": 0,
    "store_last_received": "yyyy-MM-dd",
    "store_sales_qtd_last_six_weeks": 0,
    "store_size": "G",
    "store_lead_time": 0,
    "vm": 0,

    "forecast": 0,
    "vm_fulfilled": false,
    "consistency_fulfilled": false,
    "final_buffer": 0
}

```

---

<div class="post-metadata">

**Author:** ![jonatasfreitasv](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/jonatasfreitasv/32/1471_2.png) [@jonatasfreitasv](https://discuss.akka.io/u/jonatasfreitasv)\
**Post date:** [September 26, 2019, 9:22pm UTC](https://discuss.akka.io/t/flat-json-with-akka-stream/5138/2 "2019-09-26T21:22:54Z")

</div>

I solve with mapConcat, thx!
