According to examples, this is the correct way to create a validation Schema:
import voluptuous as vol
PORT1 = vol.Schema(vol.All(int, vol.Range(min=0, max=65535)))
However, I noticed, that the Schema
call is missing in some of my validators, e.g.:
PORT2 = vol.All(int, vol.Range(min=0, max=65535))
I checked that PORT1
and PORT2
are not of the same type. The catch is that PORT2
works fine for me and gives the same results as the correct PORT1
.
I don't know if I made a mistake. Could somebode please clearly state if it is an error to omit the Schema(...)
? Why it works so well without the Schema(...)
that I did not notice any problems?