alef 0.58.3

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Marshals the receiver and the parameter object across the value-method JNI
// boundary. The naming strategy, null handling, and unknown-property tolerance
// must match the module facade's mapper — both feed the same Rust serde types.
private val {{ name }} = com.fasterxml.jackson.module.kotlin.jacksonObjectMapper()
    .registerModule(com.fasterxml.jackson.datatype.jdk8.Jdk8Module())
    .registerModule(
        com.fasterxml.jackson.module.kotlin.KotlinModule.Builder()
            .configure(com.fasterxml.jackson.module.kotlin.KotlinFeature.NullIsSameAsDefault, true)
            .configure(com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyCollection, true)
            .configure(com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyMap, true)
            .build(),
    )
    .setPropertyNamingStrategy(com.fasterxml.jackson.databind.PropertyNamingStrategies.SNAKE_CASE)
    .setSerializationInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
    .configure(com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)