Skip to content

Commit ddebf90

Browse files
authored
Merge pull request #191 from ProjectMapK/develop
For release 2.16.0-beta8
2 parents 05ff33a + 4ea64a6 commit ddebf90

File tree

29 files changed

+520
-127
lines changed

29 files changed

+520
-127
lines changed

.github/workflows/release.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
workflow_dispatch:
3+
jobs:
4+
gitPrRelease:
5+
name: git-pr-release
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@master
9+
with:
10+
fetch-depth: 0
11+
- name: git-pr-release
12+
uses: bakunyo/git-pr-release-action@master
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
GIT_PR_RELEASE_BRANCH_STAGING: ${{ github.ref_name }}
16+
GIT_PR_RELEASE_BRANCH_PRODUCTION: main

.github/workflows/test-main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
# LTS versions, latest version (if exists)
38-
java-version: [ '8', '11', '17', '20' ]
38+
java-version: [ '8', '11', '17', '21' ]
3939
# Minimum version, latest release version, latest pre-release version (if exists)
4040
kotlin:
4141
- name: '1.8.22'
4242
version: '1.8.22'
4343
k2: false
44-
- name: '1.9.20'
45-
version: '1.9.20'
44+
- name: '1.9.21'
45+
version: '1.9.21'
4646
k2: false
47-
- name: '1.9.20 K2'
48-
version: '1.9.20'
47+
- name: '1.9.21 K2'
48+
version: '1.9.21'
4949
k2: true
5050
- name: '2.0.0-Beta1'
5151
version: '2.0.0-Beta1'

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ Details are summarized in [KogeraSpecificImplementations](./docs/KogeraSpecificI
4141
## About compatibility checks
4242
Compatibility checks for `Java` and `Kotlin` are done by `CI` grid tests.
4343

44-
The `Java` test covers all currently supported LTS versions and the latest versions.
45-
Currently 8,11,17 and 20 are covered.
44+
The `Java` test covers all currently supported LTS versions and the latest versions.
4645

4746
`Kotlin` is tested with the latest patch version and the latest `Beta` or `RC` version within each minor version after the minimum version.
4847
The `Kotlin` version is the lowest version available with the latest `kotlinx-metadata-jvm`.
4948

49+
See [Workflow](./.github/workflows/test-main.yml) for the currently tested versions.
50+
5051
# Installation
5152
The package is temporarily published in `JitPack`.
5253
Please refer to `jitpack.io` for the released version.
@@ -81,12 +82,10 @@ You can check if your project's dependencies include `jackson-module-kotlin` by
8182
If you find any problems, it would be appreciated if you could share them in an `issue`.
8283

8384
# About the future
84-
Currently, this project is in `beta`.
85-
I intend to develop the following
85+
I will not be treating this project as "stable".
8686

87-
- Migration to more efficient reflection cache.
88-
- Resolve as many known bugs related to `value class` as possible.
89-
- Fixing other bugs.
87+
This project currently serves as a testing ground for all improvements to `jackson-module-kotlin`.
88+
In prototyping, it is important to be willing to make disruptive changes.
9089

9190
# About license
9291
This project is based on `jackson-module-kotlin`, so the license follows `jackson-module-kotlin`.

build.gradle.kts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
plugins {
22
`maven-publish` // for JitPack
33

4-
val kotlinVersion: String = System.getenv("KOTLIN_VERSION")?.takeIf { it.isNotEmpty() } ?: "1.8.22"
4+
val kotlinVersion: String = System.getenv("KOTLIN_VERSION")?.takeIf { it.isNotEmpty() }
5+
?: libs.versions.kotlin.get()
6+
57
kotlin("jvm") version kotlinVersion
68

79
java
8-
id("org.jmailen.kotlinter") version "3.16.0"
10+
alias(libs.plugins.kotlinter)
911
}
1012

1113
// Since group cannot be obtained by generateKogeraVersion, it is defined as a constant.
1214
val groupStr = "io.github.projectmapk"
13-
val jacksonVersion = "2.16.0"
15+
val jacksonVersion = libs.versions.jackson.get()
1416
val generatedSrcPath = "${layout.buildDirectory.get()}/generated/kotlin"
1517

1618
group = groupStr
17-
version = "${jacksonVersion}-beta7"
19+
version = "${jacksonVersion}-beta8"
1820

1921
repositories {
2022
mavenCentral()
2123
}
2224

2325
dependencies {
24-
implementation(kotlin("stdlib"))
25-
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.7.0")
26+
val kotlinVersion: String = System.getenv("KOTLIN_VERSION")?.takeIf { it.isNotEmpty() }
27+
?: libs.versions.kotlin.get()
28+
implementation("${libs.kotlin.stdlib.get()}:${kotlinVersion}")
29+
implementation(libs.kotlinx.metadata.jvm)
2630

27-
api("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
28-
api("com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}")
31+
api(libs.jackson.databind)
32+
api(libs.jackson.annotations)
2933

3034
// test libs
31-
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
32-
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.1")
33-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
34-
testImplementation("io.mockk:mockk:1.13.7")
35+
testImplementation(libs.junit.api)
36+
testImplementation(libs.junit.params)
37+
testRuntimeOnly(libs.junit.engine)
38+
testImplementation(libs.mockk)
3539

36-
testImplementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
37-
testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
40+
testImplementation(libs.jackson.xml)
41+
testImplementation(libs.jackson.jsr310)
3842
}
3943

4044
kotlin {

docs/FixedIssues.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
A list of issues that have not been resolved in `jackson-module-kotlin`, but have been or will be resolved in `kogera`.
22

33
## Fixed
4-
- [Update `KotlinModule` to override `AnnotationIntrospector.findCreatorAnnotation()` instead of `hasCreatorAnnotation()` · Issue \#200](https://github.com/FasterXML/jackson-module-kotlin/issues/200)
4+
- [Support for inline classes · Issue \#199](https://github.com/FasterXML/jackson-module-kotlin/issues/199)
55
- [Getting MismatchedInputException instead of MissingKotlinParameterException · Issue \#234](https://github.com/FasterXML/jackson-module-kotlin/issues/234)
66
- [Private getter with different return type hides property · Issue \#341](https://github.com/FasterXML/jackson-module-kotlin/issues/341)
77
- [Remove \`kotlin\-reflect\` and replace it with \`kotlinx\-metadata\-jvm\` · Issue \#450](https://github.com/FasterXML/jackson-module-kotlin/issues/450)
8-
- [Remove deprecated method in KNAI · Issue \#508](https://github.com/FasterXML/jackson-module-kotlin/issues/508)
9-
- [Support JsonKey in value class · Issue \#536](https://github.com/FasterXML/jackson-module-kotlin/issues/536)
10-
- [Type Introspection: non\-nullable field with default is reported as required · Issue \#609](https://github.com/FasterXML/jackson-module-kotlin/issues/609)
11-
- [`JsonSerializer` is enabled when the value is an Object type with non\-null value and the property definition is nullable. · Issue \#618](https://github.com/FasterXML/jackson-module-kotlin/issues/618)
12-
- [About the problem that property names in \`Jackson\` and definitions in \`Kotlin\` are sometimes different\. · Issue \#630](https://github.com/FasterXML/jackson-module-kotlin/issues/630)
8+
- [Supports deserialization of \`value class\` \(\`inline class\`\)\. · Issue \#650](https://github.com/FasterXML/jackson-module-kotlin/issues/650)
139
- [Annotation given to constructor parameters containing \`value class\` as argument does not work · Issue \#651](https://github.com/FasterXML/jackson-module-kotlin/issues/651)
1410
- [How to deserialize a kotlin\.ranges\.ClosedRange<T> with Jackson · Issue \#663](https://github.com/FasterXML/jackson-module-kotlin/issues/663)
1511
- [There are cases where \`isRequired\` specifications are not properly merged\. · Issue \#668](https://github.com/FasterXML/jackson-module-kotlin/issues/668)
1612

17-
## Maybe fixed(verification required)
18-
- [@JsonProperty is ignored on data class properties with names starting with "is" · Issue \#237](https://github.com/FasterXML/jackson-module-kotlin/issues/237)
19-
2013
## Want to fix
21-
- [Support for inline classes · Issue \#199](https://github.com/FasterXML/jackson-module-kotlin/issues/199)
2214
- [There are some problems with KNAI\.hasCreatorAnnotation · Issue \#547](https://github.com/FasterXML/jackson-module-kotlin/issues/547)
2315
- [This module shouldn't bring kotlin\-reflect 1\.5 as a transitive dependency · Issue \#566](https://github.com/FasterXML/jackson-module-kotlin/issues/566)
24-
- [ReflectionCache takes a lot of memory · Issue \#584](https://github.com/FasterXML/jackson-module-kotlin/issues/584)
25-
- [Supports deserialization of \`value class\` \(\`inline class\`\)\. · Issue \#650](https://github.com/FasterXML/jackson-module-kotlin/issues/650)

gradle/libs.versions.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[versions]
2+
kotlin = "1.8.22" # Mainly for CI, it can be rewritten by environment variable.
3+
jackson = "2.16.0"
4+
5+
# test libs
6+
junit = "5.10.1"
7+
8+
[libraries]
9+
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib" }
10+
kotlinx-metadata-jvm = "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.7.0"
11+
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
12+
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
13+
14+
# test libs
15+
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
16+
junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" }
17+
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
18+
mockk = "io.mockk:mockk:1.13.7"
19+
jackson-xml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml", version.ref = "jackson" }
20+
jackson-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" }
21+
22+
[plugins]
23+
kotlinter = { id = "org.jmailen.kotlinter", version = "3.16.0" }

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/InternalCommons.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.github.projectmapk.jackson.module.kogera
22

33
import com.fasterxml.jackson.annotation.JsonCreator
4-
import kotlinx.metadata.Flag
54
import kotlinx.metadata.KmClassifier
65
import kotlinx.metadata.KmType
76
import kotlinx.metadata.KmValueParameter
@@ -83,8 +82,6 @@ internal fun String.reconstructClass(): Class<*> {
8382
internal fun KmType.reconstructClassOrNull(): Class<*>? = (classifier as? KmClassifier.Class)
8483
?.let { kotlin.runCatching { it.name.reconstructClass() }.getOrNull() }
8584

86-
internal fun KmType.isNullable(): Boolean = Flag.Type.IS_NULLABLE(this.flags)
87-
8885
internal fun AnnotatedElement.hasCreatorAnnotation(): Boolean = getAnnotation(JsonCreator::class.java)
8986
?.let { it.mode != JsonCreator.Mode.DISABLED }
9087
?: false

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/JmClass.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ internal sealed interface JmClass {
7575
companionClass.getAnnotation(Metadata::class.java)!!.accept(this)
7676
}
7777

78-
override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = KmFunction(flags, name)
78+
override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = KmFunction(flags, name)
7979
.apply { functions.add(this) }
8080
}
8181

@@ -117,7 +117,7 @@ private class JmClassImpl(
117117
private val allPropsMap: MutableMap<String, KmProperty> = mutableMapOf()
118118

119119
// Defined as non-lazy because it is always read in both serialization and deserialization
120-
final override val properties: List<KmProperty>
120+
override val properties: List<KmProperty>
121121

122122
private var companionPropName: String? = null
123123
override var flags: Flags = flagsOf()
@@ -166,7 +166,7 @@ private class JmClassImpl(
166166

167167
// Constructors always have the same name, so only desc is compared
168168
return constructors.find {
169-
val targetDesc = it.signature?.desc
169+
val targetDesc = it.signature?.descriptor
170170
targetDesc == desc || targetDesc == valueDesc
171171
}
172172
}

0 commit comments

Comments
 (0)