JSON → Nim types
ClientPaste 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
More tools
Related utilities you can open in another tab—mostly client-side.
JSON → Rust structs (serde)
ClientSerde structs with JSON renames from sample data—local only.
JSON → Dart classes
ClientDart classes with final fields from sample JSON—Flutter-friendly scaffold, local only.
JSON → Go structs
ClientGo structs with json tags from sample JSON—inferred in the browser.
YAML ↔ JSON
ClientYAML to JSON and JSON to YAML online—format, validate, convert locally.