正規化済みフィールドから、生成する構造体の型仕様 AST を組み立てます。
ExParamsSchema.Compiler がコンパイル時に使用する内部モジュールです。
Summary
Functions
フィールド定義から構造体の型仕様 AST を返します。
Functions
@spec struct_type([ExParamsSchema.Definition.Field.t()]) :: Macro.t()
フィールド定義から構造体の型仕様 AST を返します。
iex> fields = [
...> %ExParamsSchema.Definition.Field{name: :count, type: :integer},
...> %ExParamsSchema.Definition.Field{name: :label, type: :string, options: [optional: true]}
...> ]
iex> ast = ExParamsSchema.Definition.Typespec.struct_type(fields)
iex> Macro.to_string(ast)
"%__MODULE__{count: integer(), label: String.t() | nil}"