Skip to content

Capabilities API

David An edited this page Dec 18, 2023 · 2 revisions

Overview

WDS provides a Capabilities API, so consumers of the API can programmatically determine if the WDS they are querying supports any given feature. This assists with incremental rollout of features and incremental upgrade of pre-existing WDS apps.

For example, Terra UI can query a workspace's WDS Capabilities API and look for a key filter.by-column. If the Capabilities API returns true, Terra UI can then display an input field for each column in the data table to perform a search. If the Capabilities API returns false, or the key is not found, Terra UI can hide that input field.

Response Structure

The structure of the Capabilities API response payload is:

  • a flat list of KVPs, where keys are strings and values are booleans
  • keys use dot notation to group related keys into a namespace, e.g. dataimport.pfb and dataimport.tdrmanifest
  • keys use hyphen-separation to delimit words within a single term, e.g. filter.by-column
  • values are true if the feature is enabled, false otherwise

API Callers

API callers should assume false if a key is not present in the response.

This assumption enables backwards compatibility: if a caller contacts an older version of WDS where the key is not present, the corresponding feature is also (likely) not present.

WDS Developers

As a developer of WDS, please consider:

  • When choosing a name for a capability key, use namespaces to allow for future expansion and detail.
  • The API response payload is driven by capabilities.json. Ensure your changes result in valid JSON.

Clone this wiki locally