Channels
adxvcasas - Hello, so right now I have checkbox...
Field "doesHaveTCETAssitance" in model "AppoinmentSchedule" can't be a list. The current connector does not support lists of primitive types.Prisma
, because I set doesHaveTCETAssitance to doesHaveTCETAssitance String[]
which is not supported by prisma mysql.
```...shadi - hey everyone, i've been struggling with...
squibler. - Hi folks. I'm looking to validate a...
not in
a blacklist - like for example swear words. Enum does this for allowed strings, but I'm struggling to find something that will work for disallowed strings.
I have tried a regex - but my datasource has over 2000 disallowed words and regex would be too slow.
Basically I'm looking for something like:...adxvcasas - Hello everyone, How can I make the ...
dryRunDate
,dryRunStart
and dryRunEnd
dynamic?
so I have a type
who have a value of yes and no. Is it possible to make dryRunDate
,dryRunStart
and dryRunEnd
required if the user select yes
from type
?
this is my zod...Gludek - Heey, can I somehow extend/merge discr...
k9 - Is it expected that Zod would cause such a...
NODE_OPTIONS=--max-old-space-size=350
. But now the compilation phase dies with this error:...k9 - Hello! I'm getting up to speed. The Comple...
``ts
type GameId =
g${string}`;
const isGameId = (value: unknown): value is GameId => {...ramblings - Is there a way to make one field re...
Việt An - How to get better error messages?I h...
z.union([z.literal('Conan'), z.literal('Jordan'), z.literal('Sona')])
, when the value is not any of that, the default error message I get is Invalid literal value, expected "Conan"
, but I want it to say something like ...expected "Conan", "Jordan" or "Sona"
. How can I do that?...z.union
is similar to z.object
or z.array
in that is a kind of "container" schema that runs the interior schemas and collects any errors.Aidan647 - how can I validate other1 and other2...
other1
and other2
? (function validation is optional)
```ts
type demoFunction = {
(data: string): number[]
other1: number...Aidan647 - how can I do validation of zod in zo...
Rhys - const formSchema = z .object({ veh...
refine
approach is not a problem for you, it is probably the easier solution to maintain.
By flaky types I am referring to the fact that you cannot do exhaustive checks with TS like you can with discriminated unions:
```ts
// Refine approach
const data = formSchema.parse(...);...janglad - I may be missinng something here or m...
janglad - More of a general question? How do yo...
Alex - Hi there, I am trying to validate a numb...
z.coerce.number().int("Invalid Value").positive("Must be a positive number").safeParse(maxQuantity);
z.coerce.number().int("Invalid Value").positive("Must be a positive number").safeParse(maxQuantity);
Yamereee - Does anyone know how I can type this...
segfault - Hey! I'm currently testing my schema...
error.issues
field, which has the ZodIssue
type, it does not recognize the validation
field. I can see that it is present when I use a simple console.log
. Is there a workaround to access validation
with type checking activated?
Here is an example of the schema. It works fine in JavaScript or when TypeScript type checking is disabled.
```
import { z } from "zod";...janglad - This seems like it might be worth a b...
message
is being evaluated as truthy/falsy and thus an empty string isn't picked up
```ts
import z from 'zod';
...janglad - For Next JS users, how do you guys ha...
.setErrorMap()
does what I want it do but it'd ideally run once before anything else on both server boot/before first render on the client.
Is it a bad idea to just call the function in my main layout (server side) and then have an empty client component above children there that also just calls it on every render (putting in a useEffect won't work as that runs after first render)...