kotlinx-serialization-mapper

A Kotlinx Serialization Extension for mapping between json objects and kotlin maps

License

License

Categories

Categories

Kotlin Languages Serialization Data Data Formats
GroupId

GroupId

tz.co.asoft
ArtifactId

ArtifactId

kotlinx-serialization-mapper-android
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

aar
Description

Description

kotlinx-serialization-mapper
A Kotlinx Serialization Extension for mapping between json objects and kotlin maps
Project URL

Project URL

https://github.com/aSoft-Ltd/kotlinx-serialization-mapper
Source Code Management

Source Code Management

https://github.com/aSoft-Ltd/kotlinx-serialization-mapper

Download kotlinx-serialization-mapper-android

How to add to project

<!-- https://jarcasting.com/artifacts/tz.co.asoft/kotlinx-serialization-mapper-android/ -->
<dependency>
    <groupId>tz.co.asoft</groupId>
    <artifactId>kotlinx-serialization-mapper-android</artifactId>
    <version>0.0.5</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/tz.co.asoft/kotlinx-serialization-mapper-android/
implementation 'tz.co.asoft:kotlinx-serialization-mapper-android:0.0.5'
// https://jarcasting.com/artifacts/tz.co.asoft/kotlinx-serialization-mapper-android/
implementation ("tz.co.asoft:kotlinx-serialization-mapper-android:0.0.5")
'tz.co.asoft:kotlinx-serialization-mapper-android:aar:0.0.5'
<dependency org="tz.co.asoft" name="kotlinx-serialization-mapper-android" rev="0.0.5">
  <artifact name="kotlinx-serialization-mapper-android" type="aar" />
</dependency>
@Grapes(
@Grab(group='tz.co.asoft', module='kotlinx-serialization-mapper-android', version='0.0.5')
)
libraryDependencies += "tz.co.asoft" % "kotlinx-serialization-mapper-android" % "0.0.5"
[tz.co.asoft/kotlinx-serialization-mapper-android "0.0.5"]

Dependencies

compile (3)

Group / Artifact Type Version
org.jetbrains.kotlinx : kotlinx-serialization-json-jvm jar 1.0.1
org.jetbrains.kotlin : kotlin-stdlib-common jar 1.4.21
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.21

Project Modules

There are no modules declared in this project.

Kotlinx Serialization Mapper

badge badge badge badge badge

Introduction

Built on top of the famous kotlinx-serialization-json, this library helps to serialize between json maps and kotlin maps.

Samples

Getting an map from a json

val json = """
{
    "environment": "production",
    "logging": "warnings",
    "key": "SOME_TEST_KEY",
    "bool": true,
    "integer": 43,
    "double": 46.55
}
""".trimIndent()

val map = Mapper.decodeFromString(json)

val environment: String by map
val logging: String by map
val key: String by map
val bool: Boolean by map
val integer: Int by map
val double: Double by map

Setup:Gradle

Adding kotlinx-serialization-mapper as a dependency becomes as easy as just

Kotlin Multiplatform

kotlin {
    // . . .
    sourceSets {
        val commonTest by getting {
            dependencies {
                implementation("tz.co.asoft:kotlinx-serialization-mapper:+") // please use the latest version possible
            }        
        }
    }
}

Kotlin [android|jvm|js]

kotlin {
    // . . .
    dependencies {
        implementationTest("tz.co.asoft:kotlinx-serialization-mapper:+") // please use the latest version possible
        /* Or
         * You can be as specific as
         * "tz.co.asoft:kotlinx-serialization-mapper-android:+"
         * "tz.co.asoft:kotlinx-serialization-mapper-jvm:+"
         * "tz.co.asoft:kotlinx-serialization-mapper-js:+"
        */
        implementationTest("tz.co.asoft:kotlinx-serialization-mapper-android:+") // please use the latest version possible
    }
}
tz.co.asoft

asoft

Versions

Version
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1