{"id":13776214,"url":"https://github.com/antonholmquist/jason","last_synced_at":"2026-04-06T07:03:00.350Z","repository":{"id":24037304,"uuid":"27422416","full_name":"antonholmquist/jason","owner":"antonholmquist","description":"Easy-to-use JSON Library for Go","archived":false,"fork":false,"pushed_at":"2019-02-13T01:16:29.000Z","size":81,"stargazers_count":1141,"open_issues_count":6,"forks_count":64,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-11T10:46:08.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://godoc.org/github.com/antonholmquist/jason","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/antonholmquist.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":"2014-12-02T08:20:41.000Z","updated_at":"2025-04-21T18:42:49.000Z","dependencies_parsed_at":"2022-08-22T09:10:46.489Z","dependency_job_id":null,"html_url":"https://github.com/antonholmquist/jason","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/antonholmquist/jason","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonholmquist%2Fjason","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonholmquist%2Fjason/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonholmquist%2Fjason/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonholmquist%2Fjason/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonholmquist","download_url":"https://codeload.github.com/antonholmquist/jason/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonholmquist%2Fjason/sbom","scorecard":{"id":199486,"data":{"date":"2025-08-11","repo":{"name":"github.com/antonholmquist/jason","commit":"426ade25b261bcb4a7ad58c65badfc731854e92b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 4/27 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T22:34:04.157Z","repository_id":24037304,"created_at":"2025-08-16T22:34:04.157Z","updated_at":"2025-08-16T22:34:04.157Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31463015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":[],"created_at":"2024-08-03T18:00:19.381Z","updated_at":"2026-04-06T07:03:00.332Z","avatar_url":"https://github.com/antonholmquist.png","language":"Go","readme":"Jason is an easy-to-use JSON library for Go.\n\n[![Build Status](https://img.shields.io/travis/antonholmquist/jason.svg?style=flat)](https://travis-ci.org/antonholmquist/jason) [![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/antonholmquist/jason) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/antonholmquist/jason/master/LICENSE)\n\n# About\n\nJason is designed to be convenient for reading arbitrary JSON while still honoring the strictness of the language. Inspired by other libraries and improved to work well for common use cases. It currently focuses on reading JSON data rather than creating it. [API Documentation](http://godoc.org/github.com/antonholmquist/jason) can be found on godoc.org.\n\n## Install\n\n```shell\ngo get github.com/antonholmquist/jason\n```\n\n## Import\n\n```go\nimport (\n  \"github.com/antonholmquist/jason\"\n)\n```\n\n## Data types\n\nThe following golang values are used to represent JSON data types. It is consistent with how `encoding/json` uses primitive types.\n\n- `bool`, for JSON booleans\n- `json.Number/float64/int64`, for JSON numbers\n- `string`, for JSON strings\n- `[]*Value`, for JSON arrays\n- `map[string]*Value`, for JSON objects\n- `nil` for JSON null\n\n## Examples\n\n### Create from bytes\n\nCreate object from bytes. Returns an error if the bytes are not valid JSON.\n\n```go\nv, err := jason.NewObjectFromBytes(b)\n\n```\n\nIf the root object is unknown or not an object, use `NewValueFromBytes` instead. It can then be typecasted using one of the conversion methods provided by the library, for instance `Array()` or `String()`.\n\n```go\nv, err := jason.NewValueFromBytes(b)\n\n```\n\n### Create from a reader (like a http response)\n\nCreate value from a io.reader. Returns an error if the string couldn't be parsed.\n\n```go\nv, err := jason.NewObjectFromReader(res.Body)\n\n```\n\n### Read values\n\nReading values is easy. If the key path is invalid or type doesn't match, it will return an error and the default value.\n\n```go\nname, err := v.GetString(\"name\")\nage, err := v.GetInt64(\"age\")\nverified, err := v.GetBoolean(\"verified\")\neducation, err := v.GetObject(\"education\")\nfriends, err := v.GetObjectArray(\"friends\")\ninterests, err := v.GetStringArray(\"interests\")\n\n```\n\n### Read nested values\n\nReading nested values is easy. If the path is invalid or type doesn't match, it will return the default value and an error.\n\n```go\nname, err := v.GetString(\"person\", \"name\")\nage, err := v.GetInt64(\"person\", \"age\")\nverified, err := v.GetBoolean(\"person\", \"verified\")\neducation, err := v.GetObject(\"person\", \"education\")\nfriends, err := v.GetObjectArray(\"person\", \"friends\")\n\n```\n\n### Loop through array\n\nLooping through an array is done with `GetValueArray()` or `GetObjectArray()`. It returns an error if the value at that keypath is null (or something else than an array).\n\n```go\nfriends, err := person.GetObjectArray(\"friends\")\nfor _, friend := range friends {\n  name, err := friend.GetString(\"name\")\n  age, err := friend.GetNumber(\"age\")\n}\n```\n\n### Loop through object\n\nLooping through an object is easy. `GetObject()` returns an error if the value at that keypath is null (or something else than an object).\n\n```go\nperson, err := person.GetObject(\"person\")\nfor key, value := range person.Map() {\n  ...\n}\n```\n\n## Sample App\n\nExample project:\n\n```go\npackage main\n\nimport (\n  \"github.com/antonholmquist/jason\"\n  \"log\"\n)\n\nfunc main() {\n\n  exampleJSON := `{\n    \"name\": \"Walter White\",\n    \"age\": 51,\n    \"children\": [\n      \"junior\",\n      \"holly\"\n    ],\n    \"other\": {\n      \"occupation\": \"chemist\",\n      \"years\": 23\n    }\n  }`\n\n  v, _ := jason.NewObjectFromBytes([]byte(exampleJSON))\n\n  name, _ := v.GetString(\"name\")\n  age, _ := v.GetNumber(\"age\")\n  occupation, _ := v.GetString(\"other\", \"occupation\")\n  years, _ := v.GetNumber(\"other\", \"years\")\n\n  log.Println(\"age:\", age)\n  log.Println(\"name:\", name)\n  log.Println(\"occupation:\", occupation)\n  log.Println(\"years:\", years)\n\n  children, _ := v.GetStringArray(\"children\")\n  for i, child := range children {\n    log.Printf(\"child %d: %s\", i, child)\n  }\n\n  others, _ := v.GetObject(\"other\")\n\n  for _, value := range others.Map() {\n\n    s, sErr := value.String()\n    n, nErr := value.Number()\n\n    if sErr == nil {\n      log.Println(\"string value: \", s)\n    } else if nErr == nil {\n      log.Println(\"number value: \", n)\n    }\n  }\n}\n\n```\n\n## Documentation\n\nDocumentation can be found on godoc:\n\nhttps://godoc.org/github.com/antonholmquist/jason\n\n## Test\nTo run the project tests:\n\n```shell\ngo test\n```\n\n## Compatibility\n\nGo 1.1 and up.\n\n## Where does the name come from?\n\nI remembered it from an email one of our projects managers sent a couple of years ago.\n\n\u003e \"Don't worry. We can handle both XML and Jason\"\n\n## Author\n\nAnton Holmquist, http://twitter.com/antonholmquist\n","funding_links":[],"categories":["Misc","Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonholmquist%2Fjason","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonholmquist%2Fjason","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonholmquist%2Fjason/lists"}