{"id":38773653,"url":"https://github.com/ngdinhtoan/hari","last_synced_at":"2026-01-17T12:10:05.598Z","repository":{"id":34747481,"uuid":"38727340","full_name":"ngdinhtoan/hari","owner":"ngdinhtoan","description":"Generate GO struct from JSON","archived":false,"fork":false,"pushed_at":"2018-09-06T12:12:31.000Z","size":15,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T19:48:12.493Z","etag":null,"topics":["json","json-string","struct-generator"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngdinhtoan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-08T02:35:51.000Z","updated_at":"2024-06-19T19:48:12.494Z","dependencies_parsed_at":"2022-08-25T00:12:14.161Z","dependency_job_id":null,"html_url":"https://github.com/ngdinhtoan/hari","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ngdinhtoan/hari","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngdinhtoan%2Fhari","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngdinhtoan%2Fhari/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngdinhtoan%2Fhari/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngdinhtoan%2Fhari/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngdinhtoan","download_url":"https://codeload.github.com/ngdinhtoan/hari/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngdinhtoan%2Fhari/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","json-string","struct-generator"],"created_at":"2026-01-17T12:10:04.543Z","updated_at":"2026-01-17T12:10:05.583Z","avatar_url":"https://github.com/ngdinhtoan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hari\n\n*Generate GO struct from JSON string*\n\n[![Build Status](https://travis-ci.org/ngdinhtoan/hari.svg)](https://travis-ci.org/ngdinhtoan/hari)\n[![Coverage Status](https://coveralls.io/repos/github/ngdinhtoan/hari/badge.svg?branch=master)](https://coveralls.io/github/ngdinhtoan/hari?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ngdinhtoan/hari)](https://goreportcard.com/report/github.com/ngdinhtoan/hari)\n\n### Why Hari?\n\nWhen you make a client for RESTful service in GO, usually you have to define some structures to parse JSON response.\nIt's boring and takes time. Hari will help you on that job.\n\nBut, please be aware that generated struct may not meet your requirement. You have to review it before using.\n\n### How to use\n\nInstall Hari by running the following command\n\n    go get github.com/ngdinhtoan/hari\n\nPut JSON string into a file within `.json` extension, the file name will be used to name struct.\n\nExample file `product.json` has content\n\n```json\n{\n    \"id\": 1,\n    \"name\": \"A green door\",\n    \"price\": 12.50,\n    \"active\": true,\n    \"tags\": [\"home\", \"green\"],\n    \"category\": {\n        \"id\": 2,\n        \"name\": \"Home\"\n    }\n}\n```\n\nRun Hari command\n\n    hari --input-dir=[path/to/dir]\n\nthen it will generate `product.go` file in the same directory, and its content is\n\n```go\npackage main\n\ntype Category struct {\n\tID   int64  `json:\"id\"`\n\tName string `json:\"name\"`\n}\n\ntype Product struct {\n\tActive   bool     `json:\"active\"`\n\tCategory Category `json:\"category\"`\n\tID       int64    `json:\"id\"`\n\tName     string   `json:\"name\"`\n\tPrice    float64  `json:\"price\"`\n\tTags     []string `json:\"tags\"`\n}\n```\n\n### License\n\nHari is licensed under the [MIT License](https://github.com/ngdinhtoan/hari/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngdinhtoan%2Fhari","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngdinhtoan%2Fhari","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngdinhtoan%2Fhari/lists"}