May Contain Nuts: The Case for API Labeling

API Strategy & Practice 2018 [https://events.linuxfoundation.org/events/apistrat-2018/]

Erik Wilde
API Academy, CA Technologies

September 25, 2018

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents Erik Wilde : May Contain Nuts: The Case for API Labeling

Contents

Erik Wilde : May Contain Nuts: The Case for API Labeling

(2) Summary

The technical aspect of APIs has been widely discussed with description languages such as Swagger/OpenAPI. The non-functional aspects are harder to formalize, but can also benefit from a framework in which information can be represented and used. The idea of "API Labels" is equivalent to that of standardized labeling systems in other product spaces, for example for food or for machinery. There often is a framework in place that allows users to understand key aspects of the product. This framework focuses on areas that are important and helpful to make an initial product selection. In the API space, numerous standards and best practices have evolved how APIs can be described and/or documented. This presentation provides an overview of the existing approaches, how to use them, and proposes an additional layer on top of which API labeling becomes more unified, and thus more useful.



Introduction

Outline (Introduction)

  1. Introduction [3]
  2. Why Labels? [5]
  3. Why API Labels? [9]
  4. The API Label Value Space [2]
  5. A Recipe for API Labels [4]
  6. Conclusions [4]
Introduction Erik Wilde : May Contain Nuts: The Case for API Labeling

(4) @dret on Twitter/GitHub

dret

Introduction Erik Wilde : May Contain Nuts: The Case for API Labeling

(5) API Academy [http://www.apiacademy.co/]

API Academy

Introduction Erik Wilde : May Contain Nuts: The Case for API Labeling

(6) About Me



Why Labels?

Outline (Why Labels?)

  1. Introduction [3]
  2. Why Labels? [5]
  3. Why API Labels? [9]
  4. The API Label Value Space [2]
  5. A Recipe for API Labels [4]
  6. Conclusions [4]
Why Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(8) Food Labels

Food Labels

Why Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(9) Safety Labels

Product Safety Labels

Why Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(10) Label Design and Complexity

vacuum-label.png

Why Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(11) OCD? Landscape Management!

vacuum-landscape.png

Why Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(12) Why Do Labels Work?

Goal: Information about all/many products in large landscapes.

Non-goal: Every possible detail about every single product.



Why API Labels?

Outline (Why API Labels?)

  1. Introduction [3]
  2. Why Labels? [5]
  3. Why API Labels? [9]
  4. The API Label Value Space [2]
  5. A Recipe for API Labels [4]
  6. Conclusions [4]
Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(14) Labels: Sharing + Loose Coupling

label-scenario-people.png

Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(15) API the APIs

If you want to say something about your API, say it through your API.


Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(17) API Label Scenarios



Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(18) Get API Labels

label-scenario-declared.png

Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(19) Get Certified Labels from 3rd Party

label-scenario-certified.png

Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(20) Get Labels Assigned by 3rd Party

label-scenario-assigned.png

Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(21) Assigned Labels for API Discovery

label-scenario-discovery-assigned.png

Why API Labels? Erik Wilde : May Contain Nuts: The Case for API Labeling

(22) Declared Labels for API Discovery

label-scenario-discovery-declared.png

The API Label Value Space

Outline (The API Label Value Space)

  1. Introduction [3]
  2. Why Labels? [5]
  3. Why API Labels? [9]
  4. The API Label Value Space [2]
  5. A Recipe for API Labels [4]
  6. Conclusions [4]
The API Label Value Space Erik Wilde : May Contain Nuts: The Case for API Labeling

(24) API Label Types



The API Label Value Space Erik Wilde : May Contain Nuts: The Case for API Labeling

(25) SPDX [https://spdx.org/] License Values [https://spdx.org/licenses/]

Full name Identifier
BSD Zero Clause License [https://spdx.org/licenses/0BSD.html] 0BSD
Attribution Assurance License [https://spdx.org/licenses/AAL.html] AAL
Abstyles License [https://spdx.org/licenses/Abstyles.html] Abstyles
Adobe Systems Incorporated Source Code License Agreement [https://spdx.org/licenses/Adobe-2006.html] Adobe-2006
Adobe Glyph List License [https://spdx.org/licenses/Adobe-Glyph.html] Adobe-Glyph
Amazon Digital Services License [https://spdx.org/licenses/ADSL.html] ADSL
Academic Free License v1.1 [https://spdx.org/licenses/AFL-1.1.html] AFL-1.1
Academic Free License v1.2 [https://spdx.org/licenses/AFL-1.2.html] AFL-1.2
Academic Free License v2.0 [https://spdx.org/licenses/AFL-2.0.html] AFL-2.0
Academic Free License v2.1 [https://spdx.org/licenses/AFL-2.1.html] AFL-2.1
Academic Free License v3.0 [https://spdx.org/licenses/AFL-3.0.html] AFL-3.0
Afmparse License [https://spdx.org/licenses/Afmparse.html] Afmparse
Affero General Public License v1.0 only [https://spdx.org/licenses/AGPL-1.0-only.html] AGPL-1.0-only
Affero General Public License v1.0 or later [https://spdx.org/licenses/AGPL-1.0-or-later.html] AGPL-1.0-or-later


A Recipe for API Labels

Outline (A Recipe for API Labels)

  1. Introduction [3]
  2. Why Labels? [5]
  3. Why API Labels? [9]
  4. The API Label Value Space [2]
  5. A Recipe for API Labels [4]
  6. Conclusions [4]
A Recipe for API Labels Erik Wilde : May Contain Nuts: The Case for API Labeling

(27) Get API Labels! But How?

label-scenario-declared.png

A Recipe for API Labels Erik Wilde : May Contain Nuts: The Case for API Labeling

(28) API Label Formats

label-scenario-formats.png

A Recipe for API Labels Erik Wilde : May Contain Nuts: The Case for API Labeling

(29) Home Documents for HTTP APIs [https://tools.ietf.org/html/draft-nottingham-json-home]

{
  "api": {
    "title": "Example API",
    "links": {
      "author": "mailto:api-admin@example.com",
      "describedBy": "https://example.com/api-docs/"
    }
  },
  "resources": {
    "tag:me@example.com,2016:widgets": {"href": "/widgets/"},
    "tag:me@example.com,2016:widget": {
      "hrefTemplate": "/widgets/{widget_id}",
      "hrefVars": {"widget_id": "https://example.org/param/widget"},
      "hints": {
        "allow": [
          "GET",
          "PUT",
          "DELETE",
          "PATCH"
        ],
        "formats": {"application/json": {}},
        "acceptPatch": ["application/json-patch+json"],
        "acceptRanges": ["bytes"]
      }
    }
  }
}


A Recipe for API Labels Erik Wilde : May Contain Nuts: The Case for API Labeling

(30) Finding Labels

  "api": {
    "title": "Example API",
    "links": {
      "author": "mailto:api-admin@example.com",
      "describedBy": "https://example.com/api-docs/",
      "labels": "https://example.com/labels.json"
    }
{"labels": {
  "API": {
   "version": "1.3.42",
   "SPDX-license": "ADSL",
   "http://example.com/privatelabeltype": "some label value"
}}}


Conclusions

Outline (Conclusions)

  1. Introduction [3]
  2. Why Labels? [5]
  3. Why API Labels? [9]
  4. The API Label Value Space [2]
  5. A Recipe for API Labels [4]
  6. Conclusions [4]
Conclusions Erik Wilde : May Contain Nuts: The Case for API Labeling

(32) Labels: Sharing + Loose Coupling

label-scenario-people.png

Conclusions Erik Wilde : May Contain Nuts: The Case for API Labeling

(34) API Labels: Next Steps



Conclusions Erik Wilde : May Contain Nuts: The Case for API Labeling

(35) Additional Resources



September 25, 2018 API Strategy & Practice 2018 [https://events.linuxfoundation.org/events/apistrat-2018/]