Caravela.Gen.Controller (Caravela v0.10.0)

Copy Markdown View Source

Generates one Phoenix JSON controller per entity in a Caravela.Schema.Domain.

Each controller provides standard REST actions (index, show, create, update, delete) and delegates to the generated context module. Authorization and hooks are enforced inside the context — the controller only translates {:ok, _} | {:error, _} tuples into HTTP status codes.

Returns a list of {path, source} tuples. Files preserve content below the # --- CUSTOM --- marker on regeneration.

Summary

Functions

Render every controller for the domain.

Render a single controller for one entity.

Functions

render_all(domain, opts \\ [])

Render every controller for the domain.

render_entity(domain, entity, opts \\ [])

Render a single controller for one entity.