-
-
Notifications
You must be signed in to change notification settings - Fork 407
Labels
bugSomething isn't workingSomething isn't working
Description
This code works as expected. However, some of the properties (templates
and Ts
in this case) are not defined in config's typescript types. and I am getting ts errors on them. I am using version: 13.1.1
import path from "path";
import { generateApi } from "swagger-typescript-api";
const basePath = path.resolve(process.cwd(), "./src/core/lib/@acme/api");
const run = async () => {
await generateApi({
fileName: "generatedApi.ts",
output: path.resolve(basePath, "__generated__"),
url: "http://localhost:4000/swagger/json",
generateResponses: true,
defaultResponseAsSuccess: true,
disableThrowOnError: true,
hooks: {
onFormatRouteName(routeInfo) {
return routeInfo.operationId.replaceAll(".", "_");
},
},
templates: path.resolve(basePath, "templates"),
Ts: {
IntersectionType: (contents) => {
const items = contents as string[];
return items.slice(1).reduce((a, b) => `Merge<${a}, ${b}>`, items[0])!;
},
},
});
};
void run();
samydoesit and js2me
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working