hyper+json media type for mazurka
Elixir
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
test
.gitignore
LICENSE
README.md
mix.exs

README.md

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
      }
    }
  }
}