Skip to main content
Connectors returning the same kind of data — Netflix, Spotify, and Verizon all returning plans and bills — should look the same in your app. The Uplink semantic vocabulary makes that possible: connectors return their data as canonical types (uplink:Subscription, uplink:Bill, …), and you write one renderer per type.

Output is an object

An action’s output is always a JSON object. Its fields hold vocabulary values, alone or in arrays. Verizon’s fetchAll returns, among others:
identity is an uplink:AccountIdentity, subscriptions an array of uplink:Subscription, bill a single uplink:Bill, and usage an array of uplink:Usage. accountType is Verizon-specific. Field names differ between connectors — Verizon returns one bill, Chase an array of bills — so don’t hard-code them. Read them from produces.

produces

Every connector in the catalog lists the vocabulary values its actions return. ConnectorListItem, ConnectorDetail, and the connector on each ConnectionWithGrants all carry it:
The catalog derives produces from each action’s published output schema, so you can choose a renderer before running anything:
Fields that aren’t in produces are connector-specific.
Each invocation also reports an outputType, a label for its whole output — usually connector-specific, such as atomic:VerizonAccount. Dispatch on produces, not outputType.

Decode with UplinkVocabulary

The UplinkVocabulary Swift package has a Codable struct for every vocabulary type. Each exposes its identifier as vocabularyType:
Decode one produces entry out of an action’s output:
Then dispatch on each entry’s type:
New connectors that return types you already handle work without changes. Most types keep money and dates as strings, the way the provider shows them; banking and usage types use numbers. Each type’s page in the vocabulary says which. Enums decode values they don’t know instead of failing, so a new case in the vocabulary doesn’t break older apps.

Without the package

You can mirror the JSON Schemas from @uplink-code/vocabulary as your own Codable structs. Match the field names exactly, and keep string fields — including dates — as String:

What’s next

Semantic vocabulary

Every type and its fields

Displaying invocation state

Observe progress until the output is ready