Skip to content
Ingo Kuba edited this page Aug 25, 2020 · 8 revisions

HALO - Hypertext standard for UI generation

This document describes a media type that defines data and its references and is designed to provide a multilingual interface for managing this data.

1. Requirements

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

2. Multilingualism

A simple JSON object is used to display data in different languages. This object consists of several key-value pairs and MUST contain at least one entry.

key In the first version, the language key is defined as a two-character alpha-2 code according to [ISO 639-1:2002].

value Translation in the corresponding language.

{
  "en": "English translation",
  "de": "Deutsche Übersetzung",
  "fr": "Traduction française"
}

3. HALO Documents

A HALO document uses the JSON format described in [RFC4627] and uses the media type "application/halo+json". Each response MUST be a HALO entity described by three reserved attributes:

  1. "links": Contains links to other resources. This is an OPTIONAL element.
  2. "data": Contains the actual data of the resource. This attribute can be single- or multi-valued. This attribute is REQUIRED, but can contain an empty JSON object or array. The structure depends on the template of the call.
  3. "messages": Contains messages, which inform about error cause or success of a call. This is an OPTIONAL element. In case of an error there is always a JSON array with at least one element.
single-valued data multi-valued data
{
  "links": {...},
  "messages": [...],
  "data": {...}
}
{
    "links": {...},
    "messages": [...],
    "data": [...]
}