Home Docs Schema Formats Errors
Conduit

CBOR

CBOR input and output

CBOR (Concise Binary Object Representation) is a compact, binary data format designed for high‑performance machine‑to‑machine communication. Conduit supports CBOR for both input and output using canonical encoding.

CBOR Input

To send CBOR to Conduit, set the Content-Type header to application/cbor.

CBOR binary payload (not shown)

Conduit decodes CBOR objects into schema‑aware rows. CBOR maps cleanly to JSON‑like structures: maps, arrays, strings, numbers, booleans, and null.

CBOR Output

CBOR output is selected when:

  • ?format=cbor is used
  • Accept: application/cbor is sent
  • The input format is CBOR
GET /v1/books?format=cbor

CBOR responses are encoded using canonical CBOR rules for deterministic output.

CBOR binary response (not shown)

CBOR Schema Responses

Schema endpoints return CBOR describing the table’s columns, types, and metadata.

GET /v1/schema/books?format=cbor

The structure matches the JSON schema, encoded in CBOR.

CBOR binary schema (not shown)

CBOR Error Responses

Conduit returns a consistent CBOR error envelope for all error conditions. This structure matches JSON, XML, YAML, TOML, NDJSON, and CSV.

Example CBOR error (JSON representation shown for clarity):

{
  "error": {
    "title": "Resource Not Found",
    "message": "The requested record does not exist.",
    "status": 404,
    "details": [
      "No record with ID 999 exists in table 'books'."
    ],
    "documentation_url": "https://docs.conduit.dev/errors/not-found"
  }
}

The actual response is CBOR‑encoded using Conduit’s canonical encoder.

Format Negotiation

CBOR is selected when:

  • ?format=cbor is used
  • Accept: application/cbor is sent
  • The input format is CBOR
GET /v1/books?format=cbor