dashbitco / nimble_options

A tiny library for validating and documenting high-level options. 💽
Apache License 2.0
507 stars 38 forks source link

Wrong exception message #41

Closed leandrocp closed 4 years ago

leandrocp commented 4 years ago

Looks like (in options [:stages]) shouldn't be returned at https://github.com/dashbitco/nimble_options/blob/5270554b86676476b3e63d91f54c0d340a67102c/test/nimble_options_test.exs#L38 considering it's not an available type, right? That's because the path is added to the validation (as expected), but that causes that path to be added to keys_path.

I'm not sure what's the best way to fix this without breaking other cases. Care to give some instructions? :)

whatyouhide commented 4 years ago

I think the error message there is correct. It's saying that the type :foo is unknown, and you're using it for the :stages option there in the test. Does that make sense? Closing this in the meantime since I don't believe it's a bug. :)

leandrocp commented 4 years ago

Gotcha, yeah it does make sense. Although I didn't realize it when I saw that because that's a list of "Available types" and it looked like (in options [:stages]) was leaking into that list, but like you said it's just a detail of where that validation error happened.