add support for generating default values
add default value generation in middleware mode
fix validator middleware should not accept default values as valid when the values are required in the schema