Closed lud closed 3 years ago
One note though: The docs function do not work with the recursive_schema()
fixture from the tests. I did not try to change to much things to make it work, as I guessed the recursive_schema was only to test documenting the NimbleOptions@options_schema
itself.
:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:
Thank you both for the reviews and the merge!
See https://github.com/dashbitco/nimble_options/issues/69
This change makes possible to obtain a valid schema, and then validate options directly without validating the schema itself whenever options are to be validated.
I defined the struct directly in the NimbleOptions module, instead of creating a NimbleOptions.Schema module, because from there, I guess a couple options could be added to the struct, that would be passed into the validation, if someday
validate/2
becomesvalidate/3
and support validation options.(this is also why the flag is called
schema_valid?
and not justvalid?
)Have a nice day :)