.partial() is ruining the error scope

When i add .partial() to my type it seems to ruin the custom error messages of the fields inside my type. I created a reproduction here: https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%2522arktype%2522%250A%250Aconst%2520productBase%2520%253D%2520type%28%257B%250A%2509dates%253A%2520type%28%257B%2520start%253A%2520%2522string%2522%252C%2520end%253A%2520%2522string%2522%2520%257D%29%250A%2509%2509.array%28%29%250A%2509%2509.atLeastLength%281%29%250A%2509%2509.configure%28%257B%2520message%253A%2520%2522Datess%2520are%2520required%2522%2520%257D%29%250A%257D%29%250A%250Aconst%2520ticket%2520%253D%2520type%28%257B%250A%2509%2522...%2522%253A%2520productBase%252C%250A%2509type%253A%2520%2522%27ticket%27%2522%250A%257D%29%250A%250Aconst%2520merchandise%2520%253D%2520type%28%257B%250A%2509%2522...%2522%253A%2520productBase%252C%250A%2509type%253A%2520%2522%27merchandise%27%2522%250A%257D%29%250A%250Aconst%2520Thing%2520%253D%2520type%28ticket%252C%2520%2522%257C%2522%252C%2520merchandise%29%250A%250A%252F%252F%2520Throws%2520correct%2520error%253A%2520%2522Datess%2520are%2520required%2522%250Aconst%2520out%2520%253D%2520Thing.from%28%257B%250A%2509type%253A%2520%2522ticket%2522%252C%250A%2509dates%253A%2520%255B%255D%250A%257D%29%250A%250A%252F%252F%2520Throws%2520incorrect%2520error%2520because%2520of%2520the%2520partial%28%29%253A%2520%2522dates_redeemable%2520must%2520be%2520exactly%2520length%25201%2520%28was%25200%29%2522%250Alet%2520otherOut%2520%253D%2520Thing.partial%28%29.from%28%257B%250A%2509type%253A%2520%2522ticket%2522%252C%250A%2509dates%253A%2520%255B%255D%250A%257D%29%250A
1 Reply
ssalbdivad
ssalbdivad3w ago
Hmm that is an interesting one, I will have to look into it. Thanks for reporting it! (the issue is here for posterity): https://github.com/arktypeio/arktype/issues/1492
GitHub
.partial() is ignoring custom error messages on fields in a type ·...
Report a bug When using .partial() on a type the custom errors of the fields in that type get voided. 🔎 Search Terms partial, custom error 🧩 Context ArkType version: 2.1.20 🧑‍💻 Repro Playground Lin...

Did you find this page helpful?