JSON serialization for Web Linking

Document Type Active Internet-Draft (individual)
Last updated 2020-01-09
Stream (None)
Intended RFC status (None)
Formats plain text xml pdf htmlized (tools) htmlized bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
Network Working Group                                             E. Pot
Intended status: Standards Track                              G. Sullice
Expires: July 12, 2020                                      Acquia, Inc.
                                                        January 09, 2020

                   JSON serialization for Web Linking


   This specification defines a serialization of Web Linking [RFC8288]
   in the JSON [RFC8259] format.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on July 12, 2020.

Copyright Notice

   Copyright (c) 2020 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Pot & Sullice             Expires July 12, 2020                 [Page 1]
Internet-Draft     JSON serialization for Web Linking       January 2020

1.  Introduction

   There are many JSON-based standards and formats that require the need
   to express a link.  Examples can be found in [draft-kelly-json-hal],
   [JSON-API], [WEBTHING], [draft-nottingham-json-home],
   [COLLECTIONJSON], [SIREN] and many others.

   Because there hasn't been an accepted reference for serializing Web
   Links in JSON, it's typical for authors of new formats to invent
   their own.  This has resulted in many minor differences between
   serializations, making it difficult to write generic parsers.

   This document is an attempt to define a standard JSON serialization
   for Web linking.  A primary goal is to define a format that's
   relatively uncontroversial and similar to existing serializations.

   Furthermore, this specification defines an optional format for groups
   of links and a recommendation for defining document-wide links.

2.  Format

2.1.  The link object.

   A link will be encoded as a JSON [RFC8259] object.  The object might
   support the properties from the following chapters, but only "rel"
   and "href" are required.

2.1.1.  rel

   The "rel" property refers to Section 3.3 of [RFC8288].  The "rel"
   property must be a string.

   There is no support to encode multiple relation types for a single
   link.  To encode multiple relation types, the link must appear
   multiple times in the document.

2.1.2.  href

   The "href" property refers to the Link Target, defined in Section 3.1
   of [RFC8288].

   The property is required and must be specified as a string.

2.1.3.  anchor

   The "anchor" attribute is defined in Section 3.2 of [RFC8288].  This
   specification alters the behavior of anchor.  By default, if anchor

Pot & Sullice             Expires July 12, 2020                 [Page 2]
Internet-Draft     JSON serialization for Web Linking       January 2020

   is not specified the link context is considered to be the URL of the
   representation it is associated with.

   If the link appears alongside a link with the 'self' relation type
   (for example in Section 2.2 of links, the target of the self link
   MUST be used as the default link context, unless the anchor attribute
   is defined.

   If the link is not part of a list of links that has a link relation
   of type 'self', the default behavior is to use the URL of the
   representation it's associated with.

   However, implementors of this specification MAY override this.
   Because JSON links may have deeper contextual meaning depending on
   where it appears in the document.

2.1.4.  Other attributes

   The link object may also encode the "hreflang", "media", "type"
   attributes.  These properties are all defined in Section 3.4.1 of
   [RFC8288].  In their JSON serialization they are all optional, and
   must be encoded as a string.

   Section 3.4.1 also defines a "title*" attribute, which may contain an
   alternative encoding for the "title" attribute.
Show full document text