{"id":17130277,"url":"https://github.com/aparo/zio-json-extra","last_synced_at":"2025-10-30T05:10:33.357Z","repository":{"id":66571757,"uuid":"591901073","full_name":"aparo/zio-json-extra","owner":"aparo","description":"Several extensions to ZIO-Json to speed up migration of projects from Circe to ZIO-Json","archived":false,"fork":false,"pushed_at":"2023-09-23T17:54:22.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T10:44:17.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aparo.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-01-22T09:27:51.000Z","updated_at":"2023-01-22T17:17:56.000Z","dependencies_parsed_at":"2023-06-01T19:30:28.160Z","dependency_job_id":null,"html_url":"https://github.com/aparo/zio-json-extra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aparo%2Fzio-json-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aparo%2Fzio-json-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aparo%2Fzio-json-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aparo%2Fzio-json-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aparo","download_url":"https://codeload.github.com/aparo/zio-json-extra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245212136,"owners_count":20578440,"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":[],"created_at":"2024-10-14T19:11:59.625Z","updated_at":"2025-10-30T05:10:28.329Z","avatar_url":"https://github.com/aparo.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zio-json-extra\nThis is a collection of extensions to zio-json, very opionated, required to fast migrate circe code to zio-json (mainly [zio-elasticsearch](https://github.com/aparo/zio-elasticsearch)).\n\nIt generally targets some functionalities that are missing in zio-json such as:\n- Derivation of Enumeration in string\n- Help methods to manipulate JSON AST  \n\nThere are three modules:\n- zio-json-extra that extends zio-json\n- zio-json-diffson (WIP) that provides [diffson](https://github.com/gnieh/diffson) support (A scala diff/patch library for Json)\n- zio-json-exception that extends Exception managements with classes that can be module-scoped and easy \"wireable\".\n\n## Derivation Enumeration in String\nThis capability adds DeriveJsonDecoderEnum/DeriveJsonEncoderEnum that provides enum support based on plain trait/objects\n```\n  @jsonEnumUpperCase\n  sealed trait Status extends EnumUpperCase\n  case object Running extends Status\n  case object Failure extends Status\n\n  case class Entity(name: String, status: Status)\n\n  implicit val statusDecoder: JsonDecoder[Status] = DeriveJsonDecoderEnum.gen[Status]\n  implicit val statusEncoder: JsonEncoder[Status] = DeriveJsonEncoderEnum.gen[Status]\n  implicit val entityDecoder: JsonDecoder[Entity] = DeriveJsonDecoder.gen[Entity]\n  implicit val entityEncoder: JsonEncoder[Entity] = DeriveJsonEncoder.gen[Entity]\n\n   # sample \n\n    test(\"simple enum upper value\") {\n      import exampleupperenums._\n    \n      assert(\"\"\"\"RUNNING\"\"\"\".fromJson[Status])(isRight(equalTo(Running)))\n    },\n    test(\"case class with enum upper value\") {\n      import exampleupperenums._\n    \n      assert(\"\"\"{\"name\":\"Sample\",\"status\":\"FAILURE\"}\"\"\".fromJson[Entity])(\n        isRight(equalTo(Entity(name = \"Sample\", status = Failure)))\n      )\n    }\n\n```\nMore example in [tests](zio-json-extra/src/test/scala/zio/json/ast/DeriveJsonEnumSpec.scala) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faparo%2Fzio-json-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faparo%2Fzio-json-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faparo%2Fzio-json-extra/lists"}