pykwalify icon indicating copy to clipboard operation
pykwalify copied to clipboard

file extension of data input yaml

Open udeved opened this issue 8 years ago • 4 comments

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 avatar Feb 16 '17 17:02 udeved

@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?

Grokzen avatar Feb 16 '17 19:02 Grokzen

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

udeved avatar Feb 16 '17 20:02 udeved

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.

udeved avatar Feb 19 '17 00:02 udeved

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.

sdruskat avatar Dec 18 '17 10:12 sdruskat