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 摘要。