What this tool does
A JSON sample becomes Java records, one per object.
{ "id": 1, "firstName": "Ada", "address": { "city": "Paris" } }
public record Root(
Long id,
String firstName,
Address address
) {}
public record Address(
String city
) {}
Records are the shortest way to express “data and nothing else” in modern Java — a constructor, accessors, equals, hashCode and toString come with them. They need Java 16 or later.
The key survives the rename
A component name follows Java’s rules: no dash, no leading digit, no keyword. content-type becomes contentType, class becomes class_, 2fa becomes f2fa. Each time the name has to change, the original key rides along:
import com.fasterxml.jackson.annotation.JsonProperty;
public record Root(
@JsonProperty("content-type") String contentType,
@JsonProperty("class") Long class_,
Boolean ok
) {}
Without that annotation Jackson looks for contentType and finds nothing — the record no longer reads the document it was generated from. It was missing until this page was written; the defect is fixed, and the annotation appears only where the name actually changed, with its import.
Boxed types, and why
Every number is a Long or a Double, every boolean a Boolean. JSON has null, Java primitives do not, and a double receiving a null becomes 0.0 — a value you cannot tell from a real zero. The boxed types keep null representable, which is what the format allows.
For the same reason null and unknown values become Object, and an array of them a List<Object>.
What a sample cannot say
Nothing is optional and nothing is annotated @Nullable: every component is there because the document had it. Records are shallowly immutable, so a field you later decide can be absent is a change of shape, not a flag.
A scalar at the root — 42, "text" — is refused: Java has no type alias, so there is nothing to name. A JSON array of objects gives you the record of its element, which is the shape you actually bind to a List<Root>.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.