Skip to content

Instantly share code, notes, and snippets.

@zdne
Last active August 29, 2015 14:04
Show Gist options
  • Save zdne/ae0434c4dcb07d61cc0e to your computer and use it in GitHub Desktop.
Save zdne/ae0434c4dcb07d61cc0e to your computer and use it in GitHub Desktop.
HAL description in MSON

HAL Object

  • _links - Links (to URIs)

    • {relation name}

      A resource may have multiple links that share the same link relation. For link relations that may have multiple links, we use an array of links.

    • curies (array)

      CURIE help providing links to resource documentation. HAL gives you a reserved link relation 'curies' which you can use to hint at the location of resource documentation.

      There can be multiple links in the 'curies' section. They come with a 'name' and a templated 'href' which must contain the {rel} placeholder.

      Links in turn can then prefix their 'rel' with a CURIE name. Associating the latest-posts link with the doc documentation CURIE results in a link 'rel' set to doc:latest-posts.

      To retrieve documentation about the latest-posts resource, the client will expand the associated CURIE link with the actual link's 'rel'. This would result in a URL http://haltalk.herokuapp.com/docs/latest-posts which is expected to return documentation about this resource.

      • Elements

        • (object)
          • name
          • href
          • templated
  • _embedded - Embedded Resources (i.e. other resources contained within them)

    • {relation name}
  • {additional properties} - State (your bog standard JSON or XML data)

Relation Object

  • href (required)
  • templated
@zdne
Copy link
Author

zdne commented Aug 5, 2014

Original specification: HAL - Hypertext Application Language

@zdne
Copy link
Author

zdne commented Aug 16, 2014

Please note this document is DEPRECATED

Refer to https://github.com/apiaryio/mson/blob/zdne/advanced-features/examples/HAL.md instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment