Avro Fixer
Repair common Avro schema mistakes — quoting, commas, missing type fields, primitive name typos
What is the Avro Fixer?
You opened an .avsc file from a junior teammate, the build pipeline, or an old internal wiki, and it does not parse. Single quotes where double quotes belong. A trailing comma after the last field. Unquoted keys. "type": "integer" when Apache Avro only accepts "int". This tool fixes those automatically. Paste the broken schema in the left editor, hit the green Fix Avro!! button, get a clean schema on the right.
Under the hood the fixer walks the schema tree, runs the JSON-syntax repairs first (single quotes → double quotes, trailing commas dropped, unquoted keys quoted), then applies Avro-specific rules: a node with fields but no type gets type: "record"; a node with symbols gets type: "enum"; primitives like integer, number, bool, byte are rewritten to canonical Avro names (int, double, boolean, bytes) per the official Avro docs. The output is always proper indented JSON, ready to drop into a Schema Registry.
Everything runs in your browser — no upload, no server-side parse, no logs. Your schema stays on your machine.
How to Use the Avro Fixer
Three steps. The buttons described below are the actual buttons on this page.
Paste the Broken Avro
Drop the broken schema (or JSON-encoded record) into the left editor. Hit Sample Avro if you want a pre-broken example to play with — it loads a deliberately busted Order schema with single quotes, trailing commas, and a wrong primitive name. Quick example of the kind of input this handles:
{name: 'Order', fields: [{name: 'orderId', type: 'string',}, {name: 'qty', type: 'integer'}]}The fixer does not invent fields you forgot to write — it only repairs syntax and well-defined Avro structural mistakes. For full validation against the Avro 1.11 specification, run the output through the Avro Validator after fixing.
Hit Fix Avro!!
Click the green button. The fixer normalizes quotes and commas, parses the JSON, walks the tree, adds missing type: "record" / type: "enum" markers, and canonicalizes primitive names. The repaired schema appears on the right with two-space indentation. If the input is too broken (mismatched braces, etc.) the right panel tells you what blew up so you can fix the obvious thing manually.
Copy and Use It
Select the right-hand output, copy, and drop it into your .avsc file or registry POST body. Parsing uses the browser's native JSON.parse() — no third-party Avro libraries, no network calls.
When You'd Actually Use This
Fixing Hand-Written Schemas
Wrote an Avro schema by hand for a quick prototype, used JS-style single quotes by habit? Paste it in, hit Fix, get back a parseable .avsc. Saves you from doing find-replace by hand on every field.
Cleaning Up AI-Generated Schemas
Asked an LLM to draft an Avro schema for a new event and it came back with "type": "integer" and trailing commas? Common failure mode — the model was thinking JavaScript. The fixer rewrites integer → int, drops the commas, and you get a schema that actually loads.
Salvaging Schemas from Logs
Pulled a schema out of a log line where it was wrapped in single quotes by the logger? Paste, fix, recover. Works for any source where the JSON has been mangled into JavaScript object-literal-ish form.
Migrating Old Schemas
Moving a legacy schema between teams and the original used non-canonical primitive names? The fixer normalizes them so the registry stops complaining about unknown types.
Common Questions
What exactly does it fix?
Three families of issues. (1) JSON-syntax: single quotes → double quotes, trailing commas removed, unquoted keys quoted. (2) Structural: a node with fields but no type gets type: "record"; a node with symbols gets type: "enum". (3) Primitive names: integer → int, number → double, bool → boolean, byte → bytes — matching the canonical primitive set Avro accepts.
Will it always produce a valid Avro schema?
It produces valid JSON that follows the most common Avro structural rules. It does NOT do full Avro validation — for example it will not check that named types referenced in unions actually resolve, or that default values match their field types. Run the output through the Avro Validator for that.
Does it modify field names or values?
No. Field names, namespaces, doc strings, and default values are passed through unchanged. The fixer only touches the syntax and the well-known type-name slots.
Is my schema sent to a server?
No. The repair runs entirely in your browser — string regex passes plus a tree walk over the parsed JSON. Nothing is uploaded, nothing is logged. You can run this offline.
My input has comments — will it strip them?
Avro JSON does not allow comments at all (per RFC 8259, the JSON spec). If your input has // or /* */ comments, JSON.parse() will reject it before the fixer can do anything. Strip comments first, then run the fixer.
What about Avro IDL (.avdl) files?
The fixer is JSON-only. Avro IDL is a separate textual format that gets compiled to JSON Avro schemas. Compile your .avdl first using avro-tools idl, then paste the resulting JSON in here.
Other Avro Tools
Fixing is one part of an Avro workflow. These tools cover the rest: