Skip to content

Conversation

@vmaerten
Copy link
Member

@vmaerten vmaerten commented Dec 14, 2025

Summary

Fix IntelliJ JSON Schema validation by splitting for_cmds_call into separate for_cmd_call and for_task_call definitions.

IntelliJ's JSON Schema validator has issues with oneOf combined with partially overlapping schemas, causing for loops to not be recognized (see IJPL-63564 and IJPL-63680).

This change replaces the oneOf pattern with explicit separate schema definitions for for+cmd and for+task combinations.

Test plan

  • Verify schema validates correctly in VS Code
  • Verify schema validates correctly in IntelliJ/GoLand with for loops

IntelliJ/PhpStorm has a bug (IJPL-63564) where it incorrectly validates
YAML files against JSON schemas that use `oneOf` with `required` constraints.

This causes false positive "property 'for' is not allowed" warnings.

Changes:
- Split `for_cmds_call` into `for_cmd_call` and `for_task_call`
  Each definition now has its own `required` array instead of using
  `oneOf: [{ required: ["cmd"] }, { required: ["task"] }]`

- Fix bug in `for_deps_call` where `oneOf` referenced non-existent
  `cmd` property (deps can only call tasks, not commands)

The schema remains semantically equivalent - the `additionalProperties: false`
on each split definition ensures mutual exclusivity of cmd/task.
@vmaerten vmaerten merged commit 28408ef into main Dec 15, 2025
13 checks passed
@vmaerten vmaerten deleted the fix/json-schema-intellij-workaround branch December 15, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants