/**kotlinx.serializaton
 *
 */
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json

@Serializable
data class Data(
    val id: Int,
    @SerialName("user_name") // 2
    val name: String = "hoge",
    @SerialName("mail_address")
    val mailAddress: String? = "" // 3
)

@Serializable
data class ProjectX(val name: String, val language: String)

fun main(){
    val data1 = ProjectX("kotlinx.serialization", "Kotlin")
    println(Json.encodeToString(data1))


    val data2 = Json.decodeFromString<ProjectX>("""
        {"name":"kotlinx.serialization","language":"Kotlin"}
    """)
    println(data2)
}