---
title: "Should we change the object schema?"
url: https://daily.dev/posts/should-we-change-the-object-schema--z09w2z8hc
source_url: https://valibot.dev/blog/should-we-change-the-object-schema
type: article
source: "Valibot: The modular and type safe schema library"
published: 2026-08-23T12:23:46.970Z
updated: 2026-08-23T12:58:24.942Z
tags: ["architecture", "typescript"]
reading_time: 3
upvotes: 0
comments: 0
language: 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.

# Should we change the object schema?

**[Valibot: The modular and type safe schema library](https://daily.dev/sources/valibot)** · 3 min read · 0 upvotes · 0 comments

## Summary

Valibot's maintainer opens a discussion about a proposed breaking change ahead of the v1 release candidate. Currently Valibot doesn't distinguish between missing and undefined object entries, which breaks TypeScript's exactOptionalPropertyTypes typing guarantees. The proposed fix (tracked in PR #1013) introduces a new undefinedable schema function alongside optional and nullable, but combining all three for every case would require up to 7 helper functions, which the author worries could hurt API ergonomics. Community feedback is requested on GitHub or social media before finalizing the design.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://valibot.dev/blog/should-we-change-the-object-schema>

## Questions this post answers

### How does Valibot currently handle missing versus undefined object properties with TypeScript's exactOptionalPropertyTypes?

Valibot does not currently distinguish between missing and undefined object entries, so a schema like v.object({ key: v.optional(v.string()) }) parses { key: undefined } without error and types output.key as a string, even though the actual value is undefined. This mismatch breaks type safety when TypeScript's exactOptionalPropertyTypes configuration is enabled.

_Track how Valibot resolves this exactOptionalPropertyTypes mismatch by following schema validation updates on daily.dev._

### What is the difference between Valibot's optional and undefinedable schema functions?

In Valibot's proposed design, optional (v.optional) allows an object entry to be missing entirely, while undefinedable (v.undefinedable) allows an entry to be present but explicitly set to undefined. Combining v.optional(v.undefinedable(v.string())) types a key as an optional string that may also be undefined, distinguishing missing from present-but-undefined values.

_Developers weighing schema library API changes can follow Valibot's design decisions on daily.dev._

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#typescript](https://daily.dev/tags/typescript)

[View this post on daily.dev](https://daily.dev/posts/should-we-change-the-object-schema--z09w2z8hc)
