AshTypescript.TypedController.Codegen.RouteRenderer (ash_typescript v0.17.3)

Copy Markdown View Source

Generates TypeScript functions for typed controller routes.

  • GET routes generate path helper functions.
  • Mutation routes (POST/PATCH/PUT/DELETE) generate typed action functions with input types derived from route arguments.

Summary

Functions

Renders TypeScript code for a single route without Zod schema.

Renders the Zod schema for a route's mutation input.

Functions

render_no_zod(route_info, opts \\ [])

Renders TypeScript code for a single route without Zod schema.

Same as render/1 but skips Zod schema generation (for split-file mode where Zod schemas live in ash_zod.ts).

Options

  • :has_base_path - When true, prefixes all URL expressions with ${_basePath}

render_zod_schema(route_info)

Renders the Zod schema for a route's mutation input.

Returns an empty string for GET routes, routes without non-path arguments, or when Zod schema generation is disabled.