<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt" -->

---
title: You’re Doing Type Validation Wrong: A TypeScript Guide...
description: This article explores the concept of runtime type validation in TypeScript and introduces the Zod library as a tool to achieve it. It also discusses the...
canonical: https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: You’re Doing Type Validation Wrong: A TypeScript Guide to Runtime Validation | daily.dev
og:description: This article explores the concept of runtime type validation in TypeScript and introduces the Zod library as a tool to achieve it. It also discusses the...
og:url: https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt
og:image: https://api.daily.dev/og/posts/dcF5nrsBt.png
og:image:alt: You’re Doing Type Validation Wrong: A TypeScript Guide to Runtime Validation
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# You’re Doing Type Validation Wrong: A TypeScript Guide to Runtime Validation

**[Medium](https://daily.dev/sources/medium_js)** · [@deleteman](https://daily.dev/deleteman) · 4 min read · 17 upvotes · 1 comments

## Summary

This article explores the concept of runtime type validation in TypeScript and introduces the Zod library as a tool to achieve it. It also discusses the distinction between nominal type systems and structural type systems in TypeScript and provides a workaround to add nominal type support using branded types. Overall, the article highlights the importance of type validation and offers different approaches to implement it in TypeScript.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.bitsrc.io/youre-doing-type-validation-wrong-in-typescript-2a97727a167e?source=rss------javascript-5>

## Community discussion

Top comments from developers on daily.dev.

**@apperside** · 0 upvotes

> Nice article, thank you!
> Just a questioni: What Is the performance impact of runtime validation?

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#typescript](https://daily.dev/tags/typescript), [#webdev](https://daily.dev/tags/webdev), [#zod](https://daily.dev/tags/zod)

[View this post on daily.dev](https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"You’re Doing Type Validation Wrong: A TypeScript Guide to Runtime Validation","url":"https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt"},"datePublished":"2023-11-09T07:53:32.468Z","dateModified":"2025-09-06T02:31:34.692Z","description":"This article explores the concept of runtime type validation in TypeScript and introduces the Zod library as a tool to achieve it. It also discusses the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/21c2d13a81210df9ef7c1e21fc63eca7?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/21c2d13a81210df9ef7c1e21fc63eca7?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Fernando Doglio","url":"https://daily.dev/deleteman","image":"https://lh3.googleusercontent.com/a-/AOh14GjHsDw4rFN2nL_hd2xOYBiV-CoIY2zVUYgMN8Mebw=s100","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":1660}},"commentCount":1,"discussionUrl":"https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":17},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"javascript,typescript,webdev,zod","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"You’re Doing Type Validation Wrong: A TypeScript Guide to Runtime Validation"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/you-re-doing-type-validation-wrong-a-typescript-guide-to-runtime-validation-dcf5nrsbt","comment":[{"@type":"Comment","text":"Nice article, thank you!\nJust a questioni: What Is the performance impact of runtime validation?","datePublished":"2023-11-11T08:48:16.333Z","url":"https://daily.dev/posts/dcF5nrsBt#c-YBdYTeW4u","author":{"@type":"Person","name":"Apperside","url":"https://daily.dev/apperside","image":"https://avatars.githubusercontent.com/u/5955338?v=4"}}]}
```

