Elixir Generator Attributes
Here’s the list of attributes that affect Elixir code generation.
Attribute |
Type |
Inheritance |
Target |
Description |
Default |
|---|---|---|---|---|---|
enabled |
bool |
scope |
module,
type
|
Enables code generation for
the module or type
|
|
file |
string |
module |
Override generated file name |
||
name |
string |
module
type
service
record field
enum field
|
Override generated type name |
||
alias |
string |
type |
Do not generate a type but use
existing type definition
|
||
tuple |
bool |
record |
Generate Elixir tuple type
for the record
|
|
|
record |
bool |
record |
Generate Elixir record type
for the record
|
|
|
map |
bool |
record |
Generate Elixir map type
for the record
|
|
|
tagged |
bool |
scope |
union
union clause
|
Represent union clauses as
{:clause, value} tuples |
|
exception_message |
string |
exception |
Override exception message |
||
json.custom |
string |
type |
Custom JSON serializer module
exporting
from_json! andto_json! functions |
||
json.compatible |
bool |
type |
Skip JSON serialization as
type’s JSON representation is
identical with Elixir values
|
|
|
string.custom |
string |
type |
Custom string serializer module
exporting
from_string! andto_string! functions |