Created
March 13, 2012 05:42
-
-
Save Sutto/2027037 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in response to http://twitter.com/#!/sj26/status/179435393622605825 - Namely, did I consider using Headers on the response. | |
Now, I didn't consider them in depth but I did consider them a little. Most of the reasons to use them were pragmatic in nature | |
(following a possibly flawed thought pattern): | |
- I felt that those details about the data are part of the data itself - versus extra metadata about the resource in general. | |
- Collections still ideally to be under an object (versus an array) for security reasons - http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx | |
- In doing so, it makes sense that if you're going to put the data inside a nested object, ideally you should place the data there as well for consistency. | |
- It makes the style of clients slightly easier because JSON conveys type information not necessarily present in headers. | |
- Unicorns. | |
With all of that said and done, one of the items on the cards for rocket pants is the ability to flip that around - Basically, the idea of presenters in the regards they handle setting the metadata on the request. The usefulness then being it's easier to do things like https://en.wikipedia.org/wiki/HATEOAS without having to manually override stuff. Likewise, things like switching the way versioning is handled should be optionated but easy to switch out if you disagree. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think I'd argue that it goes against discoverability, but the benefits I think are def. worth making it one of the default options. I'll have a look into it. I'm also planning on taking some of the design ideas from Designing Hypermedia APIs into consideration for the next major release.