Skip to content

Bug Report: "string.date" only validates one field at a time inside a schema #1557

Description

@jd124sa

Report a bug

🔎 Search Terms

string.date

####Description

When using multiple "string.date" fields in an object schema, Arktype validates only one of them. The first invalid date triggers an error, but any additional invalid date fields are silently ignored.

🧩 Context

  System:
    OS: Linux 6.17 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 22.02 GB / 31.26 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.11.1 - /usr/bin/node
    npm: 11.6.4 - /usr/bin/npm
    pnpm: 10.23.0 - /usr/bin/pnpm
  npmPackages:
    @ark/schema:  0.55.0 
    @ark/util:  0.55.0 
    arktype: ^2.1.27 => 2.1.27 
    typescript: ^5.9.3 => 5.9.3 
### 🧑‍💻 Repro

Playground Link: https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%2522arktype%2522%250A%250Aconst%2520Thing%2520%253D%2520type%28%257B%250A%2520%2520%2520%2520date1%253A%2520%2522string.date%2522%252C%250A%2520%2520%2520%2520date2%253A%2520%2522string.date%2522%252C%250A%2520%2520%2520%2520date3%253A%2520%2522string.date%2522%252C%250A%257D%29%250A%250Aconst%2520out%2520%253D%2520Thing%28%257B%250A%2520%2520%2520%2520date1%253A%2520%2522%2522%252C%250A%2520%2520%2520%2520date2%253A%2520%2522%2522%252C%250A%2520%2520%2520%2520date3%253A%2520%2522%2522%252C%250A%257D%29

// Paste reproduction code here
import { type } from "arktype"

const Dates = type({
    date1: "string.date",
    date2: "string.date",
    date3: "string.date",
})

const out = Dates({
    date1: "",
    date2: "",
    date3: "",
})

if (out instanceof type.errors) {
    console.error(out.summary)
} else {
    console.log(`date1, ${out.date1}`)
    console.log(`date2, ${out.date2}`)
    console.log(`date3, ${out.date3}`)
}
  • result:
$ npx tsx ./index.ts
date1 must be a parsable date (was "")

Activity

  1. ssalbdivad commented on Dec 2, 2025

    @ssalbdivad
    Member

    Wow surprised this hasn't been logged before. It will be fixed in the next release- thanks for the report!

  2. moved this from To do to Implemented in arktypeioon Dec 2, 2025
  3. ssalbdivad commented on Dec 3, 2025

    @ssalbdivad
    Member

    fixed in 2.1.28

    #1558

  4. moved this from Implemented to Done (merged or closed) in arktypeioon Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

  • Status
    Done (merged or closed)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions