pykwalify
pykwalify copied to clipboard
file extension of data input yaml
Hi,
as opposed to ruby version of kwalify, pykwalify unfortunately does not take for example a data.conf in yaml format.
I can validate a data.conf against a data.schema.yaml in ruby, but in python version, I would need to change file extension to make it work. Could this be enhanced to accept other than strict *.yaml extension?
@udeved Is it throign hard error when not using .yaml extension or is it becuase it do not understands the data inside the file? If indeed this feature works in kwalify then it is a candidate for implementing even tho if i do not like the idea that much. But if this version should be a superset of kwalify then i guess in it will go.
Is .conf the only other supported file extension or is there no validation on the input file type in the ruby version?
The data yaml is valid, the schema yaml exists for the data yaml. To explain, I use currently ruby version to validate calamares data.conf against its data.schema.yaml. The calamares installer uses yaml with *.conf file extension.
https://github.com/calamares/calamares-tools
Is .conf the only other supported file extension or is there no validation on the input file type in the ruby version?
There doesn't seem to be validation on file extension.
I tested by renaming data.conf to data.ini
$ kwalify -lf schemas/fstab.schema.yaml -m data/fstab.conf
data/fstab.conf#0: valid.
$ kwalify -lf schemas/fstab.schema.yaml -m data/fstab.ini
data/fstab.ini#0: valid.
A fix has been implemented in https://github.com/Grokzen/pykwalify/pull/119 and works in the http://github.com/sdruskat/pykwalifire fork 1.7.0.