-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Description
Feature Request
Environment
kcl: 0.11.0
OS: macOS 15.2
Is your feature request related to a problem? Please describe
Look at this example.
file.yml:
---
items:
- key: a
value: 1
- key: b
- key: c
value: 3file.schema.k:
schema file:
items: [item]
schema item:
key: str
value: intValidation error:
kcl vet --format=yaml file.yml file.schema.k
EvaluationError
--> file.schema.k:6:1
|
6 | value: int
| attribute 'value' of item is required and can't be None or Undefined
|The problem appears when file.yml is big enough and contains hundreds of values, there is no easy way to find the exact place where the validation fails to fix the issue (either add missing item or make it optional).
Describe the feature you'd like
I would like the command to show (or stop maybe) at the place where the required fields are missing. Just like similar issue #253.
The desired output of above example:
kcl vet --format=yaml file.yml file.schema.k
EvaluationError
--> file.yml:5:5
|
2 | items:
| ...
5 | - key: b
| ^ attribute 'value' of item is required and can't be None or Undefined
Violation rule is
--> file.schema.k:6:5
| ...
4 | schema item:
| ...
6 | value: int
| ^ attribute 'value' of item is required and can't be None or UndefinedReactions are currently unavailable