Conversation:
Notices
-
I hate data formats that add unneccesary complexity to something, and json and xml tend to do that in most cases. XML has a use at least though, I've yet to find something done in json that can't just be done with a plainer (and more human readable) file however.
-
@verius I don't think the JSON api representation is really a great use case that we couldn't do better in another format.
-
@verius If I can trade a few KB for the cause of human readability in the days when even the smallest data caps are measured in MB, I'm fine with that.
-
@verius I'm pretty sure even my toaster can read CSV files now
-
@verius Point being there's more than just json out there that's been out there for yonks.
-
@verius Personally, I'm probably just going to make the results of var_dump of appropriate variables human readable and call it a day, when I do my own API
-
@verius I'd not suggested that one because last I checked it wasn't really widely available on many platforms but I'd be all for using it if we could. To me being able to read the API output as a human is just as important as being able to read it as a bot or client application, because it can be an important part of proper unit testing.
-
@verius If I have an API I know returns the data for a class or object reliably as it is represented, and I can read that data easily myself, it becomes a very easy-to-use tool to detect problems in object and class data.
-
@verius GS is pretty good on the former, actually, but json is about as readable to me as ancient Greek.
-
@verius Yeah, but if you have a readable format like YAML then you railroad that need entirely.
Looks like it's gotten a lot more supported since I was using it occasionally at IBM. Well, I'm certainly not complaining.
-
@verius Looking at PECL it really got an uptick in support the last couple years. That's nice to see. There's a lib-yaml library that looks like it trivializes making representations in yaml, so I'd be pretty okay with implementing it in PHP. I can't speak for how easy it would be to use in Java though.
-
@verius http://php.net/manual/en/function.yaml-emit-file.php
Put a value and a filename in, get yaml out, seems pretty simple to me.
-
@verius Actually, if I can figure out the router in a sensible way, I could probably literally knock this out in a day. The only hangup at all is in using yaml we'd be introducing another requirement to the install of postActiv since its in PECL and isnt a standard distribution module.
-
@verius Pretty sure it's a package in EPEL too. So its just another parameter to add to the yum or apt-get train. I'll check to be sure though.
-
@verius By this I mean the router as in the url router internal to GS that it uses to map URLs
community.highlandarrow.com/api/new-api/hi-im-an-endpoint.yaml for instance
It's a very clumsy way of doing things.
-
@verius I'd probably make the api endpoints /api/postactiv-yaml/<individual-endpoint-name>.yaml for clarity
-
@verius "It's a very clumsy way of doing things."
If you think that's where the train of weird router shenanigans ends, ohhhh, you haven't tried to rewrite HTMLOutputter and been spinning wheels in the mud for two going on three months now :P
-
@verius I programmed for IBM Unix, this is small time fare for me haha. But that doesn't make it any less time-wastey figuring ways to resolve the technical debt.