Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Extending kotlinx.serialization functionality w...
Search
Karin-Aleksandra Monoid
June 08, 2022
Programming
0
110
Extending kotlinx.serialization functionality with Arrow Meta (Joker 2021/KotlinDevDay 2022)
Karin-Aleksandra Monoid
June 08, 2022
Tweet
Share
More Decks by Karin-Aleksandra Monoid
See All by Karin-Aleksandra Monoid
Treasure.map(): Functional programming in JVM-based languages
paranoidmonoid
0
320
Extending kotlinx.serialization functionality with Arrow Meta
paranoidmonoid
0
110
Functional Kotlin with Arrow (jLove 2021)
paranoidmonoid
1
220
Hands-on Arrow
paranoidmonoid
1
160
Make Tech Slides Work
paranoidmonoid
0
580
"Fun" as in "funeral": full-stack development using Kotlin JS
paranoidmonoid
0
110
Other Decks in Programming
See All in Programming
速いWebフレームワークを作る
yusukebe
5
1.7k
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
AIでLINEスタンプを作ってみた
eycjur
1
230
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
740
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
1.6k
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
AI時代のUIはどこへ行く?
yusukebe
18
8.8k
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
luccafort
PRO
1
110
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
アセットのコンパイルについて
ojun9
0
120
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
850
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Docker and Python
trallard
45
3.6k
The Invisible Side of Design
smashingmag
301
51k
Making Projects Easy
brettharned
117
6.4k
Scaling GitHub
holman
463
140k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
112
20k
Being A Developer After 40
akosma
90
590k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Transcript
1 Extending kotlinx.serialization functionality with Arrow Meta Karin-Aleksandra Monoid Kotlin
Dev Day 2022
2 • Senior Software Engineer at CircleCI • Background in
Kotlin & Scala (both front and backend) • Living in Germany with two cats • GDE in Kotlin About
3 • Senior Software Engineer at CircleCI • Background in
Kotlin & Scala (both front and backend) • Living in Germany with two cats • GDE in Kotlin About
4 Agenda Why? What is Arrow Meta? Sample project Showtime!
5 Project Stack • Just backend with Ktor + Arrow
• Jackson was kind of "default" • Smooth but not Kotlin-first
6 kotlinx.serialization – pros 🚀 • Kotlin-first • No boilerplate
for sealed classes
7 kotlinx.serialization – cons • Not a lot of serializers
out of the box • No global naming strategy
8 Global Naming Strategy UPPER_SNAKE_CASE -> camelCase USER_NAME -> userName
9 Jackson: Object Mapper val objectMapperUpperSnakeCase = jacksonObjectMapper().apply { propertyNamingStrategy
= PropertyNamingStrategies.UPPER_SNAKE_CASE }
10 Issue #33 https://github.com/Kotlin/kotlinx.serialization/issues/33
11 Global Naming Strategy @SerialName("USER_NAME") val userName: String
12 What is Arrow Meta?
13 “Functional companion to Kotlin's Compiler” What is Arrow Meta?
Image source: https://arrow-kt.io/
14 GIF source: https://github.com/arrow-kt/arrow-meta
15 • Already using other part of Arrow for FP
Why Arrow Meta?
16 Why Arrow Meta? • More functionality than KSP/KAPT •
Easier than kotlinc
17 Sample Project
18 https://bit.ly/3C2lHGp Link to repo
19 • various animals (actually, only cats and dogs) •
various sources (= 3rd party services) • various standards of documentation (in JSON format with different naming policies) Setting: a Zoo
20 Live coding time
21 • It works • ??? • Requires more knowledge
than expected • KSP is preferable if it fits Thoughts
22 Resources • https://meta.arrow-kt.io/ • https://github.com/arrow-kt/arrow-meta-examples • https://paranoidmonoid.github.io/articles/Kotlin%20and%20frien ds/Naming%20strategy%20plugin