Jsson Docs

API Endpoints

Complete reference for all HTTP Server endpoints.

Server Flags

FlagDefaultDescription
-port8090Port to listen on
-corstrueEnable CORS for all origins

Endpoints Overview

EndpointMethodDescription
/transpilePOSTTranspile JSSON to output format
/validatePOSTValidate JSSON syntax
/validate-schemaPOSTValidate output against schema
/healthGETHealth check
/versionGETVersion info

POST /transpile

Transpile JSSON source code to JSON, YAML, TOML, or TypeScript.

Request Body

{
  "source": "user { name = João }",
  "format": "json",
  "include_merge": "keep",
  "streaming": false,
  "stream_threshold": 10000
}
FieldTypeDefaultDescription
sourcestring(required)JSSON source code
formatstringjsonOutput: json, yaml, toml, typescript
include_mergestringkeepMerge strategy: keep, overwrite, error
streamingbooleanfalseEnable streaming mode
stream_thresholdnumber10000Auto-streaming threshold

Response

Success:

{
  "success": true,
  "output": { "user": { "name": "João" } },
  "format": "json",
  "transpile_time_ms": 0.123
}

Error:

{
  "success": false,
  "errors": ["Line 1: unexpected token"],
  "format": "json",
  "transpile_time_ms": 0.05
}

POST /validate

Validate JSSON syntax without transpiling.

Request Body

{
  "source": "user { name = João }"
}

Response

{
  "valid": true,
  "errors": []
}

POST /validate-schema

Transpile JSSON and validate output against a JSON Schema.

Request Body

{
  "source": "user { name = João, age = 25 }",
  "schema": "{\"type\": \"object\"}",
  "schema_format": "json",
  "output_format": "json"
}

Response

{
  "valid": true,
  "errors": [],
  "format": "json",
  "schema_type": "json-schema",
  "transpile_time_ms": 0.1,
  "validate_time_ms": 0.05,
  "transpiled_data": { "user": { "name": "João", "age": 25 } }
}

GET /health

curl http://localhost:8090/health
{
  "status": "healthy",
  "service": "jsson",
  "version": "0.1.0",
  "jsson_version": "0.0.6",
  "timestamp": "2025-12-24T12:00:00Z"
}

GET /version

curl http://localhost:8090/version
{
  "server_version": "0.1.0",
  "jsson_version": "0.0.6",
  "go_version": "1.21+"
}

On this page