Skip to content

Latest commit

 

History

History
52 lines (46 loc) · 766 Bytes

README.md

File metadata and controls

52 lines (46 loc) · 766 Bytes

mazurka_mediatype_hyperjson

hyper+json media type for mazurka

Examples

Collection

{
  collection: [
    @users:get(user) + {
      name: users:get_name(user)
    }
  || user <- users:list()]
  create: @users:create()
}

results in

{
  "href": "/users",
  "collection": [
    {
      "href": "/users/1",
      "name": "Joe"
    },
    {
      "href": "/users/2",
      "name": "Mike"
    },
    {
      "href": "/users/2",
      "name": "Robert"
    }
  ],
  "create": {
    "action": "/users",
    "method": "POST",
    "input": {
      "name": {
        "type": "text",
        "required": true
      }
    }
  }
}