是否有定义 json 文件扩展名的标准或规范?
我见过.json
使用 - 这只是一种普遍接受的做法还是某些标准机构对以文件格式保存的 json 的要求?
最佳答案
根据 Douglas Crockford 的 JSON 格式草案发现 here :
"A JSON parser transforms a JSON text into another representation. A
JSON parser MUST accept all texts that conform to the JSON grammar. A JSON parser MAY accept non-JSON forms or extensions."
所以,这只是一种普遍接受的做法;只要您的文件符合 JSON 语法,扩展名不一定必须是 *.json(尽管如果是,它肯定会对您和其他开发人员有所帮助)。
关于json - 标准定义json文件扩展名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3104576/