{"id":235,"date":"2020-06-23T20:35:35","date_gmt":"2020-06-23T11:35:35","guid":{"rendered":"https:\/\/roundwide.com\/?p=235"},"modified":"2021-04-27T20:13:49","modified_gmt":"2021-04-27T11:13:49","slug":"how-to-make-json-parser-strict","status":"publish","type":"post","link":"https:\/\/roundwide.com\/ja\/how-to-make-json-parser-strict\/","title":{"rendered":"\u53b3\u683c\u306aJSON\u30d1\u30fc\u30b6\u30fc\u306e\u4f5c\u308a\u65b9"},"content":{"rendered":"\n<p>\u50d5\u306e\u4f5c\u3063\u305fJSON\u30d1\u30fc\u30b6\u30fc\u306e<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/fujieda\/DynaJson\" target=\"_blank\">DynaJson<\/a>\u306f\u3068\u3066\u3082\u53b3\u683c\u306b\u3067\u304d\u3066\u3044\u308b\u3002<a rel=\"noreferrer noopener\" href=\"https:\/\/tools.ietf.org\/html\/rfc8259\" target=\"_blank\">RFC 8259<\/a>\u306b\u6e96\u62e0\u3057\u3066\u3044\u308b\u3082\u306e\u306f\u3059\u3079\u3066\u53d7\u7406\u3059\u308b\u3057\u3001\u305d\u3046\u3067\u306a\u3044\u3082\u306e\u306f\u4e8c\u3064\u306e\u4f8b\u5916\u3092\u9664\u304d\u3059\u3079\u3066\u53d7\u7406\u3057\u306a\u3044\u3002<\/p>\n\n\n\n<p>\u53d7\u7406\u3059\u308b\u4f8b\u5916\u306f\u3001\u30b1\u30c4\u30ab\u30f3\u30de\u3068<code>02<\/code>\u3084<code>-02<\/code>\u306e\u3088\u3046\u306a0\u3067\u59cb\u307e\u308b\u6570\u5b57\u3067\u3042\u308b\u3002\u524d\u8005\u3092\u53d7\u7406\u3059\u308b\u306e\u306f\u5b9f\u7528\u6027\u306e\u305f\u3081\u3067\u3042\u308a\u3001\u5f8c\u8005\u3092\u53d7\u7406\u3059\u308b\u306e\u306fDynamicJson\u3068\u306e\u4e92\u63db\u6027\u306e\u305f\u3081\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>JSON\u306e\u6587\u6cd5\u306f\u3068\u3066\u3082\u5358\u7d14\u3060\u304c\u3001\u4e0d\u7528\u610f\u306b\u30d1\u30fc\u30b6\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u3068RFC\u306b\u6e96\u62e0\u3057\u305fJSON\u3092\u53d7\u7406\u3057\u306a\u304b\u3063\u305f\u308a\u3001\u975e\u6e96\u62e0\u306e\u3082\u306e\u3092\u30a8\u30e9\u30fc\u306b\u3067\u304d\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u3002\u30d1\u30fc\u30b6\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306e\u5730\u96f7\u30dd\u30a4\u30f3\u30c8\u306f<a href=\"http:\/\/seriot.ch\/parsing_json.php\" target=\"_blank\" rel=\"noreferrer noopener\">Parsing JSON is a Minefield<\/a>\u306b\u3088\u304f\u307e\u3068\u307e\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u305f\u3068\u3048\u3070\u3001<code>null<\/code>\u306e\u3088\u3046\u306b\u30ea\u30c6\u30e9\u30eb\u3060\u3051\u3060\u3068\u53d7\u7406\u3057\u306a\u3044\u30d1\u30fc\u30b6\u30fc\u304c\u3042\u308b\u3002<code>[[][]]<\/code>\u306e\u3088\u3046\u306a\u7a7a\u306e\u914d\u5217\u3060\u3051\u306e\u914d\u5217\u3084\u3001<code>1e0<\/code>\u306e\u3088\u3046\u306b\u6307\u6570\u90e8\u304c0\u306e\u6570\u5b57\u3092\u53d7\u7406\u3057\u306a\u3044\u3082\u306e\u3082\u3042\u308b\u3002<code>{\"a\":1,\"a\":2}<\/code>\u306e\u3088\u3046\u306b\u30ad\u30fc\u304c\u4e00\u610f\u3067\u306a\u3044\u3082\u306e\u3092\u53d7\u7406\u3057\u306a\u3044\u30d1\u30fc\u30b6\u30fc\u306f\u591a\u3044\u3002<\/p>\n\n\n\n<p>\u307b\u3068\u3093\u3069\u306e\u30d1\u30fc\u30b6\u30fc\u304c\u3001\u3055\u307e\u3056\u307e\u306a\u975e\u6e96\u62e0\u306eJSON\u3092\u53d7\u7406\u3059\u308b\u3002<code>.2<\/code>\u3084<code>-.1<\/code>\u3084<code>+1<\/code>\u306e\u3088\u3046\u306a\u6570\u5b57\u3084\u3001\u6587\u5b57\u5217\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u6587\u5b57\u304c\u76f4\u63a5\u5165\u3063\u3066\u3044\u308b\u3082\u306e\u3084\u3001<code>[0]]<\/code>\u306e\u3088\u3046\u306b\u5f8c\u308d\u306e\u3054\u307f\u304c\u3042\u308b\u3082\u306e\u306a\u3069\u3002<\/p>\n\n\n\n<p>DynaJson\u306e\u305f\u3081\u306b\u6700\u521d\u306b\u66f8\u3044\u305fJSON\u30d1\u30fc\u30b6\u30fc\u306f\u3001\u601d\u3044\u8fbc\u307f\u3068\u4e0d\u6ce8\u610f\u304b\u3089\u304b\u306a\u308a\u306e\u5730\u96f7\u3092\u8e0f\u3093\u3067\u3044\u305f\u3002\u6700\u7d42\u7684\u306b\u306f\u6e96\u62e0\u3057\u3066\u3044\u308b\u3082\u306e\u306f\u3059\u3079\u3066\u53d7\u7406\u3057\u3001\u6e96\u62e0\u3057\u306a\u3044\u3082\u306e\u306f\u3001\u5165\u529b\u306e\u7834\u640d\u3092\u691c\u51fa\u3059\u308b\u305f\u3081\u306b\u4e8c\u3064\u306e\u4f8b\u5916\u4ee5\u5916\u306f\u30a8\u30e9\u30fc\u306b\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<p>Parsing JSON is a Minefield\u306e\u8457\u8005\u306e\u4f5c\u6210\u3057\u305f<a href=\"https:\/\/github.com\/nst\/JSONTestSuite\">JSON Parsing Test Suite<\/a>\u3092\u5229\u7528\u3059\u308b\u3068\u3001\u3053\u306e\u3088\u3046\u306a\u30b3\u30fc\u30ca\u30fc\u30b1\u30fc\u30b9\u306e\u52d5\u4f5c\u78ba\u8a8d\u304c\u3067\u304d\u308b\u3002.NET\u306b\u5bfe\u5fdc\u3057\u305f6\u3064\u306eJSON\u30d1\u30fc\u30b6\u30fc\u306b\u3064\u3044\u3066\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3082\u306e\u3092<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/fujieda\/JSONTestSuite\" target=\"_blank\">GitHub<\/a>\u306b\u7f6e\u3044\u305f\u3002\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092\u793a\u3059\u3002<\/p>\n\n\n\n<div style=\"height: 600px; overflow: auto; margin-bottom: 1em;\"><img decoding=\"async\" style=\"max-width: none;\" src=\"https:\/\/roundwide.com\/wp-content\/uploads\/2020\/06\/JSONTestSuite-results.png\"><\/div>\n\n\n\n<p>\u5de6\u5074\u304c\u30c6\u30b9\u30c8\u3057\u305fJSON\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3001\u771f\u3093\u4e2d\u304c\u7d50\u679c\u3001\u53f3\u5074\u304c\u305d\u306eJSON\u3067\u3042\u308b\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u3046\u3061<code>y_<\/code>\u3067\u59cb\u307e\u308b\u306e\u306f\u53d7\u7406\u3059\u3079\u304d\u3082\u306e\u3001<code>n_<\/code>\u306f\u5374\u4e0b\u3059\u3079\u304d\u3082\u306e\u3001<code>i_<\/code>\u306f\u3069\u3061\u3089\u3067\u3082\u3088\u3044\u3082\u306e\u3002\u7d50\u679c\u306e\u8272\u306b\u3064\u3044\u3066\u306f\u5de6\u4e0a\u306e\u8aac\u660e\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<p>.NET Core 3.0\u304b\u3089\u5165\u3063\u305f<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.text.json\" target=\"_blank\" rel=\"noreferrer noopener\">System.Text.Json<\/a>\u306f\u3068\u3066\u3082\u53b3\u683c\u3067\u3042\u308a\u3001\u6e96\u62e0\u306e\u3082\u306e\u3092\u3059\u3079\u3066\u53d7\u7406\u3057\u3001\u975e\u6e96\u62e0\u306e\u3082\u306e\u3092\u3059\u3079\u3066\u30a8\u30e9\u30fc\u306b\u3059\u308b\u3002\u305f\u3060\u3057\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308c\u3070\u30b1\u30c4\u30ab\u30f3\u30de\u3092\u53d7\u7406\u3059\u308b\u3002\u3053\u306e\u4e2d\u3067\u30b1\u30c4\u30ab\u30f3\u30de\u3092\u53d7\u7406\u3057\u306a\u3044\u306e\u306f<a href=\"https:\/\/github.com\/neuecc\/Utf8Json\" target=\"_blank\" rel=\"noreferrer noopener\">Utf8Json<\/a>\u3060\u3051\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u30d1\u30fc\u30b6\u30fc\u3054\u3068\u306b\u53d7\u7406\u3059\u308b\u975e\u6e96\u62e0\u306eJSON\u306b\u7279\u5fb4\u304c\u3042\u308b\u3002<a rel=\"noreferrer noopener\" href=\"https:\/\/www.newtonsoft.com\/json\" target=\"_blank\">Json.NET<\/a>\u306f\u30ad\u30fc\u304c\u6587\u5b57\u5217\u3067\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d7\u7406\u3057\u3001Utf8Json\u306f\u672b\u5c3e\u306e\u3054\u307f\u3092\u8a31\u5bb9\u3059\u308b\u3002<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/neuecc\/DynamicJson\" target=\"_blank\">DynamicJson<\/a>\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c<code>}<\/code>\u3067\u9589\u3058\u3066\u3044\u306a\u3044\u3082\u306e\u3092\u53d7\u7406\u3059\u308b\u3002<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/kevin-montrose\/Jil\" target=\"_blank\">Jil<\/a>\u306f\u6570\u5024\u306e\u6307\u6570\u90e8\u306b\u5bdb\u5bb9\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u4e00\u756a\u4e0b\u306e\u8d64\u306b\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u306f\u300110\u4e07\u56de\u30cd\u30b9\u30c8\u3057\u305fJSON\u3092\u30d1\u30fc\u30ba\u3057\u305f\u7d50\u679c\u3067\u3042\u308b\u3002DynamicJson\u306f5\u79d2\u3067\u7d42\u308f\u3089\u305a\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u3001Jil\u3068Utf8Json\u306f\u30b9\u30bf\u30c3\u30af\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u3067\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>Json.NET\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30e1\u30e2\u30ea\u306e\u8a31\u3059\u9650\u308a\u30cd\u30b9\u30c8\u304c\u53ef\u80fd\u3067\u3042\u308b\u3002System.Text.Json\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306764\u307e\u3067\u3060\u304c\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u5909\u66f4\u53ef\u80fd\u3067\u3042\u308b\u3002DynaJson\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067512\u307e\u3067\u3060\u304c\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u5909\u66f4\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u50d5\u306e\u4f5c\u3063\u305fJSON\u30d1\u30fc\u30b6\u30fc\u306eDynaJson\u306f\u3068\u3066\u3082\u53b3\u683c\u306b\u3067\u304d\u3066\u3044\u308b\u3002RFC 8259\u306b\u6e96\u62e0\u3057\u3066\u3044\u308b\u3082\u306e\u306f\u3059\u3079\u3066\u53d7\u7406\u3059\u308b\u3057\u3001\u305d\u3046\u3067\u306a\u3044\u3082\u306e\u306f\u4e8c\u3064\u306e\u4f8b\u5916\u3092\u9664\u304d\u3059\u3079\u3066\u53d7\u7406\u3057\u306a\u3044\u3002 \u53d7\u7406\u3059\u308b\u4f8b\u5916\u306f\u3001\u30b1\u30c4\u30ab\u30f3\u30de\u306802\u3084-02\u306e\u3088 &hellip; <a href=\"https:\/\/roundwide.com\/ja\/how-to-make-json-parser-strict\/\" class=\"more-link\"><span class=\"screen-reader-text\">\"\u53b3\u683c\u306aJSON\u30d1\u30fc\u30b6\u30fc\u306e\u4f5c\u308a\u65b9\" \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"https:\/\/roundwide.com\/?p=235","footnotes":""},"categories":[10,12],"tags":[7],"class_list":["post-235","post","type-post","status-publish","format-standard","hentry","category-csharp","category-json","tag-json-net","ja"],"_links":{"self":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":28,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":415,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts\/235\/revisions\/415"}],"wp:attachment":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}