Nifty Paste JSON as Code
Turn JSON on your clipboard into types for TypeScript, C#, Go, Rust, Python, Java, Kotlin, Swift, Dart and more.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Features




- Paste JSON as Code (
Ctrl+Alt+V, or Cmd+Alt+V on Mac). Copy an API response, press the shortcut in a .ts, .cs, .go or other file, and get matching types at the cursor, in that file's language and indentation. In Go files, needed imports go into the file's import block.
- Open JSON as Code. In a JSON file (or with some JSON selected), right-click and pick any language; the types open beside it.
- 16 targets: TypeScript, TypeScript + Zod, C#, Go, Rust, Python, Java, Kotlin, Swift, Dart, PHP, Ruby, C++, Elm, Flow and JSON Schema.
- Smart inference. Nested objects become their own types, arrays are merged, optional fields, dates and maps are detected.
- Plain types by default. Turn off
nifty.paste-json.justTypes to also get JSON (de)serialisation helpers.
- Offline. Everything runs locally with the open-source quicktype engine.
- Works in the browser on vscode.dev and github.dev.
Commands
| Command |
Key |
What it does |
Nifty: Paste JSON as Code |
Ctrl+Alt+V |
Paste clipboard JSON as types in the current file's language |
Nifty: Open JSON as Code… |
|
Generate from the JSON file, selection or clipboard in any language |
Settings
| Setting |
Default |
What it does |
nifty.paste-json.justTypes |
true |
Plain types only (no serialisation helpers) |
nifty.paste-json.askForName |
true |
Ask for the top-level type name |
Install
- VS Code: search for "Nifty Paste JSON as Code" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Credits
Code generation by quicktype (Apache-2.0).
Privacy
This extension collects no telemetry, needs no account and makes no network requests.
- Nifty C# Templates: New Class, Record & Namespace: New C# class, interface, record, enum, test and controller files with the right namespace, plus namespace syncing. (Open VSX)
- Nifty Diagrams: PlantUML, Graphviz & D2 Preview: PlantUML, Graphviz (DOT) and D2 diagrams rendered on your machine: live preview beside the editor, SVG and PNG export, diagrams in the Markdown preview, errors in Problems. No server needed. (Open VSX)
- Nifty Docstrings: Doc Comments for Python, PHP, Rust and Go: Type three quotes under a Python function and get a Google, NumPy or Sphinx docstring with its arguments, types, returns and raises. PHPDoc, Rust and Go doc comments too. (Open VSX)
- Nifty JSON Schema: Validate with Draft 2020-12 & 2019-09: Validate JSON, JSONC and YAML against JSON Schema 2020-12, 2019-09, draft-07, 06 and 04, with precise errors, hover, completion, SchemaStore lookup and schema generation. (Open VSX)
- Nifty Mermaid: Mermaid Diagram Preview & Export: Mermaid diagrams with no account: live preview beside .mmd files and Markdown, diagrams in the Markdown preview, syntax highlighting, and export to SVG or PNG. (Open VSX)
- Nifty Nginx: nginx.conf Formatting & IntelliSense: nginx config support: syntax highlighting, formatting, directive completion and docs on hover, context checks, and snippets for reverse proxies, SSL and PHP. (Open VSX)
See all 100+ Nifty extensions and web tools at https://getnifty.dev
| |