Does it use dataclasses or Pydantic?
The default output is a stdlib @dataclass class, which has zero third-party dependencies and works on any Python 3.7+ install. To convert to Pydantic, replace @dataclass with class Root(BaseModel): and add `from pydantic import BaseModel`. Pydantic accepts the same type hints and adds runtime validation, JSON schema generation, and ORM-style construction.
How are Optional fields handled?
A field whose value is null in the sample becomes Optional[Any] (or Optional[Type] when a type is inferred). Pair it with a default of None — `field: Optional[int] = None` — so dataclass construction does not fail when the key is missing.
Can I generate a TypedDict instead?
TypedDicts are best for adding types to existing dict-shaped data without changing runtime behaviour. To convert the output, change @dataclass / class Root: to `class Root(TypedDict):` and remove the colons after each field. TypedDicts require Python 3.8+ for the class-based syntax.
How is JSON snake_case preserved?
JSON keys are kept verbatim as Python attribute names — `is_admin` stays `is_admin`, `userId` stays `userId`. Python convention prefers snake_case, but renaming attributes breaks JSON parsing unless you add a `json` library shim or use Pydantic with `Field(alias=...)`.
How are nested JSON objects modelled?
Each nested object becomes a separate @dataclass, named in PascalCase from the JSON key. The parent class references the child by type. For deserialization with stdlib only, write a helper that walks the dict and constructs each dataclass; or use the dacite library which does it generically.
Can I use this with FastAPI?
Yes — FastAPI uses Pydantic. Generate the dataclass output, then change @dataclass to class Root(BaseModel): and FastAPI will auto-validate request bodies, generate the OpenAPI schema, and produce a Swagger UI for you. No other changes are needed.
Is the JSON uploaded to your servers?
No. The conversion runs entirely in your browser via JavaScript. Open DevTools → Network and click Convert — there are no requests. JSON containing customer data, tokens, or proprietary schemas never leaves the device.
How do I deserialize JSON into the generated dataclass?
For a flat dataclass: `Root(**json.loads(payload))`. For nested classes use the dacite library: `from_dict(data_class=Root, data=json.loads(payload))` which recursively constructs every nested dataclass.