Skip to content

Commit

Permalink
fix: Fixed the mangled filed names in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe Maas committed Oct 28, 2024
1 parent ea60a40 commit b20a846
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/openapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ kotlin {
"kotlinx.serialization.json.JsonObject"
)
}
filter { line: String ->
line.replace(
regex = Regex("(@SerialName\\(value = \\\"(\\w+)\\\"\\))"),
replacement = "@JsName(\"$2\") $1"
)
}
filter { line: String ->
line.replace(
regex = Regex("(import kotlinx\\.serialization\\.\\*)"),
replacement = "$1 \nimport kotlin.js.JsName"
)
}
}

withType<KotlinCompileCommon> {
Expand Down

0 comments on commit b20a846

Please sign in to comment.