apache / apache/cloudstack

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

オープン
#11,277 コメント 2 件 リアクション 0 件 担当者 0 名 @jbampton が担当を希望しています GitHub で見る
type:question
主要言語
Java
スター
3.1k
フォーク
1.4k
平均マージ
6日 19時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。