{"id":37113079,"url":"https://github.com/chengshicheng/json-key-convertor","last_synced_at":"2026-01-14T13:21:17.134Z","repository":{"id":153671779,"uuid":"628616668","full_name":"chengshicheng/json-key-convertor","owner":"chengshicheng","description":"Converts the format of all keys in dynamic JSON sring to another format, such as case and underscore","archived":false,"fork":false,"pushed_at":"2023-04-22T11:19:48.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-29T11:10:45.516Z","etag":null,"topics":["camelcase","dynamic","golang","json","jsonstring","key-converter","snakecase"],"latest_commit_sha":null,"homepage":"","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/chengshicheng.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}},"created_at":"2023-04-16T14:06:32.000Z","updated_at":"2024-01-18T10:46:45.000Z","dependencies_parsed_at":"2023-09-25T01:48:33.248Z","dependency_job_id":null,"html_url":"https://github.com/chengshicheng/json-key-convertor","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"ddf43a7a974de271c20922b31597c3b4a1618d41"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chengshicheng/json-key-convertor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengshicheng%2Fjson-key-convertor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengshicheng%2Fjson-key-convertor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengshicheng%2Fjson-key-convertor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengshicheng%2Fjson-key-convertor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chengshicheng","download_url":"https://codeload.github.com/chengshicheng/json-key-convertor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengshicheng%2Fjson-key-convertor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"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":["camelcase","dynamic","golang","json","jsonstring","key-converter","snakecase"],"created_at":"2026-01-14T13:21:16.581Z","updated_at":"2026-01-14T13:21:17.122Z","avatar_url":"https://github.com/chengshicheng.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-key-convertor\n[![Go](https://github.com/chengshicheng/json-key-convertor/actions/workflows/go.yml/badge.svg)](https://github.com/chengshicheng/json-key-convertor/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/chengshicheng/json-key-convertor)](https://goreportcard.com/report/github.com/chengshicheng/json-key-convertor)\n[![Go doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go\u0026logoColor=white\u0026style=flat)](https://pkg.go.dev/github.com/chengshicheng/json-key-convertor)\n[![codecov](https://codecov.io/gh/chengshicheng/json-key-convertor/branch/main/graph/badge.svg?token=SIOQNMM823)](https://codecov.io/gh/chengshicheng/json-key-convertor)\n\njson-key-convertor is a Go package, it provides a simple way to converts the format of all keys in dynamic JSON to another format, such as case and underscore\n\n\n# Getting Started\n\n## Features\n\n- Four built-in key conversion methods, lowercase, uppercase, snakecase, camlecase\n- Support for nested multi-level json\n- Custom key convert methods\n\n## Installing\n\nTo start using json-key-convertor, install Go and run `go get`:\n\n```sh\n$ go get -u github.com/chengshicheng/json-key-convertor\n```\n\nThis will retrieve the library.\n\n## Example\n\n### General Key Convert\n```Go\npackage main\n\nimport (\n\tconvertor \"github.com/chengshicheng/json-key-convertor\"\n)\n\nconst jsonStr = `{\"name\":{\"first_name\":\"Janet\",\"last_name\":\"Prichard\"},\"age\":47}`\n\nfunc main() {\n\tvalue, err := convertor.ConvertKey([]byte(jsonStr), convertor.Camel)\n\tif err != nil {\n\t\tprintln(err.Error())\n\t}\n\tprintln(string(value))\n\t// {\"Age\":47,\"Name\":{\"FirstName\":\"Janet\",\"LastName\":\"Prichard\"}}\n}\n```\n\n### Custom Key Convert\n```Go\npackage main\n\nimport (\n\tconvertor \"github.com/chengshicheng/json-key-convertor\"\n)\n\nconst jsonStr = `{\"name\":{\"first_name\":\"Janet\",\"last_name\":\"Prichard\"},\"age\":47}`\n\nfunc myPrefixFunc(s string) string {\n\treturn \"my_\" + s\n}\n\nfunc main() {\n\t// register convert function\n\tconvertor.RegisterConvertFunc(\"myprefix\", myPrefixFunc)\n\tvalue, err := convertor.ConvertKey([]byte(jsonStr), \"myprefix\")\n\tif err != nil {\n\t\tprintln(err.Error())\n\t}\n\tprintln(string(value))\n\t// {\"my_age\":47,\"my_name\":{\"my_first_name\":\"Janet\",\"my_last_name\":\"Prichard\"}}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchengshicheng%2Fjson-key-convertor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchengshicheng%2Fjson-key-convertor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchengshicheng%2Fjson-key-convertor/lists"}