JSON → Nim types

Client

Paste JSON to emit exported object types with seq for arrays and nested types for nested objects—refine with your JSON library and optional or ref fields as needed.

Learn more: JSON and Nim

Emit exported `object` types with `seq` for arrays—pair with std/json, jsony, or nim-json-serialization to decode real payloads.

Field names and JSON keys

Field identifiers use snake_case; when the JSON key differs, a `## JSON key: …` documentation line records the original string so you can add jsonKey-style pragmas if your library needs them.

JSON → Nim

?

Parses JSON in your browser and emits classes inferred from the sample shape. Nested objects become nested types; arrays use the first element only to guess item shape. Nothing is uploaded.

Fields use snake_case; ## JSON key lines document the original key when it differs. Prefer int over float when values are integers; add Option or ref for nulls per your JSON library.

Common use cases

  • Sketch types before wiring std/json, jsony, or nim-json-serialization in a Nim service or CLI.
  • Compare snake_case field names with camelCase keys from upstream JSON APIs.

Common mistakes to avoid

  • Assuming JSON numbers are always float

    This draft maps JSON numbers to float; switch to int when your contract is integer-only.

FAQ

Is generation local?

Yes. Output is produced entirely in your browser.

Common search terms

Phrases people search for that match this tool. See the full long-tail keyword index.

  • json to nim types
  • nim object from json sample

Related utilities you can open in another tab—mostly client-side.