Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pjfanning/jackson-module-enumeratum
Enumeratum support for Jackson
https://github.com/pjfanning/jackson-module-enumeratum
enumeratum jackson json scala
Last synced: 3 months ago
JSON representation
Enumeratum support for Jackson
- Host: GitHub
- URL: https://github.com/pjfanning/jackson-module-enumeratum
- Owner: pjfanning
- License: apache-2.0
- Created: 2021-01-02T13:17:30.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T18:01:04.000Z (8 months ago)
- Last Synced: 2024-05-08T19:07:44.422Z (8 months ago)
- Topics: enumeratum, jackson, json, scala
- Language: Scala
- Homepage:
- Size: 75.2 KB
- Stars: 4
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jackson-module-enumeratum
![Build Status](https://github.com/pjfanning/jackson-module-enumeratum/actions/workflows/ci.yml/badge.svg)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.pjfanning/jackson-module-enumeratum_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.pjfanning/jackson-module-enumeratum_2.13)Enumeratum support for Jackson
```
libraryDependencies += "com.github.pjfanning" %% "jackson-module-enumeratum" % "2.17.1"
``````
val mapper = JsonMapper.builder().addModule(DefaultScalaModule).addModule(EnumeratumModule).build()
val car = Car("Volga", Color.Blue)
val json = mapper.writeValueAsString(car)
mapper.readValue(json, classOf[Car]) shouldEqual(car)
```