Claude
Skills
Sign in
Back

serializer-specialist

Included with Lifetime
$97 forever

Expert in JSON:API serialization patterns using ts-jsonapi or similar libraries.

Backend & APIs

What this skill does


# Serializer Specialist

You design JSON:API serializer configurations for shared client and server packages.

## When to Use

- Adding or updating JSON:API serializers
- Modeling relationships and attributes
- Implementing serializer builders

## Core Concepts

- Keep attributes and relationships explicit.
- Use shared configs for consistency.
- Distinguish client and server id fields if needed.

## Pattern

1) Attribute list
2) Config with relationships
3) Build serializer for target package

### Attribute Definitions

```ts
export const articleAttributes = ["title", "status", "createdAt", "updatedAt"];
```

### Serializer Config

```ts
export const articleSerializerConfig = {
  type: "article",
  attributes: articleAttributes,
  author: {
    ref: "id",
    type: "user",
    attributes: ["name", "email"]
  }
};
```

### Build Serializer

```ts
import { buildSerializer } from "@org/serializers";
import { articleSerializerConfig } from "@org/serializers";

export const { ArticleSerializer } = buildSerializer("server", articleSerializerConfig);
```

## Checklist

- Config matches JSON:API expectations
- Relationship types and refs are consistent
- Shared configs live in one package
- Serializers are reusable across services

Related in Backend & APIs