JSON representation of emoji packs is inconsistent
While writing a spec for the emoji pack format I found two representation for basically the same data.
Stuff like what we have at https://git.pleroma.social/pleroma/emoji-index/ will give it in this kind of format:
{
"finmoji": {
"license": "CC BY-NC-ND 4.0",
"homepage": "https://finland.fi/emoji/",
"description": "Finland is the first country in the world to publish its own set of country themed emojis. The Finland emoji collection contains 56 tongue-in-cheek emotions, which were created to explain some hard-to-describe Finnish emotions, Finnish words and customs.",
"src": "https://finland.fi/wp-content/uploads/2017/06/finland-emojis.zip",
"src_sha256": "2C1374795AA23C032B2E9ED68C695A0452BCBB13F77DB90E883E1233ACAD2DA5",
"files": "finmoji.json"
},
…
}
While /api/pleroma/emoji/packs
will give it in this kind of format:
{
"chronemotes_4": {
"files": {
"bpwant": "bpwant.png",
"sopmodjam": "sopmodjam.gif",
"kazumapft": "kazumapft.png",
"meguminpensive": "meguminpensive.png",
"sopmodexcite": "sopmodexcite.gif",
"aquadrunk": "aquadrunk.png",
…
},
"pack": {
"can-download": true,
"description": "Emojis from Discord server Chronemotes 4",
"download-sha256": "628ECF4EBE116F68D2DF3408A133928BC7509EAAE01CD0CA53821A6FE40220AF",
"homepage": "https://example.org",
"license": "Unknown",
"share-files": true
}
},
…
}
Main difference being that the API puts the metadata fields other than files in the "pack"
field and key names are dash-joined (kebab casing?) while the index.json
puts the metadata fields directly and key names are in snake_case.