A Prisma generator that automatically creates OpenAPI 3.1 specifications from your Prisma schema. Version 1.6.0 supports Prisma ^7.0.0 and generates OpenAPI schemas with type safety, relationship mapping, enum support, and customizable configuration. It also offers programmatic generation and JSDoc creation for TypeScript types. The package is actively maintained with monthly releases and includes a demo site.
npm install prisma-openapiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates both generator-based and programmatic usage to create OpenAPI schemas from Prisma models.
Upgrade Prisma to 7.0.0 or later, or use an older version of prisma-openapi (not available).
Remove the output line from schema.prisma if using the default 'openapi' directory.
Manually adjust schema names in generated OpenAPI output if needed.
Use `@openapi_enum` comment on enums to force OpenAPI enum schema.
Set 'type': 'module' in package.json or use .mjs extension.
Use `@openapi_ignore` on the foreign key field or manually specify relations.
Run `npm install -D prisma-openapi`. Note: peer dependency prisma@^7.0.0 must be installed.
Ensure schema.prisma contains: `generator openapi { provider = "prisma-openapi" }` and run `npx prisma generate`.Use named import: `import { generateOpenApiSchema } from 'prisma-openapi'`.Ensure Prisma version >=7.0.0 and schema is valid. Run `npx prisma validate`.
No dependency data recorded yet.