How to validate entire document without persisting data? #13730
Replies: 2 comments 2 replies
-
Can you maybe explain the use case of this functionality? What are you trying to build? |
Beta Was this translation helpful? Give feedback.
-
I’m building a lightweight AI agent that auto-fills Payload documents. My goal is for Payload CMS to be the single source of truth for validation—without duplicating schemas in Zod or other tools. After the AI generates a partial or full document, I’d like to send it to Payload and get validation results based on the exact same rules (native + custom validate functions), without needing to attempt a real write. Right now I see two imperfect options:
What would really help is a validate-only mode or endpoint, something like a dry-run that returns structured per-field results with 200 OK. That would let the agent iterate and fix issues before persisting anything. If anyone has suggestions on the best way to approach this with the current API, I’d love to hear them. And if the team thinks a dry-run validation feature makes sense, I’d be happy to try contributing a PR. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to validate entire document without persisting data?
I need to validate collection data using all custom
validate
functions without saving to database.Current Setup
What I Need
A built-in API to execute all field validations without persistence:
Use Cases
Currently no clean way exists to do this in Payload 3. Is this feature planned or is there an undocumented way?
Beta Was this translation helpful? Give feedback.
All reactions