{"id":37020254,"url":"https://github.com/scalapb-json/scalapb-circe","last_synced_at":"2026-01-14T02:16:59.951Z","repository":{"id":28059311,"uuid":"116074782","full_name":"scalapb-json/scalapb-circe","owner":"scalapb-json","description":"Json/Protobuf convertors for ScalaPB use circe","archived":false,"fork":false,"pushed_at":"2025-12-23T21:55:32.000Z","size":433,"stargazers_count":47,"open_issues_count":6,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-25T11:40:59.990Z","etag":null,"topics":["circe","json","protobuf","scala","scala-js","scalapb"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/scalapb-json.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-01-03T01:14:37.000Z","updated_at":"2025-12-23T21:55:36.000Z","dependencies_parsed_at":"2026-01-05T23:12:24.646Z","dependency_job_id":null,"html_url":"https://github.com/scalapb-json/scalapb-circe","commit_stats":{"total_commits":581,"total_committers":7,"mean_commits":83.0,"dds":0.3855421686746988,"last_synced_commit":"603010976b632e89df1e38570144277e41e68284"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/scalapb-json/scalapb-circe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalapb-json%2Fscalapb-circe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalapb-json%2Fscalapb-circe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalapb-json%2Fscalapb-circe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalapb-json%2Fscalapb-circe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalapb-json","download_url":"https://codeload.github.com/scalapb-json/scalapb-circe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalapb-json%2Fscalapb-circe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["circe","json","protobuf","scala","scala-js","scalapb"],"created_at":"2026-01-14T02:16:59.355Z","updated_at":"2026-01-14T02:16:59.943Z","avatar_url":"https://github.com/scalapb-json.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scalapb-circe\n[![scaladoc](https://javadoc.io/badge2/io.github.scalapb-json/scalapb-circe_3/javadoc.svg)](https://javadoc.io/doc/io.github.scalapb-json/scalapb-circe_3)\nThe structure of this project is hugely inspired by [scalapb-json4s](https://github.com/scalapb/scalapb-json4s)\n\n## Dependency\n\nInclude in your `build.sbt` file\n\n### core\n\n```scala\nlibraryDependencies += \"io.github.scalapb-json\" %% \"scalapb-circe\" % \"0.16.0\"\n```\n\nfor scala-js or scala-native\n\n```scala\nlibraryDependencies += \"io.github.scalapb-json\" %%% \"scalapb-circe\" % \"0.16.0\"\n```\n\n### macros\n\n```scala\nlibraryDependencies += \"io.github.scalapb-json\" %% \"scalapb-circe-macros\" % \"0.16.0\"\n```\n\n## Usage\n\n### JsonFormat\n\nThere are four functions you can use directly to serialize/deserialize your messages:\n\n```scala\nJsonFormat.toJsonString(msg) // returns String\nJsonFormat.toJson(msg) // returns Json\n\nJsonFormat.fromJsonString(str) // return MessageType\nJsonFormat.fromJson(json) // return MessageType\n```\n\n### Implicit Circe Codecs\n\nYou can also import codecs to support Circe's implicit syntax for objects of type `GeneratedMessage` and `GeneratedEnum`.\n\nAssume a proto message:\n\n```scala\nmessage Guitar {\n  int32 number_of_strings = 1;\n}\n```\n\n```scala\nimport io.circe.syntax._\nimport io.circe.parser._\nimport scalapb_circe.codec._\n\nGuitar(42).asJson.noSpaces // returns {\"numberOfStrings\":42}\n\ndecode[Guitar](\"\"\"{\"numberOfStrings\": 42}\"\"\") // returns Right(Guitar(42))\nJson.obj(\"numberOfStrings\" -\u003e Json.fromInt(42)).as[Guitar] // returns Right(Guitar(42))\n```\n\nYou can define an implicit `scalapb_circe.Printer` and/or `scalapb_circe.Parser` to control printing and parsing settings. \nFor example, to include default values in Json:\n\n```scala\nimport io.circe.syntax._\nimport io.circe.parser._\nimport scalapb_circe.codec._\nimport scalapb_circe.Printer\n\nimplicit val p: Printer = new Printer(includingDefaultValueFields = true)\n\nGuitar(0).asJson.noSpaces // returns {\"numberOfStrings\": 0}\n```\n\nFinally, you can include scalapb `GeneratedMessage` and `GeneratedEnum`s in regular case classes with semi-auto derivation:\n\n```scala\nimport io.circe.generic.semiauto._\nimport io.circe.syntax._\nimport io.circe._\nimport scalapb_circe.codec._ // IntelliJ might say this is unused.\n\ncase class Band(guitars: Seq[Guitar])\nobject Band {\n  implicit val dec: Decoder[Band] = deriveDecoder[Band]\n  implicit val enc: Encoder[Band] = deriveEncoder[Band]\n}\nBand(Seq(Guitar(42))).asJson.noSpaces // returns {\"guitars\":[{\"numberOfStrings\":42}]}\n```\n\n\n### Credits\n\n- https://github.com/whisklabs/scalapb-playjson\n- https://github.com/scalapb/scalapb-json4s\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalapb-json%2Fscalapb-circe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalapb-json%2Fscalapb-circe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalapb-json%2Fscalapb-circe/lists"}