- Fix typespecs to avoid Dialyzer warnings
- Do not list default values as part of received options
- Mark structs in backticks for doc references
- List deprecations in docs
- Add a
:type_spec
option to specify a quoted type spec for options.
- Improve typespec generation for ranges and structs.
- Make the
NimbleOptions.t/0
type public (instead of opaque). This helps with Dialyzer issues when ysingNimbleOptions.new!/1
at compile time.
- Add support for a
{:struct, struct_name}
type specifier - Add support for the
:type_doc
option - Turn
t:NimbleOptions.t/0
into an opaque type
- Support generating typespecs for
:tuple
,:map
, and{:map, key, value}
options
- Support
:map
which accepts the same:keys
specification as keyword lists - Normalize all error messages to include the key and expected value out of the box
- Do not nest options when rendered in Markdown and make sure multiline content is properly indented
- Handle \r\n style of line breaks in docs
- Automatically add types to generated docs
- Support lists of keyword lists in
:list
- Add the
:reference
option type - Add the
:tuple
option type
- Add support for all enumerables in
{:in, choices}
instead of just lists. You can now do things such as{:in, 1..10}
. - Deprecate the
:rename_to
schema option and emit a warning when used. - Remove the
{:one_of, choices}
type which was deprecated in v0.3.3.
- Add
NimbleOptions.new!/1
to validate the schema once.
- Add
:float
type. - Fix docs generation when custom key type has no keys.
- Add support for the
{:list, subtype}
type.
- Support nested schemas in the
{:or, subtypes}
type as{:or, [:string, keyword_list: [enabled: [type: :boolean]]]}
. - Improve validation of the return value of
{:custom, module, function, args}
functions. - Support options in
NimbleOptions.docs/2
. For now only the:nest_level
option is supported.
- Add the
{:or, subtypes}
type. - Deprecate the
{:one_of, choices}
and replace it with{:in, choices}
. Using{:one_of, choices}
emits a warning now.
- Fix a small bug with docs for nested schemas.
- Return
:key
and:value
on%NimbleOptions.ValidationError{}
to allow programmatic use of errors. - Validate default values according to the specified type.
- Breaking change: return
{:error, %NimbleOptions.ValidationError{}}
tuples when there's a validation error inNimbleOptions.validate/2
instead of{:error, message}
(withmessage
being a string). You can useException.message/1
to turn theNimbleOptions.ValidationError
struct into a string. - Add the
:pid
type.
- Add
NimbleOptions.validate!/2
.
- Change the behavior of
NimbleOptions.docs/1
to accept a normal schema and produce documentation for that. - Add support for
doc: false
as a schema option to hide an option or an option and its subsection.
- First release.