Home Docs Schema Formats Errors

Formats

Multi‑format input and output

Conduit is built around multi‑format I/O. Every endpoint can read and write data in multiple formats without custom controllers or serializers. Clients choose the format that works best for them using Content-Type and Accept.

Supported Formats

Conduit supports both input and output in the following formats:

JSON

The default format. Fully supported for both input and output.

XML

Custom XML encoder produces stable element trees with schema‑ordered fields.

YAML

Readable, indentation‑based format. Supported for both input and output.

TOML

Table‑oriented format. Output uses [table] or [[table]] blocks.

NDJSON

One JSON object per line. Ideal for streaming and ingestion pipelines.

CSV

Output only. Conduit writes header rows and schema‑ordered values.

CBOR

Binary format for compact machine‑to‑machine communication.

Format Negotiation

Conduit determines the output format using the following rules:

  1. ?format= query parameter Highest priority. Supports json, xml, yaml, toml, ndjson, csv, cbor.
  2. Input format If the request body was XML, YAML, TOML, or JSON, Conduit uses that format for output unless the input was CSV (CSV input is not supported).
  3. Fallback If no format is specified, Conduit defaults to JSON.

Clients select the desired output format using the Accept header or the ?format= query parameter:

GET /v1/players?format=xml
Accept: application/x-yaml

Input Formats

Conduit accepts input in:

  • JSON
  • YAML
  • TOML
  • XML

CSV input is not supported. If a request is sent with Content-Type: text/csv, Conduit returns an error.

POST /v1/players
Content-Type: application/json

{"name": "Alice", "score": 42}

Output Formats

Every endpoint can return data in any supported format. Examples:

GET /v1/players?format=toml
GET /v1/players?format=ndjson
GET /v1/players?format=csv

Schema‑aware formats (JSON, XML, YAML, TOML, NDJSON, CSV) preserve column ordering based on the database schema. Extra fields are appended alphabetically.