apache / apache/cloudstack

Question: Should we allow duplicate keys in our JSON objects ?

未關閉
#11,277 2 則留言 0 個 reaction 已指派 0 人 已被 @jbampton 認領 在 GitHub 檢視
type:question
主要語言
Java
星號
3.1k
分支
1.4k
平均合併
6 天 19 小時
30 天內合併 PR
32

描述

I was attempting to add the official pre-commit hook `check-json`

https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#check-json

And when testing the hook locally it showed two JSON files that had duplicate keys.

Should we standardize all our JSON files and enable checking or continue with the current inconsistent approach ?

Image

So it just shows two but there are many in the "GR" file

Image

Image

There is a discussion below about this:

https://stackoverflow.com/questions/21832701/does-json-syntax-allow-duplicate-keys-in-an-object

貢獻指南

開啟貢獻指南

研究方向

從提議的 pre-commit check-json hook 及其回報的 JSON 檔案開始,包括提到的 "GR" 檔案,然後檢視已開啟的 PR #12245。完成的標準是專案已決定重複鍵政策,受影響的 JSON 檔案遵循該政策,且檢查始終通過。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
json
領域
build-system, tooling
Issue 類型
重構
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。