Avro Fixer

Repair common Avro schema mistakes: quoting, commas, missing type fields, primitive name typos

Input

Output

Paste your input on the left and press Fix Avro.

Or drop a file on this box, , or .

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.

The Fix Avro!! button sends the schema to our repair service, which fixes the JSON syntax first (single quotes, trailing commas, unquoted keys) and then the Avro mistakes it can see: a record with fields but no type: "record", an enum with symbols but no type: "enum", or a primitive written as integer, number, bool or byte instead of the canonical names from the official Avro docs. Read the result before you register it in a Schema Registry: a repair is a best guess at what you meant.

Only the Fix Avro button talks to a server: it posts what is in the left editor (up to 64 KB) to our backend and writes the repaired schema into the right editor. Sample Avro, Copy and Download all work locally. If you would rather keep a schema on your machine and only find out what is wrong with it, use the Avro Schema Validator, which checks it in the browser.

How to Use the Avro Fixer

Load a broken schema, press Fix Avro, take the result. The steps below walk through that with the page's own sample.

1

Paste the Broken Avro

Paste the schema that Schema Registry or avro-tools rejected into the left editor. Sample Avro loads an Order written the way people type it in a hurry: keys without quotes, single-quoted strings, trailing commas, integer where Avro wants int, and no "type": "record" at the top. Something as short as this is enough to try it on:

{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.

2

Hit Fix Avro!!

Click the green button. The schema (up to 64 KB) goes to the repair service and the fixed version comes back in the right panel. If the input is too broken to repair, braces that do not match for example, the right panel says so, and you can fix the obvious thing by hand before trying again.

3

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?

Yes, when you click Fix. A badly broken schema is repaired on the server rather than in the page, so the schema goes to our server and the repaired version comes back. If you would rather not send it, the Avro Schema Validator checks a schema entirely in your browser and tells you what is wrong.

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: