Skip to content

Typelizer

Define once in Ruby. Generate everywhere in TypeScript.

For Rails apps using Alba, AMS, Oj, or Panko serializers.

post_resource.rb
class PostResource < ApplicationResource
  include Typelizer::DSL

  attributes :id, :title, :body

  has_one :author
  has_many :comments
end
Post.tsgenerated
export interface Post {
  id: number;
  title: string;
  body: string;
  author: Author;
  comments: Array<Comment>;
}

Works With Your Serializer

Supports Alba, ActiveModel::Serializer, Oj::Serializer, and Panko out of the box.

Type-Safe Route Helpers

Import your Rails routes as typed functions. Params are checked, paths are built -- no strings to get wrong.

Multiple Writers

Need snake_case for one app and camelCase for another? Define multiple writers, generate both at once.

Auto-Regeneration

Change a serializer, types regenerate. Edit routes.rb, route helpers update. Zero manual steps in development.

OpenAPI Schemas

Turn the same serializer definitions into OpenAPI 3.0 or 3.1 component schemas for your API docs.

Layered Configuration

Configure globally, per-writer, or per-serializer. Sensible defaults, full control when you need it.