JSON 规范虽然在技术上不强制要求键的顺序,但在实际工程中,有序的 JSON 具有重要价值:
本站 工具提供了深度优先的排序逻辑,确保每一个层级都井然有序:
排序前(无序):
{
"status": "active",
"id": 101,
"author": {
"zip": "100000",
"name": "Gemini"
}
}
排序后(按字母升序):
{
"author": {
"name": "Gemini",
"zip": "100000"
},
"id": 101,
"status": "active"
}