Generating JSON Schema for an Ash resource

Hi,

I might be missing something in ash-json-api documentation, but is there an easy(ish) way to generate a JSON Schema out of an Ash resource?

My main use case is to feed that schema to an LLM provider such as OpenAI or Claude to restrict their output to that format, and return the corresponding objects.

Think what GitHub - thmsmlr/instructor_ex: Structured outputs for LLMs in Elixir does but tailored for Ash, as ,I don’t want to duplicate the definitions of my resources.

I would appreciate any pointers!

Take a look here :slight_smile:

1 Like

This is exactly what I was looking for, thank you!