FasterXML / FasterXML/jackson-module-kotlin
Classes with properties from both constructor and fields are not alphabetically sorted with @JsonPropertyOrder
Open
has-test-case
- Dominant language
- Kotlin
- Stars
- 1.2k
- Forks
- 187
- Avg merge
- 9h 48m
- Merged PRs (30d)
- 16
Description
With the following data class:
```kotlin
import com.fasterxml.jackson.annotation.JsonPropertyOrder
@JsonPropertyOrder(alphabetic=true)
data class Object(val a: String, val c: Int) {
val b = false
}
```
and the following main function:
```kotlin
fun main(args: Array) {
println(ObjectMapper().registerModule(KotlinModule()).writeValueAsString(Object("a", 1)))
}
```
I get the following output:
```
{"a":"a","c":1,"b":false}
```
i.e. constructor parameters first, then fields. I'd expect all properties to be alphabetically sorted.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.