I have mounted a specification as follows:
sudo kdb mount ..../server/specification/LCDd-spec.ini 'spec/sw/lcdproc/lcdd/#0/current' ni
sudo kdb spec-mount '/sw/lcdproc/lcdd/#0/current
One setting has the following metadata:
[/curses/background]
type = enum
check/type = enum
check/enum = red, black, green, yellow, blue, magenta, cyan, white
default = cyan
description = background color when "backlight" is off
When I type in the following command in the commandline I correctly receive an error message:
kdb set '/sw/lcdproc/lcdd/#0/current/curses/background' greeeeen
#> Using name user/sw/lcdproc/lcdd/#0/current/curses/background
#> The command kdb set failed while accessing the key database with the info:
#> Sorry, the error (#121) occurred ;(
#> Description: validation failed
#> Reason: Validation of key "user/sw/lcdproc/lcdd/#0/current/curses/background" with string "greeeeen" failed.
#> Ingroup: plugin
#> Module: enum
#> At: ....../src/plugins/enum/enum.c:218
#> Mountpoint: user/sw/lcdproc/lcdd/#0/current
#> Configfile: ...../LCDd.conf.25676:1549919217.284067.tmp
But when I type in the same wrong value in the WEB-GUI the key gets accepted without any error message and is even retrievable via kdb get then in the command line.
Actually it would be quite trivial to support meta-data. Instead of kdb get/set <namespace>/<key>, kdb get/set -N <namespace> <key> should do the trick.
@omnidan Do you maybe have time for some improvements in the web-ui?
@markus2330 unfortunately I do not have time for any of my open source projects at the moment, I have already found someone else to maintain my other projects such as node-emoji.
I think this could/should be implemented in the kdb nodejs "library" of the web gui: https://github.com/ElektraInitiative/libelektra/blob/master/src/tools/web/kdb.js
Thank you for the tip!
@markus2330
In the current version of the web-ui, the validation check of specifications seems to be working just fine testing the case provided in this issue

@Piankero can you retry and give more detailed infos of how to reproduce this problem?
The current web-ui renders radio buttons for an enum key so this should be fixed.
Most helpful comment
The current web-ui renders radio buttons for an enum key so this should be fixed.