Skip to content
HALOWERK

Codewerk

avro jsonschema

Avro -> JSON Schema: the Avro schema is first validated with avsc 5.7.9, then mapped per the JSON encoding of the Avro 1.12 specification (avro.apache.org/docs/1.12.0/specification): records -> objects with all fields required, int with 32-bit bounds, long as integer, bytes/fixed as strings of code points U+0000–U+00FF, enums by symbol, maps -> objects, named types -> $defs. Unions are encoded as {"<branch type>": value} (null as null) as the spec requires; union_encoding "plain" gives the.

POST https://code.halowerk.com/v1/avro-jsonschema

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
directionstringYes
avroSee schemaNoAvro schema (JSON value or JSON string) for avro_to_jsonschema.
union_encodingstringNo
schemaSee schemaNoJSON Schema (object or JSON/YAML string) for jsonschema_to_avro.
namestringNoRecord name for the root (default: schema title or Root).
namespacestringNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "direction"
  ],
  "properties": {
    "direction": {
      "type": "string",
      "enum": [
        "avro_to_jsonschema",
        "jsonschema_to_avro"
      ]
    },
    "avro": {
      "description": "Avro schema (JSON value or JSON string) for avro_to_jsonschema.",
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "array"
        },
        {
          "type": "string",
          "maxLength": 1000000
        }
      ]
    },
    "union_encoding": {
      "type": "string",
      "enum": [
        "avro_json",
        "plain"
      ],
      "default": "avro_json"
    },
    "schema": {
      "description": "JSON Schema (object or JSON/YAML string) for jsonschema_to_avro.",
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "string",
          "maxLength": 2000000
        }
      ]
    },
    "name": {
      "type": "string",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
      "description": "Record name for the root (default: schema title or Root)."
    },
    "namespace": {
      "type": "string",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$",
      "maxLength": 200
    }
  }
}

Open original schema

Published input example

{
  "direction": "avro_to_jsonschema",
  "avro": {
    "type": "record",
    "name": "User",
    "namespace": "com.halowerk.inventory",
    "fields": [
      {
        "name": "id",
        "type": "long"
      },
      {
        "name": "email",
        "type": [
          "null",
          "string"
        ],
        "default": null
      }
    ]
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →