kitops icon indicating copy to clipboard operation
kitops copied to clipboard

Generate JSON schema for Kitfile and use it to validate incoming Kitfiles

Open amisevsk opened this issue 10 months ago • 2 comments

Describe the problem you're trying to solve When a Kitfile does not match the spec (e.g. uses an object instead of a list for datasets), the message displayed is not immediately clear:

❯ kit pack -t test:test .
Failed to pack model kit: yaml: unmarshal errors:
  line 5: cannot unmarshal !!map into []artifact.DataSet

For someone unfamiliar with Go, this might not be clear enough to realize the issue.

In addition, extra fields and typos are silently ignored (e.g. if you misspell a field).

Describe the solution you'd like We should generate a schema from the Kitfile struct and use it to validate incoming Kitfiles, providing more useful error messages when the Kitfile has errors.

Describe alternatives you've considered N/A

Additional context N/A

amisevsk avatar Apr 18 '24 15:04 amisevsk