{"id":20748954,"url":"https://github.com/rhaeguard/gojson","last_synced_at":"2025-09-27T20:31:40.350Z","repository":{"id":204396146,"uuid":"707584091","full_name":"rhaeguard/gojson","owner":"rhaeguard","description":"Yet Another JSON Parser, but parsed using bottom-up parsing technique for educational purposes","archived":false,"fork":false,"pushed_at":"2023-11-14T19:52:01.000Z","size":63,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T17:03:49.756Z","etag":null,"topics":["bottom-up-parser","golang","json","json-parser"],"latest_commit_sha":null,"homepage":"https://rhaeguard.github.io/posts/json-parsing-shift-reduce/","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/rhaeguard.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-20T08:13:42.000Z","updated_at":"2025-09-05T11:42:40.000Z","dependencies_parsed_at":"2023-11-14T20:44:53.659Z","dependency_job_id":null,"html_url":"https://github.com/rhaeguard/gojson","commit_stats":null,"previous_names":["rhaeguard/gojson"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhaeguard/gojson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaeguard%2Fgojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaeguard%2Fgojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaeguard%2Fgojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaeguard%2Fgojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhaeguard","download_url":"https://codeload.github.com/rhaeguard/gojson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaeguard%2Fgojson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277284815,"owners_count":25792645,"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","status":"online","status_checked_at":"2025-09-27T02:00:08.978Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bottom-up-parser","golang","json","json-parser"],"created_at":"2024-11-17T08:19:43.665Z","updated_at":"2025-09-27T20:31:40.029Z","avatar_url":"https://github.com/rhaeguard.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gojson\n\n![](https://github.com/rhaeguard/gojson/actions/workflows/go.yml/badge.svg)\n\nA JSON parser written in Go using Shift-Reduce Parsing technique without any parsing table.\n\nread the [article](https://rhaeguard.github.io/posts/json-parsing-shift-reduce/)\n\n### to add the dependency:\n\n```shell\ngo get github.com/rhaeguard/gojson\n```\n\n### how to use:\n```go\nimport (\n    \"fmt\"\n    \"github.com/rhaeguard/gojson\"\n)\n\ntype WebConfig struct {\n    Hostname string\n    Port     int\n    IsActive bool\n}\n\nfunc main() {\n    inputJson := `{\n              \"Hostname\": \"localhost\",\n              \"Port\": 8282,\n              \"IsActive\": true\n        }`\n    json, err := gojson.Parse(inputJson)\n    \n    if err != nil {\n        // error occurred\n    }\n    \n\t// we can directly try to get the value from the JsonValue object\n    objectFields := json.Value.(map[string]gojson.JsonValue)\n    port := int(objectFields[\"Port\"].Value.(float64)) // all numeric values are converted to float64\n    fmt.Printf(\"%d\\n\", port)\n    \n\t// we can also try to map the values to a struct\n    var wc WebConfig\n    if uerr := json.Unmarshal(\u0026wc); uerr != nil {\n        // error occurred\n    } else {\n        fmt.Printf(\"%-v\\n\", wc.Port)\n    }\n\n\t// we can unmarshall in one step as well\n    if uerr := gojson.Unmarshal(inputJson, \u0026wc); uerr != nil {\n        // error occurred\n    } else {\n        fmt.Printf(\"%-v\\n\", wc.Port)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaeguard%2Fgojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhaeguard%2Fgojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaeguard%2Fgojson/lists"}