Skip to content

0.1.4

Compare
Choose a tag to compare
@shahryarjb shahryarjb released this 17 Feb 11:07
· 53 commits to master since this release

We are delighted to introduce our new version of Mishka developer tools library. For more info click on GuardedStruct.

Changelog for MishkaDeveloperTools 0.1.4

Features:

  • Support whole entries check derives for struct or structs (external module) (More information: #26)

  • Support derive and validator on conditional_field macro as entries checker

  • Support nested conditional fields (More information: #25)

  guardedstruct do
    conditional_field(:actor, any()) do
      field(:actor, struct(), struct: Actor, derive: "validate(map, not_empty)")

      conditional_field(:actor, any(),
        structs: true,
        derive: "validate(list, not_empty, not_flatten_empty_item)"
      ) do
        field(:actor, struct(), struct: Actor, derive: "validate(map, not_empty)")

        field(:actor, String.t(), derive: "sanitize(tag=strip_tags) validate(url, max_len=160)")
      end

      field(:actor, String.t(), derive: "sanitize(tag=strip_tags) validate(url, max_len=160)")
    end
  end

Fixed bugs:

  • Fix showing different errors when they accompany a conditional errors
  • Fix short anonymous function warning in elixir 1.16
  • Support pre-check derives inside conditional fields
  • Normalize conditional fields errors
  • Normalize validator errors
  • Normalize errors hint
  • Normalize derives errors
  • Fix dialyzer warning
  • Support derive in normal conditional field without validator
conditional_field(:id, String.t()) do
  field(:id, String.t(), derive: "sanitize(tag=strip_tags) validate(url, max_len=160)")
  field(:id, any(), derive: "sanitize(tag=strip_tags) validate(not_empty_string, uuid)")
end

Docs

  • Add LiveBook

Full Changelog: 0.1.3...0.1.4