{"id":13413258,"url":"https://github.com/ChimeraCoder/gojson","last_synced_at":"2025-03-14T19:31:47.128Z","repository":{"id":6116764,"uuid":"7344683","full_name":"ChimeraCoder/gojson","owner":"ChimeraCoder","description":"Automatically generate Go (golang) struct definitions from example JSON","archived":false,"fork":false,"pushed_at":"2021-07-30T03:02:50.000Z","size":210,"stargazers_count":2676,"open_issues_count":41,"forks_count":208,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-03-09T05:19:54.665Z","etag":null,"topics":["cli","go","go-generate","gojson","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChimeraCoder.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-27T19:10:50.000Z","updated_at":"2025-03-02T16:47:11.000Z","dependencies_parsed_at":"2022-07-14T17:00:43.694Z","dependency_job_id":null,"html_url":"https://github.com/ChimeraCoder/gojson","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeraCoder%2Fgojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeraCoder%2Fgojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeraCoder%2Fgojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeraCoder%2Fgojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChimeraCoder","download_url":"https://codeload.github.com/ChimeraCoder/gojson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635327,"owners_count":20322921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","go","go-generate","gojson","golang"],"created_at":"2024-07-30T20:01:36.261Z","updated_at":"2025-03-14T19:31:46.815Z","avatar_url":"https://github.com/ChimeraCoder.png","language":"Go","readme":"[![Build Status](https://travis-ci.org/ChimeraCoder/gojson.svg?branch=master)](https://travis-ci.org/ChimeraCoder/gojson)\ngojson\n======\n\ngojson generates go struct definitions from json or yaml documents.\n\nExample\n----------\n\n```sh\n$ curl -s https://api.github.com/repos/chimeracoder/gojson | gojson -name=Repository\n\npackage main\n\ntype Repository struct {\n\tArchiveURL       string      `json:\"archive_url\"`\n\tAssigneesURL     string      `json:\"assignees_url\"`\n\tBlobsURL         string      `json:\"blobs_url\"`\n\tBranchesURL      string      `json:\"branches_url\"`\n\tCloneURL         string      `json:\"clone_url\"`\n\tCollaboratorsURL string      `json:\"collaborators_url\"`\n\tCommentsURL      string      `json:\"comments_url\"`\n\tCommitsURL       string      `json:\"commits_url\"`\n\tCompareURL       string      `json:\"compare_url\"`\n\tContentsURL      string      `json:\"contents_url\"`\n\tContributorsURL  string      `json:\"contributors_url\"`\n\tCreatedAt        string      `json:\"created_at\"`\n\tDefaultBranch    string      `json:\"default_branch\"`\n\tDescription      string      `json:\"description\"`\n\tDownloadsURL     string      `json:\"downloads_url\"`\n\tEventsURL        string      `json:\"events_url\"`\n\tFork             bool        `json:\"fork\"`\n\tForks            float64     `json:\"forks\"`\n\tForksCount       float64     `json:\"forks_count\"`\n\tForksURL         string      `json:\"forks_url\"`\n\tFullName         string      `json:\"full_name\"`\n\tGitCommitsURL    string      `json:\"git_commits_url\"`\n\tGitRefsURL       string      `json:\"git_refs_url\"`\n\tGitTagsURL       string      `json:\"git_tags_url\"`\n\tGitURL           string      `json:\"git_url\"`\n\tHasDownloads     bool        `json:\"has_downloads\"`\n\tHasIssues        bool        `json:\"has_issues\"`\n\tHasWiki          bool        `json:\"has_wiki\"`\n\tHomepage         interface{} `json:\"homepage\"`\n\tHooksURL         string      `json:\"hooks_url\"`\n\tHtmlURL          string      `json:\"html_url\"`\n\tID               float64     `json:\"id\"`\n\tIssueCommentURL  string      `json:\"issue_comment_url\"`\n\tIssueEventsURL   string      `json:\"issue_events_url\"`\n\tIssuesURL        string      `json:\"issues_url\"`\n\tKeysURL          string      `json:\"keys_url\"`\n\tLabelsURL        string      `json:\"labels_url\"`\n\tLanguage         string      `json:\"language\"`\n\tLanguagesURL     string      `json:\"languages_url\"`\n\tMasterBranch     string      `json:\"master_branch\"`\n\tMergesURL        string      `json:\"merges_url\"`\n\tMilestonesURL    string      `json:\"milestones_url\"`\n\tMirrorURL        interface{} `json:\"mirror_url\"`\n\tName             string      `json:\"name\"`\n\tNetworkCount     float64     `json:\"network_count\"`\n\tNotificationsURL string      `json:\"notifications_url\"`\n\tOpenIssues       float64     `json:\"open_issues\"`\n\tOpenIssuesCount  float64     `json:\"open_issues_count\"`\n\tOwner            struct {\n\t\tAvatarURL         string  `json:\"avatar_url\"`\n\t\tEventsURL         string  `json:\"events_url\"`\n\t\tFollowersURL      string  `json:\"followers_url\"`\n\t\tFollowingURL      string  `json:\"following_url\"`\n\t\tGistsURL          string  `json:\"gists_url\"`\n\t\tGravatarID        string  `json:\"gravatar_id\"`\n\t\tHtmlURL           string  `json:\"html_url\"`\n\t\tID                float64 `json:\"id\"`\n\t\tLogin             string  `json:\"login\"`\n\t\tOrganizationsURL  string  `json:\"organizations_url\"`\n\t\tReceivedEventsURL string  `json:\"received_events_url\"`\n\t\tReposURL          string  `json:\"repos_url\"`\n\t\tSiteAdmin         bool    `json:\"site_admin\"`\n\t\tStarredURL        string  `json:\"starred_url\"`\n\t\tSubscriptionsURL  string  `json:\"subscriptions_url\"`\n\t\tType              string  `json:\"type\"`\n\t\tURL               string  `json:\"url\"`\n\t} `json:\"owner\"`\n\tPrivate         bool    `json:\"private\"`\n\tPullsURL        string  `json:\"pulls_url\"`\n\tPushedAt        string  `json:\"pushed_at\"`\n\tSize            float64 `json:\"size\"`\n\tSshURL          string  `json:\"ssh_url\"`\n\tStargazersURL   string  `json:\"stargazers_url\"`\n\tStatusesURL     string  `json:\"statuses_url\"`\n\tSubscribersURL  string  `json:\"subscribers_url\"`\n\tSubscriptionURL string  `json:\"subscription_url\"`\n\tSvnURL          string  `json:\"svn_url\"`\n\tTagsURL         string  `json:\"tags_url\"`\n\tTeamsURL        string  `json:\"teams_url\"`\n\tTreesURL        string  `json:\"trees_url\"`\n\tUpdatedAt       string  `json:\"updated_at\"`\n\tURL             string  `json:\"url\"`\n\tWatchers        float64 `json:\"watchers\"`\n\tWatchersCount   float64 `json:\"watchers_count\"`\n}\n```\n\nCLI Installation\n----------------\n\n```sh\n$ go get github.com/ChimeraCoder/gojson/gojson\n```\n\nAssuming `$GOPATH/bin` is in your `PATH`, you can now invoke `gojson` directly.\n\n\nAPI Installation\n----------------\n\n```sh\n$ go get github.com/ChimeraCoder/gojson/gojson\n```\n\nDevelopment\n-----------\n\n```\n$ git clone https://github.com/ChimeraCoder/gojson.git\n$ cd gojson\n$ go test\n```\n\n**Building CLI**\n\n```\n$ go build -o _build/gojson ./gojson\n```\n\n**Installing CLI**\n\n```\n$ go install ./gojson\n```\n\n**Formatting**\n\n```\n$ gofmt -w -e -s -l .\n```\n\nRelated Work\n------------\n\ngithub.com/str1ngs/jflect\n\nLicense\n----------\n\ngojson is free software distributed under Version 3 of the GNU Public License.\n\nAs of the time of writing, this is the same license used for gcc (and therefore gccgo), so it is unlikely to restrict use in any way. Note that the GPL does not extend to any output generated by gojson; the GPL only applies to software which includes copies of gojson itself.\n","funding_links":[],"categories":["开源类库","Go","Misc","JSON","Open source library","Utilities","Relational Databases","实用工具","Repositories","工具库","[](https://github.com/golang/go/wiki/CodeTools#code-generation-templating-and-generics)Code generation, Templating and Generics"],"sub_categories":["代码生成","Advanced Console UIs","检索及分析资料库","Code Generation","Search and Analytic Databases","SQL 查询语句构建库","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","[](https://github.com/golang/go/wiki/CodeTools#tools)Tools","HTTP Clients"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChimeraCoder%2Fgojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChimeraCoder%2Fgojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChimeraCoder%2Fgojson/lists"}