get_zod_schema
Generate Zod validation schemas with TypeScript types from Pydantic models, FastAPI apps, or OpenAPI URLs, ensuring type-safe frontend validation that matches backend definitions.
Instructions
Generate Zod validation schemas with inferred TypeScript types from a Pydantic model, FastAPI app, or live OpenAPI URL.
Args: target: Target identifier (e.g. 'models.user:UserProfile', 'main:app', 'https://api.example.com/openapi.json'). project_dir: Optional path to the project root directory.
Returns: Zod schema definition code as a string, or an error dictionary.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| project_dir | No |