Šime Vidas on Nostr: For JSON data that contains info about people, what do you think of the idea of using ...
For JSON data that contains info about people, what do you think of the idea of using an array of strings for the name?
{
"workers": [
{
"name": ["John", "Doe"],
…
},
…
]
}
(as an alternative to having separate "firstName" and "lastName" fields)
worker.name.join(' ') // full name
worker.name.at(-1) // last name
Published at
2025-09-20 15:40:28 UTCEvent JSON
{
"id": "7b14d493564adf24b1130e6200f87b3e6bc9efaf96aef9bae129bce830d96116",
"pubkey": "9dbc8c0b29d485edca86e40325252b5884df4b056beba2c84e73d0ce2bc499ff",
"created_at": 1758382828,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/@simevidas/115237377062553541",
"web"
],
[
"proxy",
"https://mastodon.social/users/simevidas/statuses/115237377062553541",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/simevidas/statuses/115237377062553541",
"pink.momostr"
],
[
"-"
]
],
"content": "For JSON data that contains info about people, what do you think of the idea of using an array of strings for the name?\n\n{\n \"workers\": [\n {\n \"name\": [\"John\", \"Doe\"],\n …\n },\n …\n ]\n}\n\n(as an alternative to having separate \"firstName\" and \"lastName\" fields)\n\nworker.name.join(' ') // full name\nworker.name.at(-1) // last name",
"sig": "4b7c04d227d2014b9b832663131cf25eeedc1bc18e4ac578b5fb5f14a1911e21477dcc31da81d0164c133fcd95edd0416948852ce923689f03adb9f963e041e8"
}