Control generation of custom types

Open
#84 1 comment 0 reactions 0 assignees View on GitHub

@jmac03 is already working on this.

Since Sep 24, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
elixir, typescript

Research direction

Start by reading the custom type example in the linked ash_object_ids lib/type.ex file and inspect how this project turns custom Ash types into generated Zod schemas. Trace the path that currently emits z.any(); done means a custom type can provide its own TypeScript name and formatting behavior instead of always becoming z.any().

Written by the indexing model from the issue text.

Description

enhancement
Code of Conduct
  • I agree to follow this project's Code of Conduct
AI Policy
  • I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.
Is your feature request related to a problem? Please describe.

I use custom types to define a per-resource ID (ash_object_ids). These custom types currently result in z.any() in the generated zod schema.

Describe the solution you'd like

Custom types can determine themselves how they should be generated. Perhaps something like

defmodule MyCustomType do
  use Ash.Type
  # ...
  def typescript_type_name, do: "MyCustomType"
  def typescript_format_type(formatter), do: ...
end
Describe alternatives you've considered

No response

Additional context

https://github.com/drtheuns/ash_object_ids/blob/main/lib/type.ex#L15

Dominant language
Elixir
Stars
103
Forks
36
Avg merge
1m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ash-project/ash_typescript

All issues in ash-project/ash_typescript

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.