{"id":18865980,"url":"https://github.com/arrow-kt/arrow-integrations","last_synced_at":"2025-06-17T06:33:52.977Z","repository":{"id":37585722,"uuid":"240568488","full_name":"arrow-kt/arrow-integrations","owner":"arrow-kt","description":"Λrrow Integrations is part of Λrrow, a functional companion to Kotlin's Standard Library","archived":false,"fork":false,"pushed_at":"2025-04-08T16:14:44.000Z","size":426,"stargazers_count":27,"open_issues_count":8,"forks_count":6,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-08T17:26:42.584Z","etag":null,"topics":["arrow","functional-programming","kotlin-library"],"latest_commit_sha":null,"homepage":"http://arrow-kt.io","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arrow-kt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-14T17:57:18.000Z","updated_at":"2025-01-21T14:04:04.000Z","dependencies_parsed_at":"2023-09-25T04:03:31.511Z","dependency_job_id":"805f9e67-ff6c-4815-a992-a43541d1d69c","html_url":"https://github.com/arrow-kt/arrow-integrations","commit_stats":null,"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrow-kt%2Farrow-integrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrow-kt%2Farrow-integrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrow-kt%2Farrow-integrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrow-kt%2Farrow-integrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arrow-kt","download_url":"https://codeload.github.com/arrow-kt/arrow-integrations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248895439,"owners_count":21179236,"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":["arrow","functional-programming","kotlin-library"],"created_at":"2024-11-08T05:05:13.912Z","updated_at":"2025-06-17T06:33:52.957Z","avatar_url":"https://github.com/arrow-kt.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arrow Integrations [![Maven Central](https://img.shields.io/maven-central/v/io.arrow-kt/arrow-integrations-jackson-module?color=4caf50\u0026label=latest%20release)](https://maven-badges.herokuapp.com/maven-central/io.arrow-kt/arrow-integrations-jackson-module)\n\n\u003e [!WARNING]\n\u003e Development of Arrow Integrations has moved to the [main Arrow repository](https://github.com/arrow-kt/arrow)\n\n[![Arrow Core logo](https://raw.githubusercontent.com/arrow-kt/arrow-site/master/docs/img/core/arrow-core-brand-sidebar.svg?sanitize=true)](https://arrow-kt.io)\n\nΛrrow Integrations is part of [**Λrrow**](https://arrow-kt.io).\n\n## Jackson Module\n\nInclude `arrow-integrations-jackson` in your gradle project:\n```groovy\nimplementation 'io.arrow-kt:arrow-integrations-jackson-module:${version}'\n```\nor, using gradle kotlin-dsl.\n```kotlin\nimplementation(\"io.arrow-kt:arrow-integrations-jackson-module:${version}\")\n```\n\nInclude `arrow-integrations-jackson` in your maven project:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.arrow-kt\u003c/groupId\u003e\n  \u003cartifactId\u003earrow-integrations-jackson-module\u003c/artifactId\u003e\n  \u003cversion\u003e${version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nTo register support for arrow datatypes, simply call `.registerArrowModule()` on the object mapper as follows:\n\n```kotlin\nimport arrow.integrations.jackson.module.registerArrowModule\nimport com.fasterxml.jackson.databind.ObjectMapper\nimport com.fasterxml.jackson.module.kotlin.registerKotlinModule\n\nval mapper = ObjectMapper()\n    .registerKotlinModule()\n    .registerArrowModule()\n```\n\ncurrently supported datatypes:\n- `Option\u003cT\u003e`\n- `NonEmptyList\u003cT\u003e` or `Nel\u003cT\u003e`\n- `Either\u003cL, R\u003e`\n- `Validated\u003cE, A\u003e`\n- `Ior\u003cL, R\u003e`\n\n### Example Usage\n\nSerialization and deserialization of data classes that incorporate arrow data types can be\ndone as follows. \n\n```kotlin\nval mapper = ObjectMapper()\n  .registerKotlinModule()\n  .registerArrowModule()\n  .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) // will not serialize None as nulls\n\ndata class Organization(val name: String, val address: Option\u003cString\u003e, val websiteUrl: Option\u003cURI\u003e)\ndata class ArrowUser(val name: String, val emails: NonEmptyList\u003cString\u003e, val organization: Option\u003cOrganization\u003e)\n\nval arrowUser = ArrowUser(\n  \"John Doe\",\n  nonEmptyListOf(\n    \"john@email.com\", \n    \"john.doe@email.com.au\"\n  ), \n  Organization(\"arrow-kt\", none(), URI(\"https://arrow-kt.io\").some()).some()\n)\n\nmapper.writerWithDefaultPrettyPrinter().writeValueAsString(user)\n```\nwhich serializes as follows.\n```json\n{\n  \"name\" : \"John Doe\",\n  \"emails\" : [ \"john@email.com\", \"john.doe@email.com.au\" ],\n  \"organization\" : {\n    \"name\" : \"arrow-kt\",\n    \"websiteUrl\" : \"https://arrow-kt.io\"\n  }\n}\n```\nNotice that the `Option\u003cT\u003e` serializer\nis configurable via Jackson's serialization inclusion setting. In this example we have configured the serializer\nto not serialize `none()` as null, but instead omit it completely.\n\nVarious serializers / deserializers within arrow module are configurable.\nFor instance the field names used for serializing / deserializing `Either`, `Validated` or `Ior` can\nbe configured within the registration step:\n\n```kotlin\nval mapper: ObjectMapper = ObjectMapper()\n  .registerKotlinModule()\n  .registerArrowModule(\n    eitherModuleConfig = EitherModuleConfig(\"left\", \"right\"),           // sets the field names for either left / right\n    validatedModuleConfig = ValidatedModuleConfig(\"invalid\", \"valid\"),  // sets the field names for validated invalid / valid\n    iorModuleConfig = IorModuleConfig(\"left\", \"right\")                  // sets the field names for ior left / right\n  )\n  .setSerializationInclusion(JsonInclude.Include.NON_ABSENT)            // do not serialize None as nulls\n\n```\n\nMore example usages can be found in [ExampleTest.kt](arrow-integrations-jackson-module/src/test/kotlin/arrow/integrations/jackson/module/ExampleTest.kt)\n\n### Example Usage for Popular Web Frameworks\n\nIn real world scenarios Jackson can be installed as the json serialization/deserialization\nengine. These serializations / deserializations are normally done\nautomatically.\n\nFor instance we can customize our mapper with `.registerArrowModule()` as follows.\n```kotlin\nobject JsonMapper { \n  val mapper: ObjectMapper = ObjectMapper()\n    .registerModule(KotlinModule(singletonSupport = SingletonSupport.CANONICALIZE))\n    .registerArrowModule()\n    .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)\n    .disable(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION)\n    .setSerializationInclusion(JsonInclude.Include.NON_ABSENT)\n}\n```\nThis can then be installed accordingly.\n\n#### Spring Boot\n\nA way to register of arrow data types JSON serialization / deserialization support in spring boot is as follows:\n\n```kotlin\n@Configuration\nclass JacksonConfiguration {\n\n  @Bean\n  @Primary\n  fun jsonMapper(): ObjectMapper = JsonMapper.mapper\n}\n```\nWhen this bean is registered, the object mapper will be used to deserialize incoming and outgoing JSON payload.\n\n#### Ktor\n\nJackson support for arrow data type serialization / deserialization can similarly be registered in Ktor as follows:\n```kotlin\ninstall(ContentNegotiation) {\n  register(ContentType.Application.Json, JacksonConverter(JsonMapper.mapper))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrow-kt%2Farrow-integrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrow-kt%2Farrow-integrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrow-kt%2Farrow-integrations/lists"}