AshTypescript.Codegen.SharedSchemaGenerator (ash_typescript v0.17.3)

Copy Markdown View Source

Generates a shared validation schema file for any SchemaFormatter implementation.

Assembles all schemas into a single dedicated file:

  • Resource-level schemas (embedded resources, struct arguments)
  • Per-action RPC schemas
  • Per-route controller schemas

Summary

Functions

Generates the content for a shared schema file.

Functions

generate(formatter, opts)

Generates the content for a shared schema file.

Parameters

  • formatter - A module implementing AshTypescript.Codegen.SchemaFormatter
  • opts - A keyword list with:
    • :resource_schemas - Pre-generated resource schema string (required)
    • :types_output_file - Path to the shared types file (required)
    • :schema_output_file - Path to this schema file (required, for import resolution)
    • :additional_schemas - Pre-rendered schema strings to append (optional)

Returns

A string containing the TypeScript content for the shared schema file.