exconstructor
exconstructor copied to clipboard
An Elixir library for generating struct constructors that handle external data with ease.
Hi, the doc say to put the use ExConstructor after the struct creation, but i've put it before and it's seams to work the same. Am i miss something? I'm...
warning: negative steps are not supported in String.slice/2, pass 1..-1//1 instead (elixir 1.16.0) lib/string.ex:2368: String.slice/2 The change is as I can understand and conclude from testing backwards compatible.
Would be nice to have something akin to the ``` %{"nestedField" => %{id: 1}} |> Poison.decode! as: %Model{nested_field: [%Nested{}]} ``` See https://github.com/devinus/poison/pull/58/files
This: ```elixir /app # iex -S mix Erlang/OTP 21 [erts-10.3.5.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] Interactive Elixir (1.7.4) - press Ctrl+C to exit (type h() ENTER for help) iex(1)>...
[Kernel.struct!/2](https://hexdocs.pm/elixir/Kernel.html#struct!/2) is stricter (see docs), which will prevent the ignorance of @enforce_keys and prevent invalid struct keys being passed. If you want some code to do the two checks independently,...
It would be a useful extension to be able to produce _maps_ with keys cased in one specific flavour. One example use would be to produce Javascript-style camelCase API responses...
Wasn't trivial, at least to me, to set this working. Can I submit a PR to add to docs? `defmodule CreateShift, do: [defstruct([:shift_id]), use(ExConstructor)]`
The requirement for `use ExConstructor` to appear after the defstruct can cause issues, such as: - **Stylistic Conflicts**: Tools like Styler and Credo may have rules that suggest placing use...