ash-project / ash-project/ash_typescript

Control generation of custom types

Open
#84 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Elixir
Stars
102
Forks
29
Avg merge
3d 13h
Merged PRs (30d)
5

Description

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

### AI Policy

- [x] 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

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.