JSON으로 타입 생성
JSON으로 TypeScript, Go, 스키마 만들기
브라우저에서 실행 · 업로드 없음
이 도구와 페이지의 안내는 현재 영어로만 제공됩니다. 동작은 똑같으며, 모든 처리는 브라우저에서 이루어집니다.
브라우저가 너무 오래되어 이 도구를 실행할 수 없습니다. 브라우저를 업데이트하거나 최신 Chrome, Edge, Firefox, Safari를 사용해 주세요.
- 아무것도 기기 밖으로 나가지 않음
- 서버의 파일 크기 제한 없음
- 가입 불필요, 워터마크 없음
- 무료
How to generate types from JSON
- Choose TypeScript, Go or JSON Schema.
- Paste an example of your JSON, or try the example.
- Adjust the options, then copy or download the code.
How the types are worked out
- Every object gets its own named type; items of arrays get a singular name ("users" becomes User).
- All items of an array are looked at together: a field missing from some items becomes optional.
- Numbers become number in TypeScript, and int64 or float64 in Go depending on the values.
- Mixed values become a union in TypeScript, any in Go and a list of types in JSON Schema.
- JSON Schema can also detect formats such as date-time, email, uri and uuid.
Check the result
The types describe your example, not every possible response. A field that was null or missing in the example can't tell what type it really has, so check those by hand.
자주 묻는 질문
Which JSON Schema version is used?
Draft 2020-12, the current version.
Is my JSON uploaded?
No. Everything happens in your browser, and the page is blocked from uploading anything.