Skip to content

Commit c38dc31

Browse files
committed
Backport README from master to help merging
1 parent 4aedcc4 commit c38dc31

File tree

1 file changed

+64
-21
lines changed

1 file changed

+64
-21
lines changed

README.md

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22

33
# Overview
44

5-
Module that adds support for serialization/deserialization of [Kotlin](http://kotlinlang.org) classes and data classes. Previously a default constructor must have existed on the Kotlin object for Jackson to deserialize into the object. With this module, single constructor classes can be used automatically, and those with secondary constructors or static factories are also supported.
5+
Module that adds support for serialization/deserialization of [Kotlin](http://kotlinlang.org)
6+
classes and data classes.
7+
Previously a default constructor must have existed on the Kotlin object for Jackson to deserialize into the object.
8+
With this module, single constructor classes can be used automatically,
9+
and those with secondary constructors or static factories are also supported.
610

711
# Status
812

9-
2.9.8+ Releases are compiled with Kotlin 1.3.x, other older releases are Kotlin 1.2.x. All should be compatible with
10-
current Kotlin if you also ensure the `kotlin-reflect` dependency is included with the same version number as stdlib.
13+
2.9.8+ Releases are compiled with Kotlin 1.3.x, other older releases are Kotlin 1.2.x.
14+
All should be compatible with current Kotlin if you also ensure the `kotlin-reflect`
15+
dependency is included with the same version number as stdlib.
1116

12-
* release `2.12` (for Jackson `2.12.x`) [![CircleCI](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.12.svg?style=svg)](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.12)
13-
* release `2.11.2` (for Jackson `2.11.x`) [![CircleCI](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.11.svg?style=svg)](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.11)
17+
* release `2.12.0` (for Jackson `2.12.x`) [![CircleCI](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.12.svg?style=svg)](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.12)
18+
* release `2.11.4` (for Jackson `2.11.x`) [![CircleCI](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.11.svg?style=svg)](https://circleci.com/gh/FasterXML/jackson-module-kotlin/tree/2.11)
1419
* release `2.10.5` (for Jackson `2.10.x`)
1520
* release `2.9.10` (for Jackson `2.9.x`)
1621

1722
Releases require that you have included Kotlin stdlib and reflect libraries already.
1823

1924
Gradle:
2025
```
21-
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.12.+"
26+
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.12.+"
2227
```
2328

2429
Maven:
@@ -75,8 +80,7 @@ myMemberWithType = mapper.readValue(json)
7580
```
7681

7782
All inferred types for the extension functions carry in full generic information (reified generics).
78-
Therefore, using `readValue()` extension without the `Class` parameter will reify the type and
79-
automatically create a `TypeReference` for Jackson.
83+
Therefore, using `readValue()` extension without the `Class` parameter will reify the type and automatically create a `TypeReference` for Jackson.
8084

8185
# Annotations
8286

@@ -93,18 +97,20 @@ An example of these concepts:
9397
}
9498
```
9599

96-
Note that using `lateinit` or `Delegates.notNull()` will ensure that the value is never null when read,
97-
while letting it be instantiated after the construction of the class.
100+
Note that using `lateinit` or `Delegates.notNull()` will ensure that the value is never `null` when read, while letting it be instantiated after the construction of the class.
98101

99102
# Caveats
100103

101104
* The `@JsonCreator` annotation is optional unless you have more than one constructor that is valid, or you want to use a static factory method (which also must have `platformStatic` annotation, e.g. `@JvmStatic`). In these cases, annotate only one method as `JsonCreator`.
102105
* Serializing a member or top-level Kotlin class that implements Iterator requires a workaround, see [Issue #4](https://github.com/FasterXML/jackson-module-kotlin/issues/4) for easy workarounds.
103-
* If using proguard, `kotlin.Metadata` annotations may be stripped, preventing deserialization. Add a proguard rule to keep the `kotlin.Metadata` class: `-keep class kotlin.Metadata { *; }`
106+
* If using proguard:
107+
* `kotlin.Metadata` annotations may be stripped, preventing deserialization. Add a proguard rule to keep the `kotlin.Metadata` class: `-keep class kotlin.Metadata { *; }`
108+
* If you're getting `java.lang.ExceptionInInitializerError`, you may also need: `-keep class kotlin.reflect.** { *; }`
104109

105110
# Support for Kotlin Built-in classes
106111

107-
These Kotlin classes are supported with the following fields for serialization/deserialization (and other fields are hidden that are not relevant):
112+
These Kotlin classes are supported with the following fields for serialization/deserialization
113+
(and other fields are hidden that are not relevant):
108114

109115
* Pair _(first, second)_
110116
* Triple _(first, second, third)_
@@ -116,22 +122,18 @@ These Kotlin classes are supported with the following fields for serialization/d
116122

117123
# Configuration
118124

119-
The Kotlin module may be given a few configuration parameters at construction time; see the [inline documentation](https://github.com/FasterXML/jackson-module-kotlin/blob/master/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt) for details on what options are available and what they do.
125+
The Kotlin module may be given a few configuration parameters at construction time;
126+
see the [inline documentation](https://github.com/FasterXML/jackson-module-kotlin/blob/master/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt)
127+
for details on what options are available and what they do.
120128

121129
```kotlin
122130
val mapper = JsonMapper.builder()
123131
.addModule(KotlinModule(strictNullChecks = true))
124132
.build()
125-
126-
// Or, from version 2.12
127-
val mapper = jsonMapper {
128-
addModule(kotlinModule {
129-
strictNullChecks(true)
130-
})
131-
}
132133
```
133134

134-
If your `ObjectMapper` is constructed in Java, there is a builder method provided for configuring these options:
135+
If your `ObjectMapper` is constructed in Java, there is a builder method
136+
provided for configuring these options:
135137

136138
```java
137139
KotlinModule kotlinModule = new KotlinModule.Builder()
@@ -141,3 +143,44 @@ ObjectMapper objectMapper = JsonMapper.builder()
141143
.addModule(kotlinModule)
142144
.build();
143145
```
146+
147+
# Development
148+
149+
## Maintainers
150+
151+
Following developers have committer access to this project.
152+
153+
* Author: Jayson Minard (@apatrida) wrote this module; still helps issues from time to time
154+
* Active Maintainers:
155+
* Drew Stephens (@dinomite)
156+
* Vyacheslav Artemyev (@viartemev)
157+
* Co-maintainers:
158+
* Tatu Saloranta (@cowtowncoder)
159+
160+
You may at-reference them as necessary but please keep in mind that all
161+
maintenance work is strictly voluntary (no one gets paid to work on this
162+
or any other Jackson components) so there is no guarantee for timeliness of
163+
responses.
164+
165+
All Pull Requests should be reviewed by at least one of active maintainers;
166+
bigger architectural/design questions should be agreed upon by majority of
167+
active maintainers (at this point meaning both Drew and Vyacheslav :) ).
168+
169+
## Releases & Branches
170+
171+
This module follows the release schedule of the rest of Jackson—the current version is consistent
172+
across all Jackson components & modules. See the [jackson-databind README](https://github.com/FasterXML/jackson#actively-developed-versions) for details.
173+
174+
## Contributing
175+
176+
We welcome any contributions—reports of issues, ideas for enhancements, and pull requests related to either of those.
177+
178+
See the [main Jackson contribution guidlines](https://github.com/FasterXML/jackson/blob/master/CONTRIBUTING.md) for more details.
179+
180+
### Branches
181+
182+
If you are going to write code, choose the appropriate base branch:
183+
184+
- `2.12` for bugfixes against the current stable version
185+
- `2.13` for additive functionality & features or [minor](https://semver.org), backwards compatible changes to existing behavior to be included in the next minor version release
186+
- `master` for significant changes to existing behavior, which will be part of Jackson 3.0

0 commit comments

Comments
 (0)