SHARE
TWEET

Untitled

a guest Jan 13th, 2016 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. {
  3.     "title": "Written Article",
  4.     "type": "object",
  5.     "properties": {
  6.         "id": {
  7.             "title": "Article Identifier",
  8.             "type": "id"
  9.         },
  10.         "title": {
  11.             "title": "Article Title",
  12.             "type": "field"
  13.         },
  14.         "authorId": {
  15.             "type": "field"
  16.         },
  17.         "imgData": {
  18.             "title": "Article Illustration (small)",
  19.             "type": "image",
  20.             "media": {
  21.                 "binaryEncoding": "base64",
  22.                 "type": "image/png"
  23.             }
  24.         }
  25.     },
  26.     "required" : ["id", "title", "authorId"],
  27.     "links": [
  28.         {
  29.             "rel": "full",
  30.             "href": "{id}"
  31.         },
  32.         {
  33.             "rel": "author",
  34.             "href": "/user?id={authorId}"
  35.         }
  36.     ]
  37. }
  38.  
  39.  
  40. ############################## OR THIS ##################################
  41.  
  42. {
  43.     "title": "News post",
  44.     ...
  45.     "links": [
  46.         {
  47.             "rel": "comments",
  48.             "href": "/{id}/comments"
  49.         },
  50.         {
  51.             "rel": "search",
  52.             "href": "/{id}/comments",
  53.             "schema": {
  54.                 "type": "object",
  55.                 "properties": {
  56.                     "searchTerm": {
  57.                         "type": "string"
  58.                     },
  59.                     "itemsPerPage": {
  60.                         "type": "integer",
  61.                         "minimum": 10,
  62.                         "multipleOf": 10,
  63.                         "default": 20
  64.                     }
  65.                 },
  66.                 "required": ["searchTerm"]
  67.             }
  68.         },
  69.         {
  70.             "title": "Post a comment",
  71.             "rel": "create",
  72.             "href": "/{id}/comments",
  73.             "method": "POST",
  74.             "schema": {
  75.                 "type": "object",
  76.                 "properties": {
  77.                     "message": {
  78.                         "type": "string"
  79.                     }
  80.                 },
  81.                 "required": ["message"]
  82.             }
  83.         }
  84.     ]
  85. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top