{"repo":"m-zajac/json2go","free":true,"listed":false,"github":"https://github.com/m-zajac/json2go","clone":"git clone https://github.com/m-zajac/json2go.git","description":"Create go type representation from json","language":"Go","stars":142,"topics":["json-to-go","json-to-golang","json-to-struct","json","cli"],"license":"MIT","category":"cli-tools","readme_excerpt":"json2go Package json2go provides utilities for creating go type representation from json inputs. Json2go can be used in various ways: - CLI tool - Web page with conversion tool: https://m-zajac.github.io/json2go - Go package - VSCode extension: vsc-json2go Why another conversion tool? There are few tools for converting json to go types available already. But all of which I tried worked correctly with only basic documents. The goal of this project is to create types, that are guaranteed to properly unmarshal input data. There are multiple test cases that check marshaling/unmarshaling both ways to ensure generated type is accurate. Here's the micro acid test if you want to check this or other conversion tools: And correct output with some comments: CLI Installation go install github.com/m-zajac/json2go/cmd/json2go@latest Usage Json2go can be used as cli tool or as package. CLI tools can be used directly to create go type from stdin data (see examples). Package provides Parser, which can consume multiple jsons and outputs go type fitting all inputs (see examples and documentation). Example usage: read documents from document-oriented database and feed them too parser for go struct. CLI usage examples echo '{\"x\":1,\"y\":2}' json2go --- curl -s https://api.punkapi.com/v2/beers?page=1&per page=5 json2go Check this one :) --- cat data.json json2go Package usage examples Example outputs --- Contribution I'd love your input! Especially reporting bugs and proposing new features.","default_branch":null,"files":null,"tree":[],"storefront":"/r/m-zajac","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/m-zajac/json2go/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}