You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defining our configuration via a schema that can be validated against would give us some benefits:
Easy to validate for parsing issues (and automatically generating nice error messages)
Easy to autogenerate documentation
Easy to deprecate and change options
I suggest voluptuous as that's what https://github.com/home-assistant/core uses and they seem to have good success, however there might be better systems.
The text was updated successfully, but these errors were encountered:
A couple of notes from our experience that may be helpful: Overloaded Keys
A key within faucet.yaml should not be overloaded from a schema perspective. For example, there is at least one faucet.yaml overloaded key - vlans. It is a top-level index of a network’s vlan objects; and, within a routers item it is an array of vlan names.
Faucet Index Objects
Faucet.yaml uses index objects where keys are network-specific identifiers for faucet-defined semantics. From a human ease-of-use perspective this seems fine; however, from a semantic perspective it is a problem.
This design prevents these index keys from being properly typed. Instead, faucet should consider using arrays of faucet defined objects that used faucet-defined keys to specify network typed values.
There are systems like https://github.com/alecthomas/voluptuous which let you programmatically define a YAML configuration schema.
Defining our configuration via a schema that can be validated against would give us some benefits:
I suggest voluptuous as that's what https://github.com/home-assistant/core uses and they seem to have good success, however there might be better systems.
The text was updated successfully, but these errors were encountered: