[{"data":1,"prerenderedAt":730},["ShallowReactive",2],{"post-/blog/json-patch":3,"related-/blog/json-patch":198},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"category":11,"keywords":12,"body":16,"_type":192,"_id":193,"_source":194,"_file":195,"_stem":196,"_extension":197},"/blog/json-patch","blog",false,"","JSON Patch 操作详解","JSON Patch (RFC 6902) 用一组操作描述 JSON 变更，支持 add/remove/replace/move/copy/test。","2026-08-19","进阶",[13,14,15],"json patch","rfc 6902","json变更",{"type":17,"children":18,"toc":184},"root",[19,27,33,39,44,49,54,59,141,146,168,173,178],{"type":20,"tag":21,"props":22,"children":24},"element","h1",{"id":23},"json-patch-操作详解",[25],{"type":26,"value":8},"text",{"type":20,"tag":28,"props":29,"children":30},"p",{},[31],{"type":26,"value":32},"JSON Patch 是 RFC 6902 定义的用操作数组描述 JSON 变更的格式，常用于增量更新与协同。",{"type":20,"tag":34,"props":35,"children":37},"h2",{"id":36},"操作类型",[38],{"type":26,"value":36},{"type":20,"tag":28,"props":40,"children":41},{},[42],{"type":26,"value":43},"add 添加、remove 删除、replace 替换、move 移动、copy 复制、test 测试。",{"type":20,"tag":34,"props":45,"children":47},{"id":46},"使用场景",[48],{"type":26,"value":46},{"type":20,"tag":28,"props":50,"children":51},{},[52],{"type":26,"value":53},"API 增量更新、协同编辑、版本差异表达。",{"type":20,"tag":34,"props":55,"children":57},{"id":56},"代码示例",[58],{"type":26,"value":56},{"type":20,"tag":60,"props":61,"children":65},"pre",{"className":62,"code":63,"language":64,"meta":7,"style":7},"language-json shiki shiki-themes github-dark","[{\"op\":\"replace\",\"path\":\"/name\",\"value\":\"新值\"}]\n","json",[66],{"type":20,"tag":67,"props":68,"children":69},"code",{"__ignoreMap":7},[70],{"type":20,"tag":71,"props":72,"children":75},"span",{"class":73,"line":74},"line",1,[76,82,88,93,99,104,109,113,118,122,127,131,136],{"type":20,"tag":71,"props":77,"children":79},{"style":78},"--shiki-default:#E1E4E8",[80],{"type":26,"value":81},"[{",{"type":20,"tag":71,"props":83,"children":85},{"style":84},"--shiki-default:#79B8FF",[86],{"type":26,"value":87},"\"op\"",{"type":20,"tag":71,"props":89,"children":90},{"style":78},[91],{"type":26,"value":92},":",{"type":20,"tag":71,"props":94,"children":96},{"style":95},"--shiki-default:#9ECBFF",[97],{"type":26,"value":98},"\"replace\"",{"type":20,"tag":71,"props":100,"children":101},{"style":78},[102],{"type":26,"value":103},",",{"type":20,"tag":71,"props":105,"children":106},{"style":84},[107],{"type":26,"value":108},"\"path\"",{"type":20,"tag":71,"props":110,"children":111},{"style":78},[112],{"type":26,"value":92},{"type":20,"tag":71,"props":114,"children":115},{"style":95},[116],{"type":26,"value":117},"\"/name\"",{"type":20,"tag":71,"props":119,"children":120},{"style":78},[121],{"type":26,"value":103},{"type":20,"tag":71,"props":123,"children":124},{"style":84},[125],{"type":26,"value":126},"\"value\"",{"type":20,"tag":71,"props":128,"children":129},{"style":78},[130],{"type":26,"value":92},{"type":20,"tag":71,"props":132,"children":133},{"style":95},[134],{"type":26,"value":135},"\"新值\"",{"type":20,"tag":71,"props":137,"children":138},{"style":78},[139],{"type":26,"value":140},"}]\n",{"type":20,"tag":34,"props":142,"children":144},{"id":143},"推荐在线工具",[145],{"type":26,"value":143},{"type":20,"tag":147,"props":148,"children":149},"ul",{},[150,160],{"type":20,"tag":151,"props":152,"children":153},"li",{},[154],{"type":20,"tag":155,"props":156,"children":158},"a",{"href":157},"/diff",[159],{"type":26,"value":157},{"type":20,"tag":151,"props":161,"children":162},{},[163],{"type":20,"tag":155,"props":164,"children":166},{"href":165},"/format",[167],{"type":26,"value":165},{"type":20,"tag":34,"props":169,"children":171},{"id":170},"小结",[172],{"type":26,"value":170},{"type":20,"tag":28,"props":174,"children":175},{},[176],{"type":26,"value":177},"JSON Patch (RFC 6902) 用一组操作描述 JSON 变更，支持 add/remove/replace/move/copy/test。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":180,"children":181},"style",{},[182],{"type":26,"value":183},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":185,"depth":185,"links":186},2,[187,188,189,190,191],{"id":36,"depth":185,"text":36},{"id":46,"depth":185,"text":46},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"markdown","content:blog:json-patch.md","content","blog/json-patch.md","blog/json-patch","md",[199,380,502,625],{"_path":200,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":201,"description":202,"date":10,"category":11,"keywords":203,"body":207,"_type":192,"_id":377,"_source":194,"_file":378,"_stem":379,"_extension":197},"/blog/json-api-spec","JSON:API 规范指南","JSON:API 是 RESTful API 的数据响应规范，统一资源、关系、分页、错误格式。",[204,205,206],"json:api","json api规范","restful",{"type":17,"children":208,"toc":370},[209,214,219,224,229,234,239,243,335,339,357,361,366],{"type":20,"tag":21,"props":210,"children":212},{"id":211},"jsonapi-规范指南",[213],{"type":26,"value":201},{"type":20,"tag":28,"props":215,"children":216},{},[217],{"type":26,"value":218},"JSON:API 是一套构建 RESTful API 数据响应的规范，统一了资源对象、关系、分页与错误的 JSON 结构。",{"type":20,"tag":34,"props":220,"children":222},{"id":221},"核心约定",[223],{"type":26,"value":221},{"type":20,"tag":28,"props":225,"children":226},{},[227],{"type":26,"value":228},"data 包含资源数组或单对象，relationships 描述关联，included 包含关联资源，meta 存元信息。",{"type":20,"tag":34,"props":230,"children":232},{"id":231},"优势",[233],{"type":26,"value":231},{"type":20,"tag":28,"props":235,"children":236},{},[237],{"type":26,"value":238},"统一格式减少约定成本，客户端可通用化处理。",{"type":20,"tag":34,"props":240,"children":241},{"id":56},[242],{"type":26,"value":56},{"type":20,"tag":60,"props":244,"children":246},{"className":62,"code":245,"language":64,"meta":7,"style":7},"{\"data\": [{\"type\": \"user\", \"id\": \"1\", \"attributes\": {\"name\": \"x\"}}]}\n",[247],{"type":20,"tag":67,"props":248,"children":249},{"__ignoreMap":7},[250],{"type":20,"tag":71,"props":251,"children":252},{"class":73,"line":74},[253,258,263,268,273,278,283,288,293,297,302,306,311,316,321,325,330],{"type":20,"tag":71,"props":254,"children":255},{"style":78},[256],{"type":26,"value":257},"{",{"type":20,"tag":71,"props":259,"children":260},{"style":84},[261],{"type":26,"value":262},"\"data\"",{"type":20,"tag":71,"props":264,"children":265},{"style":78},[266],{"type":26,"value":267},": [{",{"type":20,"tag":71,"props":269,"children":270},{"style":84},[271],{"type":26,"value":272},"\"type\"",{"type":20,"tag":71,"props":274,"children":275},{"style":78},[276],{"type":26,"value":277},": ",{"type":20,"tag":71,"props":279,"children":280},{"style":95},[281],{"type":26,"value":282},"\"user\"",{"type":20,"tag":71,"props":284,"children":285},{"style":78},[286],{"type":26,"value":287},", ",{"type":20,"tag":71,"props":289,"children":290},{"style":84},[291],{"type":26,"value":292},"\"id\"",{"type":20,"tag":71,"props":294,"children":295},{"style":78},[296],{"type":26,"value":277},{"type":20,"tag":71,"props":298,"children":299},{"style":95},[300],{"type":26,"value":301},"\"1\"",{"type":20,"tag":71,"props":303,"children":304},{"style":78},[305],{"type":26,"value":287},{"type":20,"tag":71,"props":307,"children":308},{"style":84},[309],{"type":26,"value":310},"\"attributes\"",{"type":20,"tag":71,"props":312,"children":313},{"style":78},[314],{"type":26,"value":315},": {",{"type":20,"tag":71,"props":317,"children":318},{"style":84},[319],{"type":26,"value":320},"\"name\"",{"type":20,"tag":71,"props":322,"children":323},{"style":78},[324],{"type":26,"value":277},{"type":20,"tag":71,"props":326,"children":327},{"style":95},[328],{"type":26,"value":329},"\"x\"",{"type":20,"tag":71,"props":331,"children":332},{"style":78},[333],{"type":26,"value":334},"}}]}\n",{"type":20,"tag":34,"props":336,"children":337},{"id":143},[338],{"type":26,"value":143},{"type":20,"tag":147,"props":340,"children":341},{},[342,349],{"type":20,"tag":151,"props":343,"children":344},{},[345],{"type":20,"tag":155,"props":346,"children":347},{"href":165},[348],{"type":26,"value":165},{"type":20,"tag":151,"props":350,"children":351},{},[352],{"type":20,"tag":155,"props":353,"children":355},{"href":354},"/validate",[356],{"type":26,"value":354},{"type":20,"tag":34,"props":358,"children":359},{"id":170},[360],{"type":26,"value":170},{"type":20,"tag":28,"props":362,"children":363},{},[364],{"type":26,"value":365},"JSON:API 是 RESTful API 的数据响应规范，统一资源、关系、分页、错误格式。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":367,"children":368},{},[369],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":371},[372,373,374,375,376],{"id":221,"depth":185,"text":221},{"id":231,"depth":185,"text":231},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-api-spec.md","blog/json-api-spec.md","blog/json-api-spec",{"_path":381,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":382,"description":383,"date":10,"category":11,"keywords":384,"body":388,"_type":192,"_id":499,"_source":194,"_file":500,"_stem":501,"_extension":197},"/blog/json-deserialization","JSON 反序列化注意事项","JSON 反序列化将字符串转为对象，需注意类型丢失、精度、安全与错误处理。",[385,386,387],"json反序列化","json parse","反序列化",{"type":17,"children":389,"toc":492},[390,395,400,405,410,415,420,424,458,462,479,483,488],{"type":20,"tag":21,"props":391,"children":393},{"id":392},"json-反序列化注意事项",[394],{"type":26,"value":382},{"type":20,"tag":28,"props":396,"children":397},{},[398],{"type":26,"value":399},"JSON 反序列化将 JSON 字符串解析为内存对象，过程中需注意类型、精度与安全。",{"type":20,"tag":34,"props":401,"children":403},{"id":402},"常见问题",[404],{"type":26,"value":402},{"type":20,"tag":28,"props":406,"children":407},{},[408],{"type":26,"value":409},"大整数精度丢失（JS Number 限制）、日期需手动转换、类型信息丢失、非法 JSON 抛错。",{"type":20,"tag":34,"props":411,"children":413},{"id":412},"安全",[414],{"type":26,"value":412},{"type":20,"tag":28,"props":416,"children":417},{},[418],{"type":26,"value":419},"避免 eval 解析（注入风险），使用 JSON.parse；注意原型链污染。",{"type":20,"tag":34,"props":421,"children":422},{"id":56},[423],{"type":26,"value":56},{"type":20,"tag":60,"props":425,"children":427},{"className":62,"code":426,"language":64,"meta":7,"style":7},"JSON.parse('{\"a\":1}')\n",[428],{"type":20,"tag":67,"props":429,"children":430},{"__ignoreMap":7},[431],{"type":20,"tag":71,"props":432,"children":433},{"class":73,"line":74},[434,439,444,448,453],{"type":20,"tag":71,"props":435,"children":436},{"style":78},[437],{"type":26,"value":438},"JSON.parse('{",{"type":20,"tag":71,"props":440,"children":441},{"style":84},[442],{"type":26,"value":443},"\"a\"",{"type":20,"tag":71,"props":445,"children":446},{"style":78},[447],{"type":26,"value":92},{"type":20,"tag":71,"props":449,"children":450},{"style":84},[451],{"type":26,"value":452},"1",{"type":20,"tag":71,"props":454,"children":455},{"style":78},[456],{"type":26,"value":457},"}')\n",{"type":20,"tag":34,"props":459,"children":460},{"id":143},[461],{"type":26,"value":143},{"type":20,"tag":147,"props":463,"children":464},{},[465,472],{"type":20,"tag":151,"props":466,"children":467},{},[468],{"type":20,"tag":155,"props":469,"children":470},{"href":354},[471],{"type":26,"value":354},{"type":20,"tag":151,"props":473,"children":474},{},[475],{"type":20,"tag":155,"props":476,"children":477},{"href":165},[478],{"type":26,"value":165},{"type":20,"tag":34,"props":480,"children":481},{"id":170},[482],{"type":26,"value":170},{"type":20,"tag":28,"props":484,"children":485},{},[486],{"type":26,"value":487},"JSON 反序列化将字符串转为对象，需注意类型丢失、精度、安全与错误处理。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":489,"children":490},{},[491],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":493},[494,495,496,497,498],{"id":402,"depth":185,"text":402},{"id":412,"depth":185,"text":412},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-deserialization.md","blog/json-deserialization.md","blog/json-deserialization",{"_path":503,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":504,"description":505,"date":10,"category":11,"keywords":506,"body":510,"_type":192,"_id":622,"_source":194,"_file":623,"_stem":624,"_extension":197},"/blog/json-performance","JSON 性能优化技巧","大 JSON 解析与传输优化：压缩、流式解析、字段裁剪、二进制替代方案。",[507,508,509],"json性能","json优化","大json",{"type":17,"children":511,"toc":615},[512,517,522,527,532,537,542,546,579,583,602,606,611],{"type":20,"tag":21,"props":513,"children":515},{"id":514},"json-性能优化技巧",[516],{"type":26,"value":504},{"type":20,"tag":28,"props":518,"children":519},{},[520],{"type":26,"value":521},"大 JSON 的解析与传输可能成为性能瓶颈，可通过多种手段优化。",{"type":20,"tag":34,"props":523,"children":525},{"id":524},"优化手段",[526],{"type":26,"value":524},{"type":20,"tag":28,"props":528,"children":529},{},[530],{"type":26,"value":531},"传输前 minify、gzip 压缩、流式解析（SAX）、按需裁剪字段、考虑 Protobuf/MessagePack。",{"type":20,"tag":34,"props":533,"children":535},{"id":534},"解析优化",[536],{"type":26,"value":534},{"type":20,"tag":28,"props":538,"children":539},{},[540],{"type":26,"value":541},"选用高性能库（如 simdjson）、Web Worker 避免阻塞主线程。",{"type":20,"tag":34,"props":543,"children":544},{"id":56},[545],{"type":26,"value":56},{"type":20,"tag":60,"props":547,"children":549},{"className":62,"code":548,"language":64,"meta":7,"style":7},"{\"big\": \"data...\"}\n",[550],{"type":20,"tag":67,"props":551,"children":552},{"__ignoreMap":7},[553],{"type":20,"tag":71,"props":554,"children":555},{"class":73,"line":74},[556,560,565,569,574],{"type":20,"tag":71,"props":557,"children":558},{"style":78},[559],{"type":26,"value":257},{"type":20,"tag":71,"props":561,"children":562},{"style":84},[563],{"type":26,"value":564},"\"big\"",{"type":20,"tag":71,"props":566,"children":567},{"style":78},[568],{"type":26,"value":277},{"type":20,"tag":71,"props":570,"children":571},{"style":95},[572],{"type":26,"value":573},"\"data...\"",{"type":20,"tag":71,"props":575,"children":576},{"style":78},[577],{"type":26,"value":578},"}\n",{"type":20,"tag":34,"props":580,"children":581},{"id":143},[582],{"type":26,"value":143},{"type":20,"tag":147,"props":584,"children":585},{},[586,594],{"type":20,"tag":151,"props":587,"children":588},{},[589],{"type":20,"tag":155,"props":590,"children":592},{"href":591},"/minify",[593],{"type":26,"value":591},{"type":20,"tag":151,"props":595,"children":596},{},[597],{"type":20,"tag":155,"props":598,"children":600},{"href":599},"/visualize",[601],{"type":26,"value":599},{"type":20,"tag":34,"props":603,"children":604},{"id":170},[605],{"type":26,"value":170},{"type":20,"tag":28,"props":607,"children":608},{},[609],{"type":26,"value":610},"大 JSON 解析与传输优化：压缩、流式解析、字段裁剪、二进制替代方案。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":612,"children":613},{},[614],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":616},[617,618,619,620,621],{"id":524,"depth":185,"text":524},{"id":534,"depth":185,"text":534},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-performance.md","blog/json-performance.md","blog/json-performance",{"_path":626,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":627,"description":628,"date":10,"category":11,"keywords":629,"body":633,"_type":192,"_id":727,"_source":194,"_file":728,"_stem":729,"_extension":197},"/blog/json-pointer","JSON Pointer 详解","JSON Pointer (RFC 6901) 用斜杠路径定位 JSON 节点，如 /a/b/0。",[630,631,632],"json pointer","rfc 6901","json路径",{"type":17,"children":634,"toc":720},[635,640,645,650,655,661,666,670,684,688,707,711,716],{"type":20,"tag":21,"props":636,"children":638},{"id":637},"json-pointer-详解",[639],{"type":26,"value":627},{"type":20,"tag":28,"props":641,"children":642},{},[643],{"type":26,"value":644},"JSON Pointer 是 RFC 6901 定义的用斜杠分隔路径定位 JSON 节点的语法，是 JSON Patch 的基础。",{"type":20,"tag":34,"props":646,"children":648},{"id":647},"语法",[649],{"type":26,"value":647},{"type":20,"tag":28,"props":651,"children":652},{},[653],{"type":26,"value":654},"以 / 开头，每段为键名或数组索引，如 /user/name、/list/0。特殊字符需转义。",{"type":20,"tag":34,"props":656,"children":658},{"id":657},"与-jsonpath-区别",[659],{"type":26,"value":660},"与 JSONPath 区别",{"type":20,"tag":28,"props":662,"children":663},{},[664],{"type":26,"value":665},"JSON Pointer 更简单，仅定位单一节点；JSONPath 支持通配与过滤，可返回多节点。",{"type":20,"tag":34,"props":667,"children":668},{"id":56},[669],{"type":26,"value":56},{"type":20,"tag":60,"props":671,"children":673},{"className":62,"code":672,"language":64,"meta":7,"style":7},"/user/address/city\n",[674],{"type":20,"tag":67,"props":675,"children":676},{"__ignoreMap":7},[677],{"type":20,"tag":71,"props":678,"children":679},{"class":73,"line":74},[680],{"type":20,"tag":71,"props":681,"children":682},{"style":78},[683],{"type":26,"value":672},{"type":20,"tag":34,"props":685,"children":686},{"id":143},[687],{"type":26,"value":143},{"type":20,"tag":147,"props":689,"children":690},{},[691,699],{"type":20,"tag":151,"props":692,"children":693},{},[694],{"type":20,"tag":155,"props":695,"children":697},{"href":696},"/jsonpath",[698],{"type":26,"value":696},{"type":20,"tag":151,"props":700,"children":701},{},[702],{"type":20,"tag":155,"props":703,"children":705},{"href":704},"/tree",[706],{"type":26,"value":704},{"type":20,"tag":34,"props":708,"children":709},{"id":170},[710],{"type":26,"value":170},{"type":20,"tag":28,"props":712,"children":713},{},[714],{"type":26,"value":715},"JSON Pointer (RFC 6901) 用斜杠路径定位 JSON 节点，如 /a/b/0。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":717,"children":718},{},[719],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":721},[722,723,724,725,726],{"id":647,"depth":185,"text":647},{"id":657,"depth":185,"text":660},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-pointer.md","blog/json-pointer.md","blog/json-pointer",1787305467014]