Paste JSON · get types

🧱 JSON → TS / Go

Paste any JSON and get a TypeScript interface plus a Go struct instantly: nested objects become named sub-types, keys missing in some array elements turn optional, ints and floats are told apart and null becomes a pointer. Rename the root, toggle omitempty, copy in one click.


        

Cách suy kiểu: mọi phần tử của một mảng được hợp nhất thành một shape — khóa thiếu ở đâu đó thành tùy chọn (TS thêm ?, Go thêm ,omitempty); null đi kèm kiểu khác thành union bên TS và con trỏ *T bên Go; số là int64 khi mọi giá trị đều nguyên, ngược lại float64. Tên field Go theo quy ước Go (user_id → UserID).