next-openapi-gen 0.6.8 → 0.6.9

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.
@@ -92,15 +92,15 @@ async function installDependencies(ui) {
92
92
  function extendOpenApiTemplate(spec, options) {
93
93
  spec.ui = options.ui ?? spec.ui;
94
94
  spec.docsUrl = options.docsUrl ?? spec.docsUrl;
95
- spec.schemaType = options.schemaType ?? spec.schemaType;
95
+ spec.schemaType = options.schema ?? spec.schemaType;
96
96
  }
97
97
  export async function init(options) {
98
- const { ui, docsUrl, schemaType } = options;
98
+ const { ui } = options;
99
99
  spinner.start();
100
100
  try {
101
101
  const outputPath = path.join(process.cwd(), "next.openapi.json");
102
102
  const template = { ...openapiTemplate };
103
- extendOpenApiTemplate(template, { docsUrl, ui, schemaType });
103
+ extendOpenApiTemplate(template, options);
104
104
  await fse.writeJson(outputPath, template, { spaces: 2 });
105
105
  spinner.succeed(`Created OpenAPI template in next.openapi.json`);
106
106
  createDocsPage(ui, template.outputFile);
package/dist/index.js CHANGED
@@ -13,7 +13,9 @@ program
13
13
  .choices(["scalar", "swagger", "redoc", "stoplight", "rapidoc"])
14
14
  .default("swagger"))
15
15
  .option("-u, --docs-url <url>", "Specify the docs URL", "api-docs")
16
- .option("-s, --schema <schemaType>", "Specify the schema type", "zod")
16
+ .addOption(new Option("-s, --schema <schemaType>", "Specify the schema tool")
17
+ .choices(["zod", "typescript"])
18
+ .default("zod"))
17
19
  .description("Initialize a openapi specification")
18
20
  .action(init);
19
21
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-openapi-gen",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
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",