mix caravela.gen.api (Caravela v0.13.3)

Copy Markdown View Source

Generates one Phoenix JSON controller per entity in the domain and prints a router scope snippet the developer can paste into lib/<app>_web/router.ex.

mix caravela.gen.api MyApp.Domains.Library

Flags:

  • --dry-run — print the generated files without writing
  • --output DIR — write under DIR instead of the project root
  • --force — overwrite existing files without prompting
  • --no-scope — skip printing the router snippet

Regeneration preserves content below the # --- CUSTOM --- marker.