kaue / jsonexport

{} → :page_facing_up: it's easy to convert JSON to CSV
http://kaue.github.io/jsonexport/
Apache License 2.0
247 stars 41 forks source link

Wrong output in multi-array set #57

Closed anuj1405 closed 4 years ago

anuj1405 commented 5 years ago

This is the JSON:

[{
   "orderId": "111-8763976-4506632",
   "version3.0": {
      "customizationInfo": {
         "surfaces": [
            {
               "name": "Angled Above Handle",
               "areas": [
                  {
                     "name": "Choose Knife",
                     "optionImage": ""
                  }
               ]
            },
            {
               "name": "Right Face",
               "areas": [
                  {
                     "name": "Right Face Engraving",
                     "optionImage": "https://m.media-amazon.com/images/S/pc-vendor-gallery-prod/A17JMGFJQ7S29T/options/2018-08-24/ef64d10d-7668-42f1-a0ea-6c9971c13a0f.png"
                  }
               ]
            }
         ]
      }
   }
}]

and the output we are getting is

screen shot 2018-12-07 at 12 52 52 am

See the column "customizationInfo.surfaces.areas.optionImage". The value should be there on the 2 row instead of first

Thanks

kaue commented 5 years ago

@anuj1405 this is a feature. please check https://github.com/kauegimenes/jsonexport/issues/22 You should use fillGaps: true to get the optionImage filled in both rows

kaue commented 5 years ago

Oh now i see whats happening, indeed this is a bug. and its prob caused by #22

kaue commented 5 years ago

We are always looking for new contributors, you want to help us fix this issue? feel free to start a PR on this =)

markwynter commented 5 years ago

I've got similar problem. I've set FillGaps = true, but subscriber1 CustomFields values not shifting down in CSV. The JSON data is from Campaign Monitor API. Simple input and output files attached to demonstrate problem. What support do you need to fix the bug? Archive_CM.zip

toxuin commented 5 years ago

This is still broken. Renders jsonexport unusable for my usecase.

kaue commented 4 years ago

@anuj1405 @markwynter @toxuin I introduced a new option to jsonexport called fillTopRow that should be desabled by default. (https://github.com/kauegimenes/jsonexport/pull/68) After this PR gets merged you guys should be able to get the expected results.