Validate API responses in Nango functions
Use Zod to validate data you receive from and send to external APIs. The CLI will also surface type errors during dry runs when using the--validation option.
Validate Nango function responses in your app
TypeScript types (compile-time)
Usez.infer to derive TypeScript types from your Zod schemas and export them from your sync/action files:
JSON Schema (runtime, language-agnostic)
When you runnango compile or nango deploy, Nango generates a nango.json file in the .nango folder. Each sync/action entry includes a json_schema property with the JSON Schema for its models:
json_schema object for a given sync or action and use it with any JSON Schema validator in your language of choice (e.g., ajv in TypeScript, jsonschema in Python, jsonschema in Rust, santhosh-tekuri/jsonschema in Go).
Alternatively, Zod v4 supports JSON Schema conversion natively with z.toJSONSchema():