Using the info extension, I expected to be able to fetch a concise list of provided schema keys and whether or not they are required by using #info. This works great, but I'm finding that defining an optional schema key which has no predicates attached is completely omitted from this result. (See reproduction script below)
I'm not sure if this is an intentional thing or not, because I do see that, in my provided example, optional(:age) is sort of a "nothing burger". As far as the schema is concerned it doesn't end up really meaning anything. In my use case, a user is using dry-schema to build a definition for object attributes. optional(:age) has meaning to them/me because it signals the intent to create a getter/setter for :age, even if the value will just pass through the schema validator.
Describe the bug
Using the
info
extension, I expected to be able to fetch a concise list of provided schema keys and whether or not they are required by using#info
. This works great, but I'm finding that defining an optional schema key which has no predicates attached is completely omitted from this result. (See reproduction script below)I'm not sure if this is an intentional thing or not, because I do see that, in my provided example,
optional(:age)
is sort of a "nothing burger". As far as the schema is concerned it doesn't end up really meaning anything. In my use case, a user is using dry-schema to build a definition for object attributes.optional(:age)
has meaning to them/me because it signals the intent to create a getter/setter for:age
, even if the value will just pass through the schema validator.To Reproduce
Expected behavior
My environment