{"id":144806,"date":"2021-05-07T09:42:05","date_gmt":"2021-05-07T08:42:05","guid":{"rendered":"https:\/\/blog.jetbrains.com\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/"},"modified":"2021-05-24T17:20:52","modified_gmt":"2021-05-24T16:20:52","slug":"kotlinx-serialization-1-2-released","status":"publish","type":"kotlin","link":"https:\/\/blog.jetbrains.com\/zh-hans\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/","title":{"rendered":"kotlinx.serialization 1.2\u53d1\u5e03\uff0cJSON\u7684\u9ad8\u6027\u80fd\u89e3\u6790\uff0c\u503c\u7c7b\u7684\u652f\u6301\uff0c\u6587\u6863\u7684\u7ffb\u4fee\u7b49\u7b49"},"content":{"rendered":"<div id=\"crowdin_phrase_18731642\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>kotlinx.serialization<\/code>&nbsp;1.2\u5df2\u53d1\u5e03!\u6211\u4eec\u8de8\u5e73\u53f0\u5e8f\u5217\u5316\u5e93\u7684\u6700\u65b0\u7248\u672c\u5e26\u6765\u4e86\u591a\u4e2a\u6539\u8fdb\u2014\u2014\u4e0b\u9762\u662f\u91cd\u70b9:<\/div>\n<ul>\n<li>\n<div id=\"crowdin_phrase_18731646\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/#fast-json\">JSON\u5e8f\u5217\u5316\u901f\u5ea6\u8fdc\u8d85\u4ee5\u5f80\u3002<\/a>\u57281.2\u7248\u672c\u5c06JSON\u89e3\u6790\u4e3a\u7c7b\u578b\u5b89\u5168\u7684Kotlin\u5bf9\u8c61\u548c\u5c06Kotlin\u5bf9\u8c61\u89e3\u6790\u4e3a\u6587\u672c\u5f62\u5f0f\u65f6\uff0c\u5176\u901f\u5ea6\u662f\u4ee5\u524d\u7248\u672c\u7684\u4e24\u500d\u3002<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731648\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/#15-additions\">\u73b0\u5df2\u652f\u6301Kotlin 1.5\u7684\u7c7b\u578b\u7cfb\u7edf\u3002<\/a>\u503c\u7c7b\u548c\u65e0\u7b26\u53f7\u6570\u53ef\u4ee5\u50cf\u5176\u4ed6Kotlin\u7c7b\u4e00\u6837\u8f6c\u6362\u4e3aJSON\u5e76\u8fd4\u56de\u3002<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731650\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/#api-docs\">\u65b0\u7684API\u6587\u6863<\/a>\u8ba9\u67e5\u627e<code>kotlinx.serialization<\/code>\u63d0\u4f9b\u7684\u6240\u6709\u529f\u80fd\u66f4\u52a0\u5bb9\u6613\u3002<\/div>\n<\/li>\n<\/ul>\n<p>1.2\u7248\u8fd8\u65b0\u589e\u5bf9 <a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/#alt-names\">JSON \u5b57\u6bb5\u5019\u9009\u540d\u79f0<\/a>\u7684\u652f\u6301\uff0c\u4ee5\u53ca\u63d0\u4f9b\u4e86\u4e00\u79cd\u65b0\u7684\u5b9e\u9a8c\u65b9\u6848\uff0c\u53ef\u4ee5\u81ea\u52a8<a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/#protobuf-schemas\">\u4ece Kotlin \u7c7b\u4e2d\u751f\u6210 Protobuf \u7684 schema<\/a>\uff0c\u4e3a\u6b64\uff0c\u6211\u4eec\u671f\u5f85\u60a8\u7684\u53cd\u9988\uff01<\/p>\n<p><!--more--><\/p>\n<div id=\"crowdin_phrase_18731654\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u8ba9\u6211\u4eec\u4e00\u8d77\u63a2\u7d22\u65b0\u7248\u672c\u4e2d\u7684\u65b0\u589e\u548c\u53d8\u5316! \u5982\u679c\u60a8\u5df2\u7ecf\u60f3\u6e05\u695a\u4e86\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8df3\u5230\u4e0b\u9762\u7684\u5347\u7ea7\u8bf4\u660e\uff01<\/div>\n<p align=\"center\"><a class=\"jb-download-button\" title=\"Install\" href=\"https:\/\/blog.jetbrains.com\/kotlin\/2021\/05\/kotlinx-serialization-1-2-released\/#start-using\">\u5f00\u59cb\u4f7f\u7528 kotlinx.serialization 1.2!<\/a><\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/698I_AH8h6s\" height=\"445\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><br \/>\n<a href=\"https:\/\/www.youtube.com\/channel\/UCP7uiEZIqci43m22KDl0sNw?sub_confirmation=1\" target=\"_blank\" rel=\"noopener\">Subscribe to Kotlin YouTube!<\/a><\/p>\n<p><a name=\"fast-json\"><\/a><\/p>\n<h2>\u8fdc\u8d85\u4ee5\u5f80\u7684 JSON \u7f16\u89e3\u7801<\/h2>\n<p><code>kotlinx.serialization<\/code>\u6700\u5e38\u7528\u7684\u529f\u80fd\u662f\u5c06 Kotlin \u7c7b\u7f16\u7801\u4e3a JSON \u5b57\u7b26\u4e32\uff0c\u4ee5\u53ca\u5c06 JSON \u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a Kotlin \u7c7b\uff0c\u5e76\u4e14\u6211\u4eec\u4e00\u76f4\u5728\u52aa\u529b\u63d0\u9ad8\u5176\u6027\u80fd\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/04\/Kotlinx.serialization-1.2_2-03.png\" alt=\"Parsing JSON with kotlinx.serialization: Up to 55 percent faster\"><\/p>\n<div id=\"crowdin_phrase_18731678\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">1.2\u7248\u5f7b\u5e95\u8c03\u6574\u4e86 <code>kotlinx.serialization <\/code>\u7684\u5185\u90e8\u7ed3\u6784\uff0c\u4ece\u800c\u4f7f\u6838\u5fc3\u529f\u80fd\u7684\u6027\u80fd\u5927\u5927\u63d0\u9ad8\u3002\u6211\u4eec\u5df2\u7ecf\u91cd\u5199\u4e86 JSON \u89e3\u7801\u5668(\u8d1f\u8d23\u5c06\u6587\u672c\u8f6c\u6362\u4e3a Kotlin \u5bf9\u8c61)\uff0c\u4ee5\u53ca\u5bf9 JSON \u7f16\u7801\u5668(\u8d1f\u8d23\u5c06 Kotlin \u5bf9\u8c61\u8f6c\u6362\u4e3a\u6587\u672c) \u8fdb\u884c\u4e86\u6df1\u5ea6\u4f18\u5316\u3002<\/div>\n<p><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/04\/Kotlinx.serialization-1.2_2-02-1.png\" alt=\"Encoding JSON with kotlinx.serialization: Up to 339 percent faster\"><\/p>\n<div id=\"crowdin_phrase_18731686\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u53ea\u9700\u5347\u7ea7\u6211\u4eec\u7684\u5e93\u5230\u6700\u65b0\u7248\u672c\uff0c\u60a8\u5c31\u53ef\u4ee5\u5c06\u5e73\u5e38\u7f16\u89e3\u7801\u4efb\u52a1\u7684\u901f\u5ea6\u63d0\u9ad8\u5230<em>\u4e24\u500d<\/em>\u3002\uff08\u6b63\u5982\u60a8\u6240\u89c1\uff0c\u6211\u4eec\u7684\u4e00\u4e9b\u53d7\u65b0\u4f18\u5316\u5f71\u54cd\u7684\u5185\u90e8\u57fa\u51c6\u6d4b\u8bd5\uff0c\u751a\u81f3<em>\u8d85\u8fc7\u4e86<\/em>\u8fd9\u4e2a\u6570\u5b57(200%)\uff01\uff09<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731690\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u901a\u8fc7\u8fd9\u4e9b\u66f4\u6539\uff0c<code>kotlinx.serialization<\/code>\u8fbe\u5230(\u67d0\u4e9b\u65b9\u9762\u8d85\u8d8a)\u4e86\u5176\u4ed6\u5f00\u7bb1\u5373\u7528\u7684JSON \u5e93\u76f8\u540c\u7684\u6027\u80fd\u3002\u54ea\u6015\u662f\u6700\u7b80\u5355\u7684\u4ee3\u7801\u5757\u4e5f\u53ef\u4ee5\u4ece\u8be5\u8c03\u6574\u4e2d\u53d7\u76ca\uff1a<\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\n@Serializable\ndata class User(val name: String, val yearOfBirth: Int)\n\nfun main() {\n\/\/ Faster encoding...\nval data = User(&quot;Louis&quot;, 1901)\nval string = Json.encodeToString(data)\nprintln(string) \/\/ {&quot;name&quot;:&quot;Louis&quot;,&quot;yearOfBirth&quot;:1901}\n\n\/\/ ...and faster decoding!\nval obj = Json.decodeFromString(string)\nprintln(obj) \/\/ User(name=Louis, yearOfBirth=1901)\n}\n<\/pre>\n<div id=\"crowdin_phrase_18731700\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u8981\u611f\u53d7\u6539\u8fdb\u5e26\u6765\u7684\u660e\u663e\u53d8\u5316\uff0c\u6700\u597d\u662f\u8ba9\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\u6700\u65b0\u7684\u5e93\u5e76\u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5\u3002\u6709\u5173\u4e00\u4e9b\u7c97\u7565\u7684\u6027\u80fd\u6570\u5b57\uff0c\u60a8\u53ef\u4ee5\u67e5\u770b\u6211\u4eec\u5185\u90e8\u57fa\u51c6\u7684 <a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/pull\/1354\" target=\"_blank\" rel=\"noopener\">encoding<\/a>&nbsp;\u548c&nbsp;<a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/pull\/1343\" target=\"_blank\" rel=\"noopener\">decoding<\/a>\uff0c\u5b83\u4eec\u6bd4\u8f83\u4e86 <code>kotlinx.serialization<\/code>\u7684\u65b0\u65e7\u7248\u672c\u3002<\/div>\n<p><a name=\"15-additions\"><\/a><\/p>\n<h2>\u503c\u7c7b\u548c\u65e0\u7b26\u53f7\u6570\u5b57\u7c7b\u578b\u7684\u7a33\u5b9aJSON(\u53cd)\u5e8f\u5217\u5316<\/h2>\n<div id=\"crowdin_phrase_18731706\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">Kotlin 1.5.0\u65b0\u589e\u4e86\u4e24\u4e2a\u4ee4\u4eba\u5174\u594b\u7684\u5185\u5bb9\uff0c\u5206\u522b\u662f<a href=\"https:\/\/kotlinlang.org\/docs\/inline-classes.html\" target=\"_blank\" rel=\"noopener\">\u503c\u7c7b<\/a>\u548c<a href=\"https:\/\/kotlinlang.org\/docs\/basic-types.html#unsigned-integers\" target=\"_blank\" rel=\"noopener\">\u65e0\u7b26\u53f7\u6574\u578b<\/a>\uff0c\u800c<code>kotlinx.serialization<\/code>&nbsp;1.2\u73b0\u5728\u4e3a\u5176\u63d0\u4f9b\u4e86\u6700\u4f18\u5148\u7684JSON\u7f16\u89e3\u7801\u652f\u6301\u3002\u8ba9\u6211\u4eec\u6df1\u5165\u4e86\u89e3\u3002<\/div>\n<h3>\u5bf9\u503c\u7c7b\u7684\u652f\u6301<\/h3>\n<div id=\"crowdin_phrase_18731712\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><a href=\"https:\/\/kotlinlang.org\/docs\/inline-classes.html\" target=\"_blank\" rel=\"noopener\">\u503c\u7c7b<\/a>(\u4e4b\u524d\u79f0\u4e3a<em>\u5185\u8054\u7c7b<\/em>) \u662f\u4e00\u79cd\u4ee5\u7c7b\u578b\u5b89\u5168\u7684\u65b9\u5f0f\u5c01\u88c5\u53e6\u4e00\u79cdKotlin\u7c7b\u578b(\u4f8b\u5982\u6570\u5b57) \u800c\u53c8\u6ca1\u6709\u989d\u5916\u8fd0\u884c\u65f6\u5f00\u9500\u7684\u65b9\u6848\u3002\u8fd9\u6709\u52a9\u4e8e\u60a8\u7a0b\u5e8f\u7684\u8bed\u4e49\u548c\u5b89\u5168\uff0c\u800c\u4e0d\u4f1a\u9020\u6210\u6027\u80fd\u635f\u5931\u3002<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731716\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>kotlinx.serialization<\/code>\u5185\u7f6e\u7684JSON\u5e8f\u5217\u5316\u73b0\u5728\u53ef\u7528\u4e8e\u503c\u7c7b\u3002\u5c31\u50cf\u5176\u4ed6Kotlin\u7c7b\u4e00\u6837\uff0c\u6211\u4eec\u53ea\u9700\u7528<code>@Serializable<\/code>\u6ce8\u91ca<code>\u503c\u7c7b<\/code>\u3002<\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\n@Serializable\nvalue class Color(val rgb: Int)\n<\/pre>\n<div id=\"crowdin_phrase_18731722\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u503c\u7c7b\u76f4\u63a5\u4ee5\u5176\u57fa\u7840\u7c7b\u578b\u65b9\u5f0f\u5b58\u50a8(\u4ee5\u53ca\u5e8f\u5217\u5316)\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728\u53ef\u5e8f\u5217\u5316\u7684<code>\u6570\u636e\u7c7b<\/code>\u4e2d\u6dfb\u52a0\u7c7b\u578b\u4e3a<code>\u503c\u7c7b<\/code>\u7684\u5b57\u6bb5\uff0c\u5e76\u89c2\u5bdf\u5176\u8f93\u51fa\u6765\u4e86\u89e3\u60c5\u51b5\uff1a<\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\n@Serializable\ndata class NamedColor(val color: Color, val name: String)\n\nfun main() {\nprintln(Json.encodeToString(NamedColor(Color(0), &quot;black&quot;)))\n}\n\n\/\/ {&quot;color&quot;: 0, &quot;name&quot;: &quot;black&quot;}\n<\/pre>\n<div id=\"crowdin_phrase_18731728\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c<code>NamedColor<\/code>\u5c06<code>\u503c\u7c7b<\/code><code>Color<\/code>\u89c6\u4e3a<em>\u57fa\u7840\u7c7b\u578b<\/em>(<code>&nbsp;Int&nbsp;<\/code>)\u3002\u8fd9\u610f\u5473\u7740\u60a8\u53ef\u4ee5\u6700\u5927\u7a0b\u5ea6\u4eab\u53d7Kotlin\u4ee3\u7801\u7684\u7c7b\u578b\u5b89\u5168\u6027\uff0c\u540c\u65f6\u4ecd\u80fd\u4ece\u7c7b\u578b\u5e8f\u5217\u5316\u7684\u7b80\u4fbf\u4e2d\u5f97\u76ca\uff0c\u800c\u907f\u514d\u4e86\u4e0d\u5fc5\u8981\u7684\u88c5\u7bb1\u6216\u5d4c\u5957\u3002<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731732\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u6211\u4eec\u4ecd\u5728\u6539\u8fdb\u9488\u5bf9\u503c\u7c7b\u7684\u7f16\u5199\uff0c\u81ea\u5b9a\u4e49\u5e8f\u5217\u5316\u5668\u7684\u8bbe\u8ba1\uff0c\u5e76\u4e14\u76ee\u524d\u4ecd\u5904\u4e8e\u5b9e\u9a8c\u9636\u6bb5\u3002\u60a8\u53ef\u4ee5\u5728<a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/blob\/master\/docs\/inline-classes.md#using-inline-classes-in-your-custom-serializers\" target=\"_blank\" rel=\"noopener\">GitHub\u7684\u6587\u6863<\/a>\u4e2d\u67e5\u9605\u8be5\u4e3b\u9898\u7684\u66f4\u591a\u8d44\u6599\u3002<\/div>\n<h3>\u5bf9\u65e0\u7b26\u53f7\u6574\u578b\u7684\u652f\u6301<\/h3>\n<div id=\"crowdin_phrase_18731738\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><a href=\"https:\/\/kotlinlang.org\/docs\/basic-types.html#unsigned-integers\" target=\"_blank\" rel=\"noopener\">\u65e0\u7b26\u53f7\u6574\u578b<\/a>\u662fKotlin\u6807\u51c6\u5e93\u7684\u8865\u5145\uff0c\u4e3a<em>\u975e\u8d1f\u6570<\/em>\u63d0\u4f9b\u7c7b\u578b\u548c\u8fd0\u7b97\u3002\u968f\u7740 Kotlin 1.5.0 \u7684\u53d1\u5e03\uff0c\u4e0b\u8ff0\u65e0\u7b26\u53f7\u6570\u5b57\u7c7b\u578b\u5df2\u53ef\u7528:<\/div>\n<ul>\n<li>\n<div id=\"crowdin_phrase_18731742\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>UByte<\/code>\uff0c\u5176\u503c\u8303\u56f4\u4ece 0 \u5230 255<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731744\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>UShort<\/code>\uff0c\u5176\u503c\u8303\u56f4\u4ece 0 \u5230 65535<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731746\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>UInt<\/code>\uff0c\u5176\u503c\u8303\u56f4\u4ece 0 \u5230 2^32 \u2013 1<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731748\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>ULong<\/code>\uff0c\u5176\u503c\u8303\u56f4\u4ece 0 \u5230 2^64 \u2013 1<\/div>\n<\/li>\n<\/ul>\n<div id=\"crowdin_phrase_18731750\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u73b0\u5728<code>kotlinx.serialization<\/code>\u7684JSON\u7f16\u89e3\u7801\u5668\u76f4\u63a5\u652f\u6301\u8fd9\u4e9b\u7c7b\u578b\u3002\u5c31\u50cf\u5176\u4ed6\u6570\u5b57\u7c7b\u578b\u4e00\u6837\uff0c\u65e0\u7b26\u53f7\u6574\u578b\u4f1a\u4ee5\u5176\u7eaf\u6570\u5b57\u5f62\u5f0f(\u548c\u8c03\u7528<code>.toString<\/code>&nbsp;\u8f93\u51fa\u4e00\u81f4)\u8fdb\u884c\u5e8f\u5217\u5316\uff0c\u800c\u4e0d\u4f1a\u88ab\u622a\u65ad\uff0c\u6362\u884c\u6216\u8f6c\u6362\u4e3a\u5e26\u7b26\u53f7\u7c7b\u578b\u3002<\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\n@Serializable\nclass Counter(val counted: UByte, val description: String)\n\n@Serializable\nclass BigCounter(val counted: ULong)\n\nval counted = 239.toUByte()\nprintln(Json.encodeToString(Counter(counted, &quot;tries&quot;)))\n\/\/ {&quot;counted&quot;:239,&quot;description&quot;:&quot;tries&quot;}\n\nprintln(Json.encodeToString(BigCounter(ULong.MAX_VALUE)))\n\/\/ {&quot;counted&quot;:18446744073709551615}\n<\/pre>\n<div id=\"crowdin_phrase_18731756\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u8bf7\u6ce8\u610f\uff0cJSON \u5f53\u524d\u652f\u6301\u503c\u7c7b\u548c\u65e0\u7b26\u53f7\u6574\u578b\u3002\u5728\u5c06\u6765\u7684\u7248\u672c\u4e2d\uff0c\u6211\u4eec\u8fd8\u5c06\u76f4\u63a5\u96c6\u6210 CBOR \u548c Protobuf \u2014\u2014\u656c\u8bf7\u671f\u5f85\uff01<\/div>\n<p>\u5982\u679c\u60a8\u60f3\u7d27\u8ddf\u6700\u65b0\u7248\u672c\u7684<code>kotlinx.serialization<\/code>\u548cKotlin\u7f16\u7a0b\u8bed\u8a00\uff0c\u8bf7\u901a\u8fc7\u8be5\u535a\u5ba2\u65c1\u8fb9\u7684\u8868\u683c<em>\u8ba2\u9605Kotlin\u4ea7\u54c1\u66f4\u65b0\u8d44\u8baf<\/em>\u3002<\/p>\n<p>\u6709\u5173\u66f4\u591a<code>kotlinx.serialization<\/code>\u4e2d\u4f7f\u7528\u503c\u7c7b\u548c\u65e0\u7b26\u53f7\u7c7b\u578b\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u67e5\u770bGitHub\u4e0a\u7684<a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/blob\/master\/docs\/inline-classes.md\" target=\"_blank\" rel=\"noopener\">\u6587\u6863<\/a>\u3002<\/p>\n<p><a name=\"alt-names\"><\/a><\/p>\n<h2>JSON \u5b57\u6bb5\u7684\u652f\u6301\u5019\u9009\u540d\u79f0<\/h2>\n<div id=\"crowdin_phrase_18731766\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u6709\u65f6\u60a8\u9700\u8981\u89e3\u6790\u540d\u79f0\u4e0d\u4e00\u4f46\u610f\u4e49\u76f8\u540c\u7684JSON\u5b57\u6bb5\uff0c\u4f8b\u5982\u9700\u8981\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u3002\u901a\u8fc7\u65b0\u7684<code>@JsonNames<\/code>\u6ce8\u89e3\uff0c\u60a8\u73b0\u5728\u53ef\u4ee5\u4e3aJSON\u5b57\u6bb5\u6307\u5b9a\u5019\u9009\u540d\u79f0\uff0c\u8fd9\u4e9b\u540d\u79f0\u4f1a\u5728\u89e3\u6790\u8fc7\u7a0b\u7528\u5230\u3002<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731770\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u4e3a\u4e86\u8bf4\u660e\u8fd9\u4e00\u70b9\uff0c\u8ba9\u6211\u4eec\u770b\u4e00\u4e2a\u4f8b\u5b50\u3002\u5047\u8bbe\u670d\u52a1\u5668\u4f1a\u6839\u636e\u7248\u672c\u5411\u6211\u4eec\u8fd4\u56de\u4ee5\u4e0b\u4e24\u4e2a\u54cd\u5e94\u5176\u4e00\uff1a<\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\n{&quot;name&quot;:&quot;kotlinx.serialization&quot;}\n\/* ...or: *\/\n{&quot;title&quot;:&quot;kotlinx.serialization&quot;}\n<\/pre>\n<div id=\"crowdin_phrase_18731776\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>name<\/code>\u548c<code>title<\/code>\u7684\u610f\u4e49\u76f8\u540c\uff0c\u6211\u4eec\u5e0c\u671b\u5c06\u5b83\u4eec\u6620\u5c04\u5230Kotlin\u7c7b\u4e2d\u7684\u540c\u4e00\u5b57\u6bb5\u3002\u901a\u8fc7\u65b0\u7684<code>@JsonNames<\/code>\u6ce8\u89e3\uff0c\u6211\u4eec\u53ef\u4ee5\u6307\u5b9a<code>title<\/code>\u4e3a<code>name<\/code>\u952e\u7684\u5019\u9009\u503c:<\/div>\n<div id=\"crowdin_phrase_18731770\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\n@Serializable\ndata class Project(@JsonNames(&quot;title&quot;) val name: String)\n<\/pre>\n<p>\u8bf7\u6ce8\u610f\u4e0e<code>@SerialName<\/code>\u6ce8\u89e3\u7684\u4e0d\u540c\u5728\u4e8e\uff0c\u8fd9\u4e2a\u6ce8\u89e3\uff08&lt;0&gt;@SerialName\uff09\u5141\u8bb8\u60a8\u7f16\u89e3\u7801\u65f6<em>\u91cd\u547d\u540d\u5b57\u6bb5<\/em>\uff0c\u4f46\u4e0d\u5141\u8bb8\u60a8<em>\u6307\u5b9a\u5019\u9009\u503c<\/em>\u3002<\/p>\n<p>\u8bf7\u6ce8\u610f\u4e0e<code>@SerialName<\/code>\u6ce8\u89e3\u7684\u4e0d\u540c\u5728\u4e8e\uff0c\u8fd9\u4e2a\u6ce8\u89e3\uff08&lt;0&gt;@SerialName\uff09\u5141\u8bb8\u60a8\u7f16\u89e3\u7801\u65f6<em>\u91cd\u547d\u540d\u5b57\u6bb5<\/em>\uff0c\u4f46\u4e0d\u5141\u8bb8\u60a8<em>\u6307\u5b9a\u5019\u9009\u503c<\/em>\u3002<\/p>\n<p><a name=\"api-docs\"><\/a><\/p>\n<h2>\u65b0\u7684API\u6587\u6863<\/h2>\n<div id=\"crowdin_phrase_18731788\" class=\"crowdin_phrase crowdin_phrase_translated status_select\" title=\"\">\u4e3a\u4e86\u8ba9\u60a8\u5b66\u4e60 <code>kotlinx.serialization<\/code>\u7684\u8fc7\u7a0b\u8212\u9002\u800c\u6709\u8da3\uff0c\u6211\u4eec\u8bd5\u7740\u63d0\u4f9b\u4e86\u5927\u91cf\u53c2\u8003\u8d44\u6599\u3002\u5176\u4e00\u662fGitHub\u4e0a\u7684 <a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/blob\/master\/docs\/serialization-guide.md\" target=\"_blank\" rel=\"noopener\">Kotlin \u5e8f\u5217\u5316\u6307\u5357<\/a>\uff0c\u5f53\u4e2d\u63d0\u4f9b\u4e86\u5e93\u529f\u80fd\u7684\u6f14\u793a\uff0c\u5e76\u5305\u62ec\u5355\u72ec\u7684\u793a\u4f8b\uff0c\u4ee5\u4fbf\u60a8\u80fd\u76f4\u89c2\u5730\u4e86\u89e3\u6bcf\u4e2a\u529f\u80fd\u3002<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731792\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u53e6\u4e00\u4e2a\u662f <a href=\"https:\/\/kotlin.github.io\/kotlinx.serialization\/\" target=\"_blank\" rel=\"noopener\">kotlinx.serialization \u7684 API \u6587\u6863<\/a>\uff0c\u6211\u4eec\u5df2\u7ecf\u5bf9\u5176\u8fdb\u884c\u4e86\u5168\u9762\u4fee\u8ba2\u3002\u57fa\u4e8e Kotlin \u6587\u6863\u5f15\u64ce <a href=\"https:\/\/github.com\/Kotlin\/dokka\" target=\"_blank\" rel=\"noopener\">Dokka <\/a>\u7684\u65b0\u7248\u672c\uff0c\u65b0\u7684API \u6587\u6863\u91c7\u53d6\u4e86\u65b0\u7684\u54cd\u5e94\u5f0f\u548c\u73b0\u4ee3\u5316\u8bbe\u8ba1\uff0c\u4ee5\u53ca\u6613\u5bfc\u822a\u7684\u6807\u793a\u3002<\/div>\n<p><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/04\/image1.png\" alt=\"Example of the new API docs, showing the JsonElement documentation\"><\/p>\n<p align=\"center\"><a class=\"jb-download-button\" title=\"Install\" href=\"https:\/\/kotlin.github.io\/kotlinx.serialization\/\" target=\"_blank\" rel=\"noopener\">\u63a2\u7d22\u65b0\u7684 kotlinx.serialization API \u6587\u6863\uff01<\/a><\/p>\n<p><a name=\"protobuf-schemas\"><\/a><\/p>\n<h2>Protobuf: \u4ece Kotlin \u7c7b\u4e2d\u751f\u6210 schema(\u8bd5\u9a8c\u4e2d)<\/h2>\n<p>Protocol Buffers(Protobuf) \u662fGoogle\u521b\u5efa\u7684\u4e8c\u8fdb\u5236\u5e8f\u5217\u5316\u6570\u636e\u7ed3\u6784\u3002 \u4f5c\u4e3a\u4e8c\u8fdb\u5236\u683c\u5f0f\uff0c\u5b83\u6bd4JSON\u6216XML\u66f4\u8282\u7701\u7a7a\u95f4\uff0c\u540c\u65f6\u5176\u7ed3\u6784\u4e0e\u8bed\u8a00\u65e0\u5173\uff0c\u60a8\u53ef\u4ee5\u5c06\u5176\u7528\u4e8e\u5e94\u7528\u7a0b\u5e8f\u5230\u5e94\u7528\u7a0b\u5e8f\u95f4\u7684\u901a\u4fe1\u3002<\/p>\n<div id=\"crowdin_phrase_18731812\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u501f\u52a9<code>kotlinx.serialization<\/code>\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<em>\u5b9e\u9a8c\u4e2d\u7684<\/em>\u7a33\u5b9a<a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/blob\/master\/docs\/formats.md#protobuf-experimental\" target=\"_blank\" rel=\"noopener\">\u591a\u5e73\u53f0 Protobuf \u5e8f\u5217\u5316<\/a>(\u4f7f\u7528 <a href=\"https:\/\/developers.google.com\/protocol-buffers\/docs\/proto\" target=\"_blank\" rel=\"noopener\">proto2 \u8bed\u4e49<\/a>)\u3002\u4e0e\u5176\u4ed6\u683c\u5f0f\u4e00\u6837\uff0c\u7528<code>@Serializable<\/code>\u6ce8\u89e3\u60a8\u7684\u7c7b\uff0c\u5e76\u8c03\u7528\u5185\u7f6e\u7684<code>encode<\/code>\/<code>decode<\/code>\u65b9\u6cd5\uff1a<\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\n@Serializable\ndata class Project(val name: String, val language: String)\n\nfun main() {\nval data = Project(&quot;kotlinx.serialization&quot;, &quot;Kotlin&quot;)\nval bytes = ProtoBuf.encodeToByteArray(data)\nprintln(bytes.toAsciiHexString())\nval obj = ProtoBuf.decodeFromByteArray(bytes)\nprintln(obj)\n}\n<\/pre>\n<p>\u5c06\u60a8\u7684Kotlin\u7c7b\u4f5c\u4e3a<em>\u660e\u786e\u7684\u6765\u6e90<\/em>(\u4ee5\u53ca\u60a8\u53ef\u80fd\u7528\u5230\u7684<a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/blob\/master\/docs\/formats.md#protobuf-experimental\" target=\"_blank\" rel=\"noopener\">\u5b9a\u5236\u5316<\/a>)\uff0c<code>&nbsp;kotlinx.serialization&nbsp;<\/code>\u80fd\u591f\u63a8\u65ad\u51fa\u6570\u636e\u4e8c\u8fdb\u5236\u7684schema\uff0c\u8ba9Protobuf\u5728<em>\u591a\u4e2aKotlin\u5e94\u7528\u7a0b\u5e8f<\/em>\u4e4b\u95f4\u7684\u901a\u4fe1\u7b80\u6d01\u4e14\u65b9\u4fbf\u3002<\/p>\n<div id=\"crowdin_phrase_18731820\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\"><code>kotlinx.serialization<\/code>&nbsp;1.2\u73b0\u5728\u8fd8\u5305\u542b\u8bd5\u9a8c\u6027\u8d28\u7684\u7528\u4e8e<em>Protocol Buffers\u7684schema\u751f\u6210\u5668<\/em>\u3002\u5b83\u5141\u8bb8\u60a8\u4eceKotlin\u6570\u636e\u7c7b\u751f\u6210<code>.proto<\/code>\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u53c8\u53ef\u7528\u4e8e\u751f\u6210\u5176\u4ed6\u8bed\u8a00\uff08\u5305\u62ecPython\uff0cC ++\u548cTypeScript\uff09\u7684\u4f20\u8f93schema\u5f62\u5f0f\u3002<\/div>\n<p>\u6709\u5173\u5f00\u59cb\u4f7f\u7528\u65b0\u7684 schema \u751f\u6210\u5668\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605<a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/blob\/master\/docs\/formats.md#protobuf-experimental\" target=\"_blank\" rel=\"noopener\">\u6587\u6863<\/a>\u4e2d\u7684\u76f8\u5e94\u8bf4\u660e\u3002<\/p>\n<div id=\"crowdin_phrase_18731826\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u4e00\u65e6\u751f\u6210<code>.proto<\/code>\u6587\u4ef6\u540e\uff0c\u60a8\u53ef\u4ee5\u5c06\u5176\u5b58\u50a8\u5728\u4ed3\u5e93\u4e2d\uff0c\u5e76\u901a\u8fc7\u5b83\u6765\u751f\u6210Kotlin\u7c7b\u5728\u5176\u4ed6\u8bed\u8a00\u7684\u8868\u793a\u5f62\u5f0f\u3002\u6211\u4eec\u5e0c\u671b\u80fd\u8ba9\u60a8\u66f4\u8f7b\u677e\u5730\u5c06<code>kotlinx.serialization<\/code>\u96c6\u6210\u7684Protobuf\u5e94\u7528\u5230<em>\u591a\u8bed\u8a00\u5e94\u7528\u7a0b\u5e8f<\/em>\u4e2d\uff0c\u800c\u65e0\u9700\u4e27\u5931\u5728Kotlin\u6e90\u7801\u4e2d\u76f4\u63a5\u7ba1\u7406schemas\u7684\u4fbf\u5229\u3002<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731830\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u56e0\u4e3a\u8fd9\u662f Protobuf schema \u751f\u6210\u5668\u7684<em>\u9996\u4e2a\u8fed\u4ee3<\/em>\uff0c\u6240\u4ee5\u6211\u4eec\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u8d56\u60a8\u7684\u53cd\u9988\u3002\u8bf7\u5c1d\u8bd5\u4e00\u4e0b\uff0c\u5e76\u901a\u8fc7 <a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/issues\" target=\"_blank\" rel=\"noopener\">GitHub \u95ee\u9898\u8ddf\u8e2a\u5668<\/a>\u544a\u77e5\u6211\u4eec\u60a8\u7684\u7528\u4f8b\uff0c\u5982\u4f55\u7ba1\u7406\u5b9e\u4f53\u7c7b\u548c<code>.proto<\/code>\u6587\u4ef6\uff0c\u4ee5\u53ca\u9047\u5230\u7684\u6240\u6709\u95ee\u9898\u548c\u671f\u5f85\u7684\u529f\u80fd \u3002<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731834\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u4f7f\u7528 schema \u751f\u6210\u5668\u65f6\uff0c\u8bf7\u7262\u8bb0\u6709\u4e00\u4e9b\u9650\u5236\u3002\u6839\u636e\u7ecf\u9a8c\uff0c\u5982\u679c\u53ef\u4ee5\u901a\u8fc7<code>kotlinx.serialization<\/code>\u7684 protobuf \u5b9e\u73b0\u6765\u5e8f\u5217\u5316 Kotlin \u7c7b\uff0c\u5219 schema \u751f\u6210\u5668\u540c\u6837\u652f\u6301\u5b83\u3002\u8fd9\u4e5f\u610f\u5473\u7740<a href=\"https:\/\/kotlin.github.io\/kotlinx.serialization\/kotlinx-serialization-protobuf\/kotlinx-serialization-protobuf\/kotlinx.serialization.protobuf\/-proto-buf\/index.html\" target=\"_blank\" rel=\"noopener\">\u9650\u5236<\/a>\u540c\u6837\u9002\u7528\u3002\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/div>\n<ul>\n<li>\n<div id=\"crowdin_phrase_18731842\" class=\"crowdin_phrase crowdin_phrase_translated\" title=\"\">Kotlin\u7684<em>\u7c7b\u548c\u5c5e\u6027\u540d<\/em>\u9700\u8981\u7b26\u5408<a href=\"https:\/\/developers.google.com\/protocol-buffers\/docs\/reference\/proto2-spec\" target=\"_blank\" rel=\"noopener\">protobuf\u89c4\u8303<\/a>\uff0c\u5e76\u4e14\u4e0d\u5f97\u5305\u542b\u975e\u6cd5\u5b57\u7b26\u3002<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731844\" class=\"crowdin_phrase crowdin_phrase_translated\" title=\"\">Kotlin\u7684<em>\u53ef\u7a7a\u6027<\/em>\u6ca1\u6709\u53cd\u6620\u5728schema\u4e2d(\u56e0\u4e3aproto2\u6ca1\u6709\u8bed\u4e49)\u3002\u6839\u636eKotlin\u7684\u5c5e\u6027\u662f\u5426\u5b9a\u4e49\u4e86<em>\u9ed8\u8ba4\u503c<\/em>\uff0c\u4f7f\u7528protocol buffers\u63d0\u4f9b\u7684<em>\u53ef\u9009\u5b57\u6bb5<\/em>\u3002<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731848\" class=\"crowdin_phrase crowdin_phrase_translated\" title=\"\">Kotlin<em>\u9ed8\u8ba4\u503c<\/em>\u672a\u5305\u542b\u5728schema\u4e2d\u3002(\u8fd9\u610f\u5473\u7740\u60a8\u5fc5\u987b\u786e\u4fdd\u4e0d\u540c\u8bed\u8a00\u5b9e\u73b0\u4e2d\u9ed8\u8ba4\u503c\u8bbe\u7f6e\u7684\u4e00\u81f4\u6027\u3002)<\/div>\n<\/li>\n<\/ul>\n<p><a name=\"start-using\"><\/a><\/p>\n<h2>\u5f00\u59cb\u4f7f\u7528 kotlinx.serialization 1.2!<\/h2>\n<div id=\"crowdin_phrase_18731854\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u8bf4\u660e\u5230\u6b64\u7ed3\u675f! \u5982\u679c\u60a8\u51c6\u5907<em>\u4eab\u53d7\u66f4\u5feb\u7684JSON\u7f16\u89e3\u7801\uff0c\u652f\u6301Kotlin 1.5\u6dfb\u52a0\u7684\u7c7b\u578b\u7cfb\u7edf\uff0c\u751fProtobuf schema\u6210\u7b49<\/em>\uff0c\u90a3\u4e48\u5c31\u8be5\u5347\u7ea7\u4e86\uff01<\/div>\n<div title=\"\"><\/div>\n<div id=\"crowdin_phrase_18731858\" class=\"crowdin_phrase crowdin_phrase_approved\" title=\"\">\u5982\u679c\u60a8\u5df2\u7ecf\u5728\u4f7f\u7528<code>kotlinx.serialization<\/code>\u4e86\uff0c\u90a3\u4e48\u5f88\u5feb\u6377\u5c31\u80fd\u5347\u7ea7\u52301.2\u7248\u672c(\u800c\u5982\u679c\u60a8\u4ee5\u524d\u6ca1\u6709\u5c1d\u8bd5\u8fc7<code>kotlinx.serialization<\/code>\uff0c\u90a3\u4e48\u73b0\u5728\u5f00\u59cb\u662f\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff01)\u3002\u9996\u5148\uff0c\u66f4\u65b0\u60a8<code>build.gradle.kts<\/code>\u6587\u4ef6\u4e2d\u7684<code>plugins<\/code>\u5757\uff1a<\/div>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\nplugins {\nkotlin(&quot;jvm&quot;) version &quot;1.5.0&quot; \/\/ or kotlin(&quot;multiplatform&quot;) or any other kotlin plugin\nkotlin(&quot;plugin.serialization&quot;) version &quot;1.5.0&quot;\n}\n<\/pre>\n<p>\u7136\u540e\uff0c\u66f4\u65b0\u60a8\u7684<code>dependencies<\/code>\u548c\u8fd0\u884c\u65f6\u5e93\uff0c\u5305\u62ec\u60a8\u8981\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u7684\u683c\u5f0f\uff1a<\/p>\n<pre class=\"kotlin-code\" data-highlight-only=\"true\" theme=\"idea\" indent=\"4\" style=\"visibility: hidden; padding: 36px 0;\">\ndependencies {\nimplementation(&quot;org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1&quot;)\nimplementation(&quot;org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.2.1&quot;)\n\/\/ . . .\n}\n<\/pre>\n<h2>\u66f4\u591a\u7684\u89c2\u770b\u53ca\u9605\u8bfb\u6750\u6599<\/h2>\n<ul>\n<li><a href=\"https:\/\/youtu.be\/698I_AH8h6s\" target=\"_blank\" rel=\"noopener\">kotlinx.serialization 1.2 \u89c6\u9891<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/\" target=\"_blank\" rel=\"noopener\">GitHubsh \u4e0a\u7684\u5e93<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/blob\/master\/docs\/serialization-guide.md\" target=\"_blank\" rel=\"noopener\">kotlinx.serialization \u6307\u5357<\/a><\/li>\n<li><a href=\"https:\/\/kotlin.github.io\/kotlinx.serialization\/\" target=\"_blank\" rel=\"noopener\">API \u6587\u6863<\/a><\/li>\n<li><a href=\"https:\/\/blog.jetbrains.com\/zh-hans\/kotlin\/2021\/05\/kotlin-1-5-0-released\/\">Kotlin 1.5.0 \u53d1\u5e03\u535a\u6587<\/a><\/li>\n<\/ul>\n<h3>\u5982\u679c\u60a8\u9047\u5230\u4efb\u4f55\u95ee\u9898<\/h3>\n<ul>\n<li>\n<div id=\"crowdin_phrase_18731898\" class=\"crowdin_phrase crowdin_phrase_translated\" title=\"\">\u5411<a href=\"https:\/\/github.com\/Kotlin\/kotlinx.serialization\/issues\" target=\"_blank\" rel=\"noopener\">GitHub\u95ee\u9898\u8ddf\u8e2a\u5668<\/a>\u62a5\u544a\u95ee\u9898\u3002<\/div>\n<\/li>\n<li>\n<div id=\"crowdin_phrase_18731900\" class=\"crowdin_phrase crowdin_phrase_translated\" title=\"\">\u5728Kotlin Slack\u4e0a\u7684#serialization\u9891\u9053\u4e2d\u5bfb\u6c42\u5e2e\u52a9(<a href=\"https:\/\/surveys.jetbrains.com\/s3\/kotlin-slack-sign-up\" target=\"_blank\" rel=\"noopener\">\u83b7\u5f97\u9080\u8bf7<\/a>)\u3002<\/div>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.youtube.com\/channel\/UCP7uiEZIqci43m22KDl0sNw?sub_confirmation=1\" target=\"_blank\" rel=\"noopener\">\u8ba2\u9605 Kotlin \u7684 YouTube!<\/a>&nbsp;Happy (de)serializing!<\/p>\n<div style=\"background-color: #f1f6fe; margin-bottom: 2px; padding: 4px; margin-right: 0%; text-align: left; min-height: px;\">\n\u7279\u522b\u611f\u8c22\u7531\u6765\u81ea Kotlin \u793e\u533a\u7684 <strong>\u9ec4\u667a\u806a (pye52)<\/strong> \u4e3a\u672c\u7bc7\u535a\u6587\u63d0\u4f9b\u4e2d\u6587\u8bd1\u6587\u3002<\/div>\n","protected":false},"author":814,"featured_media":137325,"comment_status":"closed","ping_status":"closed","template":"","categories":[909],"tags":[671],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/144806"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/kotlin"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/814"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=144806"}],"version-history":[{"count":6,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/144806\/revisions"}],"predecessor-version":[{"id":149253,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/144806\/revisions\/149253"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/137325"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=144806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=144806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=144806"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=144806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}