Open
Description
General Question
Hello,
Maybe I didn't get the aim of your tool.
I found the way to validate my yaml file
---
vars:
AA: test
binData:
commands:
default:
mainFile: null
definitionFiles:
- file: "test"
order: 1
- file: "test2"
order: 1
with this k file
import regex
schema BinFileSchema:
vars?: VarsSchema
compilerConfig?: CompilerConfigSchema
binData: BinDataSchema
test: str = "toto"
schema BinDataSchema:
commands: CommandsSchema
schema CompilerConfigSchema:
test?: str = "toto"
schema DefaultCommandSchema:
mainFile?: str
definitionFiles?: [DefinitionFilesSchema]
check:
definitionFiles and isunique([ int(_x["order"]) \
for _, _x in definitionFiles]) if definitionFiles, \
"definitionFiles: order property value should be unique, check for duplicates"
schema CommandsSchema:
default: DefaultCommandSchema
schema DefinitionFilesSchema:
file: str
order: int
check:
order > 0, "order must >0"
schema VarsSchema:
[attr: str]: str
check:
regex.match(attr, r'^[A-Z0-9_]+$')
Using the validation command:
kcl vet testsKcl/data.yaml binFile.k --format yaml
it works very well
but I didn't find the right command or ability to import my yaml file to be processed by the k file in order to interpolate the default properties that would be missing from my yaml file (eg: the test properties of the k file).
I tried several commands but no success to generate any viable output:
kcl run data.yaml binFile.k --format yaml
Here I get an empty output {}
The command kcl -Y data.yaml binFile.k --format yaml
gives {}
as well
what am I missing ?
kind regards