Skip to content
Discussion options

You must be logged in to vote

Hello 👋

The bounded cast at the storage boundary is the intended pattern, and there's no built-in narrower from unknown to InputJsonValue.

On Prisma exports, the runtime package gives you JsonValue, InputJsonValue, JsonObject, InputJsonObject, JsonArray, and InputJsonArray as types only. There's no isInputJsonValue runtime helper or branded validator. The Input variants exclude null because writes need Prisma.JsonNull or Prisma.DbNull explicitly, which is why you can't round-trip a JsonValue read straight back as an InputJsonValue write.

On Zod integrations, nothing produces types that drop in for InputJsonValue. prisma-json-types-generator works on the output side, making JsonValue more …

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by TomasTokaMrazek
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants