JSON-to-Figma icon indicating copy to clipboard operation
JSON-to-Figma copied to clipboard

Support for object and not only array of objects

Open barning opened this issue 2 years ago • 5 comments
trafficstars

Hey, would it be possible to also support this kind of json?

{
  "name": "John Doe",
  "age": 32,
  "is_admin": true,
  "skills": ["JavaScript", "HTML", "CSS"]
}

My workaround right now is to put the object into an array. Some APIs simply don't return an array of objects and this change would be really helpful.

barning avatar Dec 12 '22 13:12 barning

bump!

jausto avatar Dec 22 '22 01:12 jausto

@barning your example is just one object. You can't fill multiple things with it. Can you provide another example? How it would look like?

Like this?

{
  "user1": {
    ...data
  },
  {
  "user2": {
    ...data
  }
}

PavelLaptev avatar Jan 15 '23 00:01 PavelLaptev

Yes, it would look like this.

barning avatar Jan 15 '23 16:01 barning

@barning @jausto can you add here a few real samples I can work with? Don't need to share whole files, but real example will be helpful.

PavelLaptev avatar Jan 16 '23 23:01 PavelLaptev

@PavelLaptev I cannot share real examples but this comes pretty close.

{
  "id": 1231511,
  "urn": "urn",
  "tag": "tag",
  "boolean": true,
  "name": "Name",
  "keywords": null,
  "zip_code": "*",
  "city": "*",
  "country": "de",
  "visible": true,
  "public": true,
  "array": [
    "1",
    "2",
    "3"
  ],
  "another_array": [
    "1",
    "2",
    "3"
  ],
  "another_boolean": true
}

barning avatar Mar 21 '23 08:03 barning