defmodule UserModel do
@type t :: %__MODULE__{
id: integer(),
name: String.t(),
active: boolean(),
roles: [String.t()]
}
defstruct [:id, :name, :active, :roles]
end
FAQ
Why use the Elixir route instead of the Ruby or PHP routes?
Choose the Elixir route when your target stack is Elixir and you want typed struct modules with `%__MODULE__{}` specs rather than Ruby POROs or PHP DTO classes.
Does the Elixir route handle nested objects and arrays?
Yes. Nested objects become additional Elixir modules, and repeated values are represented with list-based field types inferred from the sample JSON payload.