Skip to content

Commit

Permalink
add definer argument
Browse files Browse the repository at this point in the history
  • Loading branch information
omermecitoglu committed Sep 5, 2024
1 parent e31e6c9 commit 9390232
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/core/arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ const argv = yargs
demandOption: false,
default: null,
})
.option("definer", {
describe: "Specify the name of definer function",
type: "string",
demandOption: false,
})
.argv;

type RemoveKeys<T, K extends keyof T> = {
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import findPredefinedSchemas from "./core/schemas";
const schemaPaths = await getArgument("schemas");
const schemas = await findPredefinedSchemas(schemaPaths);

const spec = await generateOpenApiSpec(schemas);
const routeDefinerName = await getArgument("definer");

const spec = await generateOpenApiSpec(schemas, {
routeDefinerName,
});
if (!spec.paths) throw new Error("Couldn't find any valid path");

if (spec.components.schemas) {
Expand Down

0 comments on commit 9390232

Please sign in to comment.