This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
Replies: 1 comment
-
I think it is easier to turn validation warnings to errors (e.g. by high-level APIs), then to implement such a flag. And a validation plugin could remove non-validating keys that are not required. The only remaining case is if a key is required and invalid we should actually make an error, even on |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Some plugins perform validations during
kdbGet
(postgetstorage
) andkdbSet
(presetstorage
), while others do it only duringkdbSet
. This is inconsistent and we should find a standard way to do things.Examples of validation during
kdbGet
andkdbSet
:type
,macaddr
Examples of validation only during
kdbSet
:network
,reference
Performing validation only during
kdbSet
can lead to problems, if the storage file is modified directly. Also some plugins also perform transformations inkdbGet
, in which case validation duringkdbGet
is a must. Therefore, I think the standard way should be to validate duringkdbGet
and duringkdbSet
.There is also the question of what to do, if validation fails. During
kdbSet
, it is pretty obvious that there should be an error to prevent creating invalid files. However, inkdbGet
it is not so clear. If we produce an error and makekdbGet
fail, we can never usekdbSet
to fix the problem. But if we don't produce an error (and e.g. only produce a warning), applications may accidentally load invalid configurations.IMO the best solution would be to validate both during
kdbGet
andkdbSet
and always produce errors, unless a global flag (passed via the global keyset) is active. If the global flag is set, validation errors duringkdbGet
only produce a warning, but inkdbSet
we still get an error. This allows us to fix broken configurations, but by default applications will not use invalid configs.Beta Was this translation helpful? Give feedback.
All reactions