title: JSON Hypermedia Api with forms and links
body: <p>I am in the early stages of planning a REST api, and I would like for it to adhere to the HATEOAS constraint of REST. But I would also like to provide a JSON format. So my question is if there are conventions out there to represent links and forms in JSON.</p>
  
  <p>I have found examples of links, and it looks like this is a pretty common way of representing links:</p>
  
  <pre><code>"links": [ 
  {"rel": "self", "href":"http://example.org/entity/1"},
  {"rel": "friends", "href":"http://example.org/entity/1/friends"}] 
  </code></pre>
  
  <p>Representing forms on the other hand, is not something that I have seen much of. I was thinking that perhaps somebody had sat down and thought up something along these lines, but considered all the caveats:</p>
  
  <pre><code>"forms" : [
  {"rel" : "new client", "action" : "/clients", "method": "post", 
  "fields" : ["name":"string", "zipcode":"int", "signedup":"date", "state": ["Alabama",...]...]}]
  </code></pre>
  
  <p>The inspiration for this comes from looking at this video, where Jon Moore suggests that JSON is not a good format for a hypermedia api:</p>
  
  <p><a href="http://oredev.org/2010/sessions/hypermedia-apis" rel="noreferrer">http://oredev.org/2010/sessions/hypermedia-apis</a></p>
  
  <p>A really good talk by the way!</p>
  
  <p>All input is appreciated!</p>