mix ash_baml.gen.types (ash_baml v0.2.0)
View SourceGenerates explicit Ash type modules from BAML schema definitions.
Usage
$ mix ash_baml.gen.types MyApp.BamlClient
$ mix ash_baml.gen.types MyApp.BamlClient --dry-run
$ mix ash_baml.gen.types MyApp.BamlClient --verbose
Arguments
client_module- The BAML client module to generate types from
Options
--dry-run- Preview what would be generated without writing files--verbose- Show detailed output during generation--output-dir- Custom output directory (default: lib/)
Generated Files
For each BAML class, generates an Ash.TypedStruct module. For each BAML enum, generates an Ash.Type.Enum module.
Example:
class WeatherTool {
city string
units string
}
defmodule MyApp.BamlClient.Types.WeatherTool do
use Ash.TypedStruct
typed_struct do
field :city, :string
field :units, :string
end
endAll generated files are placed in the Types submodule of your BAML client.
Summary
Functions
Callback implementation for Mix.Task.run/1.
Functions
Callback implementation for Mix.Task.run/1.