{"id":13801517,"url":"https://github.com/FasterXML/jackson-module-scala","last_synced_at":"2025-05-13T11:31:18.481Z","repository":{"id":1210093,"uuid":"1123727","full_name":"FasterXML/jackson-module-scala","owner":"FasterXML","description":"Add-on module for Jackson (https://github.com/FasterXML/jackson) to support Scala-specific datatypes","archived":false,"fork":false,"pushed_at":"2025-05-07T08:51:24.000Z","size":20544,"stargazers_count":502,"open_issues_count":52,"forks_count":143,"subscribers_count":26,"default_branch":"2.x","last_synced_at":"2025-05-07T09:30:20.528Z","etag":null,"topics":["cbor","hacktoberfest","jackson","json","scala","serialization","smile","xml"],"latest_commit_sha":null,"homepage":"","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/FasterXML.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"tidelift":"maven/com.fasterxml.jackson.module:jackson-module-scala_2.13"}},"created_at":"2010-11-29T23:01:08.000Z","updated_at":"2025-05-07T08:50:18.000Z","dependencies_parsed_at":"2024-03-21T11:28:04.343Z","dependency_job_id":"69ffb32f-6cde-4ffb-9e59-56167a801290","html_url":"https://github.com/FasterXML/jackson-module-scala","commit_stats":{"total_commits":1586,"total_committers":65,"mean_commits":24.4,"dds":0.5472887767969735,"last_synced_commit":"a83b40dfcedc81b675bb29bd94ace52dfd7d89ec"},"previous_names":[],"tags_count":162,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Fjackson-module-scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Fjackson-module-scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Fjackson-module-scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Fjackson-module-scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FasterXML","download_url":"https://codeload.github.com/FasterXML/jackson-module-scala/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932859,"owners_count":21986466,"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":["cbor","hacktoberfest","jackson","json","scala","serialization","smile","xml"],"created_at":"2024-08-04T00:01:23.755Z","updated_at":"2025-05-13T11:31:18.474Z","avatar_url":"https://github.com/FasterXML.png","language":"Scala","readme":"![Build Status](https://github.com/FasterXML/jackson-module-scala/actions/workflows/ci.yml/badge.svg?branch=2.x)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.module/jackson-module-scala_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.module/jackson-module-scala_2.13)\n[![Tidelift](https://tidelift.com/badges/package/maven/com.fasterxml.jackson.module:jackson-module-scala_2.13)](https://tidelift.com/subscription/pkg/maven-com.fasterxml.jackson.module.jackson-module-scala.2.13?utm_source=maven-com.fasterxml.jackson.module.jackson-module-scala.2.13\u0026utm_medium=github_sponsor_button\u0026utm_campaign=readme)\n\n# Overview\n\n[Jackson] is a fast JSON processor for Java that supports three models:\nstreaming, node, and object mapping (akin to the three independent models\n[SAX]/[Stax], [DOM] and [JAXB] for XML processing).\n\nThe object mapping model is a high-level processing model that allows the\nuser to project JSON data onto a domain-specific data model appropriate\nfor their application, without having to deal with the low-level mechanics\nof JSON parsing. It is the standard object mapping parser implementaton\nin [Jersey], the reference implementation for JSR-311\n(Java API for\nRestful Web Services).\n\n[Scala] is a functional programming language for the JVM that supports\nJava interoperability. Its standard library is quite distinct from Java,\nand does not fulfill the expectations of Jacksons default mappings.\nNotably, Scala collections do not derive from `java.util.Collection` or\nits subclasses, and Scala properties do not (by default) look like `Java Bean` properties.\n\nThe Scala Module supports serialization and limited deserialization of\nScala Case Classes, `Sequence`s, `Map`s, `Tuple`s, `Option`s, and Enumerations.\n\n# Version Support\n\nJackson-module-scala follows the same release strategy of [jackson-databind](https://github.com/FasterXML/jackson-databind).\n3.x branch is used for Jackson 3 development.\n\nScala 2.11, 2.12 and 2.13 are supported. Scala 2.10 support was dropped in v2.12.0 (but there is a special v2.12.7 release). Java 8 is\nthe minimum supported version now.\n\n## Scala 3\n\n[Scala 3 support](https://github.com/FasterXML/jackson-module-scala/issues?q=is%3Aissue+is%3Aopen+label%3Ascala3) was added in v2.13.0.\nThere are a few differences from Scala 2 support.\n* ScalaObjectMapper is not supported for Scala 3 but ClassTagExtensions is its replacement. (https://github.com/FasterXML/jackson-module-scala/issues/503)\n* There are still a few tests that work with Scala 2 that fail with Scala 3\n* It is expected that most use cases should work ok with Scala 3\n  * Known issues with using jackson-module-scala with Scala 3 are tracked at https://github.com/FasterXML/jackson-module-scala/labels/scala3\n  * There has been no testing of using Scala 3 classes with Scala 2 jackson-module-scala or Scala 2 classes with Scala 3 jackson-module-scala\n\n# Usage\n\nTo use the Scala Module in Jackson, simply register it with the\nObjectMapper instance:\n\n```scala\n// With 2.10 and later\nval mapper = JsonMapper.builder()\n  .addModule(DefaultScalaModule)\n  .build()\n\n// versions before 2.10 (also support for later 2.x but not 3.0)\nval mapper = new ObjectMapper()\nmapper.registerModule(DefaultScalaModule)\n```\n\n`DefaultScalaModule` is a Scala object that includes support for all\ncurrently supported Scala data types. If only partial support is desired,\nthe component traits can be included individually:\n\n```scala\nval module = new OptionModule with TupleModule {}\nval mapper = JsonMapper.builder()\n  .addModule(module)\n  .build()\n```\n\nPrior to v2.16.0, `ScalaObjectDeserializerModule` was not part of `DefaultScalaModule`. This module is used to\nensure that deserialization to a Scala object does not create a new instance of the object. Users of older versions can add this\nmodule explicitly.\n\n## DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES\n\nIt is recommended that Scala users enable `DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES`. This feature means that when you\ndeserialize JSON and bind to a Scala/Java class and a required field is missing (or null), then the deserialization call will fail\nwith a `com.fasterxml.jackson.databind.exc.MismatchedInputException`. By default, the deserialization call will succeed and a `null` value\nwill be set for the field.\n\n```scala\nval mapper = JsonMapper.builder()\n  .addModule(DefaultScalaModule)\n  .enable(DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES)\n  .build()\n```\n\n## ClassTagExtensions\nYou can also mixin `ClassTagExtensions` to get rich wrappers that automatically\nconvert scala ClassTags directly into TypeReferences for Jackson to use:\n```scala\nval mapper = JsonMapper.builder().addModule(DefaultScalaModule).build() :: ClassTagExtensions\n// or using old style\n//val mapper = new ObjectMapper() with ClassTagExtensions\n//mapper.registerModule(DefaultScalaModule)\nval myMap = mapper.readValue[Map[String, Tuple2[Int,Int]]](src)\n```\n\nClassTagExtensions is a replacement for `ScalaObjectMapper`, which was recently deprecated because it relies on `Manifest`s and they are not supported in Scala 3.\n\nThis is the equivalent of\n```scala\nval mapper = JsonMapper.builder().addModule(DefaultScalaModule).build()\nval myMap = mapper.readValue(src, new TypeReference[Map[String,Tuple2[Int,Int]]]{})\n```\n\nConsult the [Scaladoc](https://fasterxml.github.io/jackson-module-scala/latest/api/) for further details.\n\n## Sbt\n\nTo import in sbt:\n```scala\nlibraryDependencies += \"com.fasterxml.jackson.module\" %% \"jackson-module-scala\" % \"2.18.3\"\n```\n\n## Java/Kotlin users\n\nDefaultScalaModule is a Scala Object and to access it when you are not compiling with Scala compiler, you will need to use `DefaultScalaModule$.MODULE$` instead.\n\n```java\nimport com.fasterxml.jackson.module.scala.DefaultScalaModule$;\n\nObjectMapper mapper = JsonMapper.builder().addModule(DefaultScalaModule$.MODULE$).build();\n```\n\n# Building\n\nThe branches often depends on SNAPSHOT versions of the core Jackson projects,\nwhich are published to the Sonatype OSS Repository. To make these dependencies available,\ncreate a file called `sonatype.sbt` in the same directory as `build.sbt` with the following\ncontent. The project `.gitignore` file intentionally prevents this file from being checked in.\n\n``` scala\nresolvers ++= Resolver.sonatypeOssRepos(\"snapshots\")\n```\n\n# Download, docs\n\nCheck out [Wiki]. API Scaladocs can be found [on the project site][API] but they are not really\nwell suited to end users, as most classes are implementation details of the module.\n\n# Related Projects\n* [jackson-scala-reflect-extensions](https://github.com/pjfanning/jackson-scala-reflect-extensions)\n* [jackson-scala3-reflect-extensions](https://github.com/pjfanning/jackson-scala3-reflection-extensions)\n* [jackson-module-enumeratum](https://github.com/pjfanning/jackson-module-enumeratum)\n* [jackson-module-scala3-enum](https://github.com/pjfanning/jackson-module-scala3-enum) -- since v2.17.0, this is included in jackson-module-scala\n* [jackson-caffeine-cache](https://github.com/pjfanning/jackson-caffeine-cache)\n\n# Contributing\n\nThe main mechanisms for contribution are:\n\n* Reporting issues, suggesting improved functionality on Github issue tracker\n* Participating in discussions on mailing lists, Gitter (see [Jackson portal](https://github.com/FasterXML/jackson#participation) for details)\n* Submitting Pull Requests (PRs) to fix issues, improve functionality.\n\n## Support\n\n### Community support\n\nJackson components are supported by the Jackson community through mailing lists, Gitter forum, Github issues. See [Participation, Contributing](../../../jackson#participation-contributing) for full details.\n\n\n### Enterprise support\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of `jackson-module-scala` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/maven-com.fasterxml.jackson.module.jackson-module-scala.2.13?utm_source=maven-com.fasterxml.jackson.module.jackson-module-scala.2.13\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo)\n\n## Core Development Team\n\nCurrently active core developers (ones who can review, accept and merge Pull Requests) are:\n\n* PJ Fanning (@pjfanning)\n\nIf you have questions on issues, implementation strategies, you may refer to core developers\n(and this is recommended if you are in doubt!), but keep in mind that these are voluntary\npositions: everyone is doing this because they want to, not because they are paid or\ncontractually obligated to. This also means that time availability changes over time\nso getting answers may take time.\n\nIn addition, other Jackson developers with similar access (but less active) include:\n\n* Christopher Currie (@christophercurrie) -- original author of Scala module\n* Morten Kjetland (@mbknor)\n* Nate Bauernfeind (@nbauernfeind)\n* Tatu Saloranta (@cowtowncoder) -- main author of core Jackson components\n\n# Acknowledgements\n\n[![Developed with IntelliJ IDEA](https://www.jetbrains.com/img/logos/logo_intellij_idea.png \"Developed with IntelliJ IDEA\")](https://www.jetbrains.com/idea/features/scala.html)\n\n[Jackson]: https://github.com/FasterXML/jackson\n[SAX]: https://www.saxproject.org/\n[DOM]: https://www.w3.org/TR/DOM-Level-3-Core/\n[JAXB]: https://jaxb.java.net/\n[Jersey]: https://jersey.java.net/\n[Java Bean]: https://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html\n[Scala]: https://www.scala-lang.org/\n[Wiki]: https://github.com/FasterXML/jackson-module-scala/wiki\n[API]: https://fasterxml.github.io/jackson-module-scala/latest/api/#com.fasterxml.jackson.module.scala.package\n","funding_links":["https://tidelift.com/funding/github/maven/com.fasterxml.jackson.module:jackson-module-scala_2.13","https://tidelift.com/badges/package/maven/com.fasterxml.jackson.module:jackson-module-scala_2.13","https://tidelift.com/subscription/pkg/maven-com.fasterxml.jackson.module.jackson-module-scala.2.13?utm_source=maven-com.fasterxml.jackson.module.jackson-module-scala.2.13\u0026utm_medium=github_sponsor_button\u0026utm_campaign=readme","https://tidelift.com/subscription/pkg/maven-com.fasterxml.jackson.module.jackson-module-scala.2.13?utm_source=maven-com.fasterxml.jackson.module.jackson-module-scala.2.13\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo"],"categories":["Table of Contents","JSON","JSON Manipulation"],"sub_categories":["JSON"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFasterXML%2Fjackson-module-scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFasterXML%2Fjackson-module-scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFasterXML%2Fjackson-module-scala/lists"}