All Versions
31
Latest Version
Avg Release Cycle
-
Latest Release
-

Changelog History
Page 2

  • v1.2.4 Changes

    ๐Ÿ”„ Changes

    • use Exop.Chain now accepts :name_in_error option: when it is set to true a failed operation in a chain returns the operation's module name as the first elements of output tuple {YourOperation, {:error, _}}
    • ๐Ÿ†• new type: :uuid check which supports both UUID1 and UUID4
    • ๐Ÿ†• new aliases for :numericality check (to make your code slim): :eq, :gt, :gte, :lt, :lte
    • :inner check now accepts opts as both map and keyword (earlier only map has been allowed)
    • a few macros (like parameter, operation etc.) locals_without_parens formatter rule has been exported. Place import_deps: [:exop] into your project's .formatter.exs file in order to use it.
    • step/2 has been added as an alias for Exop.Chain's operation/2 macro
  • v1.2.3 Changes

    ๐Ÿ”„ Changes

    • ๐Ÿ›  Exop.Chain bug was fixed (the last operation in a chain returned a result not wrapped into ok-tuple)
    • Exop.Chain allows now to pass additional parameters to any operation in a chain
  • v1.2.2 Changes

    ๐Ÿ”„ Changes

    • list_item check allows you to omit type check definition, in this case list_item checks for the list type under the hood
    • ๐Ÿ—„ struct type check is deprecated
    • ๐Ÿ›  required: false + allow_nil: false behavior has been fixed
    • type: :struct check has been revised
  • v1.2.1 Changes

    ๐Ÿ”„ Changes

    • โš  you get a warning if there is no any parameter definition
    • inner check allows you to omit type check definition, in this case inner checks for an appropriate type (either Map or Keyword) under the hood
    • inner returns an item's error as "a[:c]" => ["is required"]
    • :keyword option for type check has been added
    • it is allowed now to pass just a module (atom like MyStruct) to struct check, not only %MyStruct{}
  • v1.2.0 Changes

    ๐Ÿ”„ Changes

    • ๐Ÿ’ฅ breaking: required has true value by default, so paramter is required by default if only you haven't specify required: false (a bit more info in the README)
    • list_item now accept both: Map and Keyword as items checks
    • list_item returns an item's error as "list_param[index]" => [error_messages]
    • :module option for type check (if you want to be more explicit)
    • Checks list as links in the README
  • v1.1.4 Changes

    ๐Ÿ”„ Changes

    • ๐Ÿ†• new allow_nil attribute for a parameter which allows you to pass nil as a parameter's value (and omit all validation checks invokation)
    • a few (min, max, is) aliases were added to numericality check
    • coerce_with now respects error tuple which might be returned from coerce function (that error tuple is returned as an operation's result immediately)
  • v1.1.3 Changes

    ๐Ÿ”„ Changes

    • ๐Ÿ›  a bug with type check was fixed: previously this check passed if a parameter's value is nil, now nil passes the check only if :atom type is specified
  • v1.1.2 Changes

    ๐Ÿ”„ Changes

    • now it is possible to return an :error-tuple of any length from an operation. Previously only a tuple of two elements was treated as error result, any other results treated as success and were wrapped into :ok-tuple
    • now it is possible to provide 3-arity function to the func check: in previous verisons this check expected only a function with arity == 2 to invoke for checking (1. params passed to an operation, 2. param to check value), starting from this version you can provide a function with arity == 3 (in this case Exop will invoke your function with: 1. params passed to an operation, 2. param to check name, 3. param to check value)
    • coerce_with can take a function of arity == 2 (not only with arity == 1), coercion function/2 will be invoked with args: 1. parameter name 2. parameter value (coercion function with arity == 1 still takes just a parameter value)
    • some checks aliases were added
  • v1.1.1 Changes

    ๐Ÿ”„ Changes

    • โš  some dialyzer warnings were fixed
    • in & not_in checks error message fix (for example, atoms list displays as atoms list :) )
    • you can now name your parameters with strings, not only atoms and even combine string- and atom-named parameters
    • a policy action argument now can be a value of any type (previously only map was allowed)
    • there is no need to use Exop.Policy in a policy module anymore (you still can use it and there is no need to rewrite exsisting policies): simply define a module with policy checks (actions) functions which are expected to take a single argument (any type) and return either true or false
  • v1.1.0 Changes

    ๐Ÿ”„ Changes

    • required check was revised. Now nil is treated as a value. It means that before this version required check returned an error if a parameter had a nil value. From this version this check fails only if parameter wasn't provided to an operation.

    To simulate previous behaviour (if you need to keep backward compatibility with parameters passed into an operation) you can do:

      parameter :a, required: true, func: &__MODULE__.old_required/2
    
      def old_required(_params, nil), do: {:error, "is required"}
      def old_required(_params, param), do: true
    
    • ๐ŸŒฒ ValidationError now has an operation name in its message (better for debugging and logging)