Skip to main content

2 posts tagged with "how-to"

View All Tags

Unified DTOs for Clients and Servers

· 3 min read
Steve Konves
Basketry maintainer

Basketry recently improved how Data Transfer Objects (DTOs) are handled across both Express and HTTP client generators. This upgrade simplifies your project by centralizing DTO definitions and enhancing data validation through Zod.

This article will walk you through what changed and how to leverage these improvements in your projects.

Dimly lit equipment rack filled with tangled cables and small red-and-green indicator lights.

Cleaner, Safer Code with Discriminated Unions

· 12 min read
Steve Konves
Basketry maintainer

Learn how to improve your code quality and type safety with discriminated unions, and use Basketry to streamline the process.

What are discriminated unions?

Discriminated unions, also known as tagged unions or algebraic data types, are a powerful feature in many modern programming languages that allow you to define a type that can take on several different but related forms.

Photo of a large, white sign with the letters 'UNION' against a light blue sky, mounted on top of a white brick building.