{"action":"created","issue":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/699","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/699/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/699/comments","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/699/events","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/699","id":80901374,"number":699,"title":"Configuration format(s)","user":{"login":"kashike","id":5474071,"avatar_url":"https://avatars.githubusercontent.com/u/5474071?v=3","gravatar_id":"","url":"https://api.github.com/users/kashike","html_url":"https://github.com/kashike","followers_url":"https://api.github.com/users/kashike/followers","following_url":"https://api.github.com/users/kashike/following{/other_user}","gists_url":"https://api.github.com/users/kashike/gists{/gist_id}","starred_url":"https://api.github.com/users/kashike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kashike/subscriptions","organizations_url":"https://api.github.com/users/kashike/orgs","repos_url":"https://api.github.com/users/kashike/repos","events_url":"https://api.github.com/users/kashike/events{/privacy}","received_events_url":"https://api.github.com/users/kashike/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels/accepted","name":"accepted","color":"d4c5f9"},{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels/input%20wanted","name":"input wanted","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-05-26T10:28:32Z","updated_at":"2015-05-27T11:47:08Z","closed_at":"2015-05-26T20:49:51Z","body":"After a small talk with @gdude2002, I'm wondering why HOCON is the only provided configuration format (`configurate-hocon`). Quite a few people coming from Bukkit will want to continue using YAML as their configuration format (using the same configuration files across platforms, Bukkit server admins are familiar with YAML), and we're going to end up having plugins shadow/shade `configurate-yaml` all over the place. \r\n\r\nPrevious conversation in #spongedev last year:\r\n```\r\n[22:10:55] <@progwml6|L> GSON\r\n[22:11:00] <@sk89q> gson ion cp\r\n[22:11:01] <+Riking> Okay, well that needs to change then.\r\n[22:11:08] <@sk89q> is on*\r\n[22:11:08] <@progwml6|L> if its volatile its not a config file\r\n[22:11:10] <+Riking> Maybe a nice wrapper class around gson\r\n[22:11:12] <g> gson can actually be a pain in the ass\r\n[22:11:17] <@progwml6|L> we don't need a wrapper for gson\r\n[22:11:19] <g> magical typetokens\r\n[22:11:21] <@progwml6|L> use it directly\r\n[22:11:21] <g> I do love gson but\r\n[22:11:30] <@sk89q> write objects with gson\r\n[22:11:33] <g> most of the time I don't need something that complicated\r\n[22:11:34] <+Riking> yeah that removes the typetoken bullshit\r\n[22:11:39] <@sk89q> read objects\r\n[22:11:49] <@progwml6|L> typetokens are a useful tool in certain scenarios\r\n[22:11:58] <+Riking> but not for the general case\r\n[22:12:05] <@progwml6|L> there are ways to avoid using them\r\n[22:12:07] <+Riking> maybe I just want to store a number for every player\r\n[22:12:08] <g> I know it can do POJOs pretty easily\r\n[22:12:10] <@progwml6|L> but they are needed\r\n[22:12:29] <simon816> can gson do comments though?\r\n[22:12:37] <g> who cares, we're using it for data storage\r\n[22:12:38] <@progwml6|L> json doesn't have comments simon816\r\n[22:12:43] <+Riking> setInt(player.getUUID().toString(), score + 1)\r\n[22:12:52] <@progwml6|L> you don't need comments in data storage\r\n[22:12:52] <+Riking> Idea\r\n[22:12:54] <+modwizcode> How are we supposed to set config values?\r\n[22:12:56] <simon816> progwml6|L, I know, but is is a requirement for a config file\r\n[22:13:13] <+Riking> okay, one sec\r\n[22:13:15] <g> modwizcode, Configfile file = [...]; file = file.withValue(key, value);\r\n[22:13:17] <@progwml6|L> i can't find the gist handy\r\n[22:13:24] <g> file.save();\r\n[22:13:32] <@progwml6|L> that isn't the only way of doing it g\r\n[22:13:36] <+Riking> ^ do that in your /editconfig comand\r\n[22:13:37] <@sk89q> what is your use case for setting config\r\n[22:13:40] <g> well there's the fallback stuff\r\n[22:13:50] <g> sk89q, ingame config editing\r\n[22:13:53] <@progwml6|L> i personally prefer the fallback stuff for most uses\r\n[22:13:53] <+Riking> sk89q, a /foo config edit bar 30\r\n[22:14:06] <@progwml6|L> in those cases you are editing single values at a time\r\n[22:14:11] <@sk89q> cab with value\r\n[22:14:13] <@progwml6|L> so you change the value and resave\r\n[22:14:16] <g> so that's withValue, yeah?\r\n[22:14:18] <@sk89q> can\r\n[22:15:50] <@sk89q> brb\r\n[22:16:01] <g> this is just not logically what one would expect from something that should be way simpler\r\n[22:16:13] <@sk89q> well\r\n[22:16:25] <@sk89q> first brb\r\n[22:16:26] <g> that's really my only main gripe\r\n[22:16:27] <g> :P\r\n[22:16:38] <g> I saw greatman wrote a wrapper that makes it behave mutably so I may just use that\r\n[22:16:55] <@progwml6|L> configs are almost never changed\r\n[22:16:57] <@progwml6|L> ingame\r\n[22:17:04] <g> mine are o/\r\n[22:17:05] <@progwml6|L> so its not much of an issue when you change single things at a time\r\n[22:17:16] <@progwml6|L> if they change that often they aren't configs\r\n[22:17:18] <g> that's not really my gripe though\r\n[22:17:19] <@progwml6|L> they are data storage\r\n[22:17:21] <g> like..\r\n[22:17:30] <g> they don't behave like any other config class I've ever used\r\n[22:17:37] <+modwizcode> progwml6|L, lots of people use configs to store data.\r\n[22:17:38] <g> (in any language)\r\n[22:17:38] <@progwml6|L> its a different system\r\n[22:17:47] <g> yes, but it's unfamiliar\r\n[22:17:47] <@progwml6|L> i'm aware of that modwizcode\r\n[22:17:54] <g> a bunch of people tripped over it\r\n[22:18:12] <@progwml6|L> i'm sure they have tripped over it\r\n[22:18:24] <@progwml6|L> someone should contribute a tutorial for it to our docs repo :P\r\n[22:18:31] <g> I think using something this unfamiliar was a bad way of avoiding using some format you don't like\r\n[22:18:32] <g> ._.\r\n[22:18:43] <g> people will expect it to work like everything else does and get confused when it doesn't\r\n[22:18:46] <+modwizcode> We should NOT be forcing people to do something.\r\n[22:18:49] <g> like we all did\r\n[22:18:49] <g> lol\r\n[22:18:53] <g> yeah, that as well\r\n[22:18:59] <@progwml6|L> modwizcode that format is not welcome around the forge community\r\n[22:19:02] <+Kobata> Honestly I think it happened to already be there so we didn't have to include the library explictly\r\n[22:19:04] <@progwml6|L> many of us hate yaml with a pssion\r\n[22:19:13] <g> progwml6|L, feel free to hate it\r\n[22:19:14] <g> seriously\r\n[22:19:16] <simon816> As long as config can be changed in bulk, it would be wasteful creating lots of intermediate objects\r\n[22:19:18] <g> that's great, please continue\r\n[22:19:29] <+modwizcode> progwml6|L, We don't care what PEOPLE hate, we want a flexible API\r\n[22:19:40] <@progwml6|L> this all tells me that configs are being used for data storage\r\n[22:19:42] <g> yeah, it's not really your place to state that anyone using the software can't use it, or to write code that prevents people from doing so\r\n[22:19:46] <@progwml6|L> which is NOT what they are meant for\r\n[22:19:55] <g> progwml6|L, it's the only obvious thing to use for any kind of storage atm\r\n[22:20:01] <@progwml6|L> GSON\r\n[22:20:03] <g> as in, it's the only thing the api exposes directly\r\n[22:20:13] <g> yes, you tell me we have gson now\r\n[22:20:18] <g> that's not obvious without looking at the build.gradle\r\n[22:20:21] <+Riking> KeyValueStore\r\n[22:20:28] <+Riking> we need a KeyValueStore class\r\n[22:20:34] <g> Riking: ..a map?\r\n[22:20:37] <+modwizcode> Yes\r\n[22:20:37] <g> well, a serialised map\r\n[22:20:44] <@progwml6|L> go use GSON\r\n[22:20:48] <@progwml6|L> 2.2.4\r\n[22:20:50] <+Riking> g: Almost\r\n[22:21:01] <@progwml6|L> give me a minute i'll add it to build.gradle\r\n[22:21:03] <+Riking> the backing store wouldn't have to be a file\r\n[22:21:03] <+modwizcode> We can just use the standard java serialization APIs if we need to store data.\r\n[22:21:05] <@progwml6|L> i thougut it was there already\r\n[22:22:16] <g> maybe it's because I come from the bukkitdev scene\r\n[22:22:26] <g> but the bukkit config class was perfectly fine for data files as well\r\n[22:22:31] <+modwizcode> It was\r\n[22:22:39] <g> so it just seemed logical, since people here are mostly coming from bukkit\r\n[22:22:41] <@progwml6|L> it also lead to TONS of mixing of data and config\r\n[22:22:46] <g> well, sure\r\n[22:22:52] <g> but you have to know your audience\r\n[22:22:52] <@progwml6|L> which is rather annoying\r\n[22:22:57] <+modwizcode> We don't need to crush people out of a personal dislike for a valid option. YAML is an option, it's not inherently bad.\r\n[22:23:00] <g> though, all things considered, writing the perfect api is a bitch to get right\r\n[22:23:06] <@progwml6|L> bukkit did x isn't a reason to do it\r\n[22:23:13] <g> well duh\r\n[22:23:15] <g> I'm not saying that\r\n[22:23:22] <@progwml6|L> which is why we didn't bother to redo the typesafe api to make it mutable\r\n[22:23:31] <g> I'm just saying that not providing an obvious alternative is going to annoy people\r\n[22:23:37] <g> \"use gson\" is great but I can't see that in the docgen\r\n[22:23:52] <+modwizcode> If I need to change a lot of config with the typesafe api what do I do?\r\n[22:24:00] <g> withFallback I guess\r\n[22:24:36] <g> progwml6|L: so we have asserted that this thing has a specific use and is fine for that specific use\r\n[22:24:43] <g> so the problem now is making the alternative for other uses more obvious\r\n[22:24:52] <g> before people try to shoehorn this into doing things it's crap for\r\n[22:24:54] <g> if you see what I mean\r\n[22:25:14] <+Riking> ^\r\n[22:25:26] <@progwml6|L> someone will update the docs to mention gson\r\n[22:25:29] <@progwml6|L> not hard to do :P\r\n[22:25:33] <g> and yeah, don't try to stop people using yaml, that'll just make people not want to use sponge and we'll be back where we started\r\n[22:25:34] <+Riking> insufficient\r\n[22:25:50] <@progwml6|L> let me make this rather clear\r\n[22:26:03] <@progwml6|L> if i catch people using yaml for the sake of yaml that option WILL go on the table\r\n[22:26:12] <g> progwml6|L, your opinion is that you hate yaml\r\n[22:26:13] <g> and that is fine\r\n[22:26:21] <@progwml6|L> we picked a format\r\n[22:26:23] <g> but it's not your place to force that opinion onto other people\r\n[22:26:25] <+Riking> give people a way to store data\r\n[22:26:29] <@progwml6|L> use json\r\n[22:26:37] <g> \"use json\" is fine as a recommendation\r\n[22:26:48] <g> but you can't say \"you can't use yaml, das ist verboten\"\r\n[22:26:58] <@progwml6|L> i can and will say that g\r\n[22:27:06] <+modwizcode> progwml6|L, you don't have the right to say that\r\n[22:27:06] <g> then what does that put you on par with?\r\n[22:27:13] <simon816> looking way back into IRC log history, I remember there was discussion on config format.\r\n[22:27:17] <@progwml6|L> feel free to go look up US law :P\r\n[22:27:22] <@progwml6|L> i can say i don't like something :P\r\n[22:27:26] <g> yeah, you can\r\n[22:27:31] <g> but you can't force people to align to that\r\n[22:27:32] <g> lol\r\n[22:27:44] <+modwizcode> Exactly.\r\n[22:27:46] <g> go ahead and say it till the cows come home, I don't care\r\n[22:27:57] <g> I'll still use yaml if I want to use yaml\r\n[22:28:02] <g> because that's _my_ right\r\n[22:28:06] <+Riking> he doesn't have the moral right to ENFORCE it, modwizcode\r\n[22:28:19] <@progwml6|L> people mixed configs and data storage to the point of insanity\r\n[22:28:23] <+modwizcode> Riking, he doesn't have the right to try and do it at all.\r\n[22:28:26] <g> yes, but that's not your problem\r\n[22:28:31] <+Riking> you can't enforce an opinion\r\n[22:28:36] <+modwizcode> progwml6|L, crap code isn't breaking a law.\r\n[22:28:50] <+modwizcode> g We have to support developers who will do this and users who must deal with it\r\n[22:29:05] <@progwml6|L> we don't have to support those devs modwizcode\r\n[22:29:06] <g> modwizcode, that's my point..\r\n[22:29:12] <+Riking> we kinda do, progwml6|L\r\n[22:29:13] <@progwml6|L> alot of the data storage stuff has been on the list for 1.1\r\n[22:29:19] <g> hold on\r\n[22:29:22] <@progwml6|L> its impossible to do it right w/o the NBT access\r\n```"},"comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments/105881097","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/699#issuecomment-105881097","issue_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/699","id":105881097,"user":{"login":"ryantheleach","id":141554,"avatar_url":"https://avatars.githubusercontent.com/u/141554?v=3","gravatar_id":"","url":"https://api.github.com/users/ryantheleach","html_url":"https://github.com/ryantheleach","followers_url":"https://api.github.com/users/ryantheleach/followers","following_url":"https://api.github.com/users/ryantheleach/following{/other_user}","gists_url":"https://api.github.com/users/ryantheleach/gists{/gist_id}","starred_url":"https://api.github.com/users/ryantheleach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryantheleach/subscriptions","organizations_url":"https://api.github.com/users/ryantheleach/orgs","repos_url":"https://api.github.com/users/ryantheleach/repos","events_url":"https://api.github.com/users/ryantheleach/events{/privacy}","received_events_url":"https://api.github.com/users/ryantheleach/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T11:47:08Z","updated_at":"2015-05-27T11:47:08Z","body":"@gdude2002 I have, twice now.\r\n\r\nI don't see it as an API issue. Wouldn't this rather be an implementation issue?\r\n\r\nPoint 1 relates to whichever implementation is used, point 2 relates to the API as does point 3."}}