next-openapi-gen 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ export default function ApiDocsPage() {
11
11
  return (
12
12
  <ApiReferenceReact
13
13
  configuration={{
14
+ _integration: "nextjs",
14
15
  url: "/${outputFile}",
15
16
  }}
16
17
  />
@@ -511,6 +511,20 @@ export class ZodSchemaConverter {
511
511
  }
512
512
  return this.processZodChain(node);
513
513
  }
514
+ // Handle z.coerce.TYPE() patterns
515
+ if (t.isCallExpression(node) &&
516
+ t.isMemberExpression(node.callee) &&
517
+ t.isMemberExpression(node.callee.object) &&
518
+ t.isIdentifier(node.callee.object.object) &&
519
+ node.callee.object.object.name === "z" &&
520
+ t.isIdentifier(node.callee.object.property) &&
521
+ node.callee.object.property.name === "coerce" &&
522
+ t.isIdentifier(node.callee.property)) {
523
+ const coerceType = node.callee.property.name;
524
+ // Create a synthetic node for the underlying type using Babel types
525
+ const syntheticNode = t.callExpression(t.memberExpression(t.identifier("z"), t.identifier(coerceType)), []);
526
+ return this.processZodPrimitive(syntheticNode);
527
+ }
514
528
  // Handle z.object({...})
515
529
  if (t.isCallExpression(node) &&
516
530
  t.isMemberExpression(node.callee) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-openapi-gen",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Automatically generate OpenAPI 3.0 documentation from Next.js projects, with support for Zod schemas and TypeScript types.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",