Skip to content
HALOWERK

Codewerk

protobuf jsonschema

proto -> JSON Schema: parses proto2/proto3 with protobufjs 8.8.1 (well-known types google/protobuf/* bundled, other imports rejected) and maps every message and enum to JSON Schema 2020-12 $defs per the ProtoJSON format (protobuf.dev/programming-guides/json, 2025): lowerCamelCase or json_name keys, 64-bit integers as decimal strings, 32-bit integers with bounds, bytes as base64, enums by name, maps as objects, oneof as mutual exclusion, Timestamp/Duration/Struct/Value/wrappers as their JSON.

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

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
directionstringYes
protostringNo.proto source (direction proto_to_jsonschema).
messagestringNoRoot message (simple or fully-qualified name); default: the only top-level message, otherwise none.
modestringNocanonical = what a ProtoJSON serializer writes; parser = what parsers also accept.
field_namesstringNoUse lowerCamelCase/json_name keys (default) or the original proto field names.
schemaSee schemaNoJSON Schema (object or JSON/YAML string) for direction jsonschema_to_proto.
packagestringNo
message_namestringNoName of the root message (default: schema title or Root).
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "direction"
  ],
  "properties": {
    "direction": {
      "type": "string",
      "enum": [
        "proto_to_jsonschema",
        "jsonschema_to_proto"
      ]
    },
    "proto": {
      "type": "string",
      "maxLength": 500000,
      "description": ".proto source (direction proto_to_jsonschema)."
    },
    "message": {
      "type": "string",
      "maxLength": 300,
      "description": "Root message (simple or fully-qualified name); default: the only top-level message, otherwise none."
    },
    "mode": {
      "type": "string",
      "enum": [
        "canonical",
        "parser"
      ],
      "default": "canonical",
      "description": "canonical = what a ProtoJSON serializer writes; parser = what parsers also accept."
    },
    "field_names": {
      "type": "string",
      "enum": [
        "json_name",
        "proto_name"
      ],
      "default": "json_name",
      "description": "Use lowerCamelCase/json_name keys (default) or the original proto field names."
    },
    "schema": {
      "description": "JSON Schema (object or JSON/YAML string) for direction jsonschema_to_proto.",
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "string",
          "maxLength": 2000000
        }
      ]
    },
    "package": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
      "default": "generated.v1",
      "maxLength": 200
    },
    "message_name": {
      "type": "string",
      "pattern": "^[A-Z][A-Za-z0-9_]{0,63}$",
      "description": "Name of the root message (default: schema title or Root)."
    }
  }
}

Open original schema

Published input example

{
  "direction": "proto_to_jsonschema",
  "proto": "syntax = \"proto3\";\npackage shop.v1;\nimport \"google/protobuf/timestamp.proto\";\nmessage Order {\n  int64 id = 1;\n  string customer_name = 2;\n  repeated string tags = 3;\n  google.protobuf.Timestamp created_at = 4;\n}",
  "message": "Order"
}

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 โ†’