VIEW011: duplicate-json-key
JSON object has the same key twice
| Code | VIEW011 |
| Name | duplicate-json-key |
| Category | View structure (VIEW) |
| Default severity | error |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports a key that occurs more than once in the same JSON object, in any
JSON file of a resource (view.json, style.json, tags.json,
config.json, resource.json, project.json, ...). Every occurrence but
the last is reported.
Why is this bad?
Section titled “Why is this bad?”Ignition reads the file with Gson, which keeps only the last value of a repeated key. The earlier values are silently ignored, and the next save from the Designer drops them. Duplicates come from merge conflicts resolved by hand or from generated files.
Example
Section titled “Example”"props": {"text": "Start", "text": "Stop"}Use instead:
"props": {"text": "Stop"}Generated from the rule metadata by iglint generate-docs; iglint rule VIEW011 prints the same page in the terminal. Source: docs/rules/VIEW011.md.