openapi-typescript
Advanced tools
Comparing version 7.0.0-next.3 to 7.0.0-next.4
@@ -152,3 +152,3 @@ #!/usr/bin/env node | ||
? await loadConfig({ configPath: maybeRedoc }) | ||
: createConfig({}, { extends: ["minimal"] }); | ||
: await createConfig({}, { extends: ["minimal"] }); | ||
@@ -165,5 +165,9 @@ // handle Redoc APIs | ||
Object.entries(redoc.apis).map(async ([name, api]) => { | ||
const configRoot = redoc?.configFile | ||
? new URL(`file://${redoc.configFile}`) | ||
: CWD; | ||
let configRoot = CWD; | ||
if (redoc.configFile) { | ||
// note: this will be absolute if --redoc is passed; otherwise, relative | ||
configRoot = path.isAbsolute(redoc.configFile) | ||
? new URL(`file://${redoc.configFile}`) | ||
: new URL(redoc.configFile, `file://${process.cwd()}/`); | ||
} | ||
if (!api["openapi-ts"]?.output) { | ||
@@ -180,3 +184,3 @@ errorAndExit( | ||
fs.writeFileSync(outFile, result, "utf8"); | ||
done(name, api.root, performance.now() - timeStart); | ||
done(name, api["openapi-ts"].output, performance.now() - timeStart); | ||
}), | ||
@@ -183,0 +187,0 @@ ); |
@@ -30,3 +30,10 @@ import { createConfig } from "@redocly/openapi-core"; | ||
} | ||
const redoc = options.redocly ?? (await createConfig({}, { extends: ["minimal"] })); | ||
const redoc = options.redocly ?? | ||
(await createConfig({ | ||
styleguide: { | ||
rules: { | ||
"operation-operationId-unique": { severity: "error" }, | ||
}, | ||
}, | ||
}, { extends: ["minimal"] })); | ||
const schema = await validateAndBundle(source, { | ||
@@ -33,0 +40,0 @@ redoc, |
{ | ||
"name": "openapi-typescript", | ||
"description": "Convert OpenAPI 3.0 & 3.1 schemas to TypeScript", | ||
"version": "7.0.0-next.3", | ||
"version": "7.0.0-next.4", | ||
"author": { | ||
@@ -63,17 +63,16 @@ "name": "Drew Powers", | ||
"dependencies": { | ||
"@redocly/openapi-core": "^1.2.0", | ||
"@redocly/openapi-core": "^1.4.1", | ||
"ansi-colors": "^4.1.3", | ||
"supports-color": "^9.4.0", | ||
"typescript": "^5.2.2", | ||
"typescript": "^5.3.2", | ||
"yargs-parser": "^21.1.1" | ||
}, | ||
"devDependencies": { | ||
"@types/degit": "^2.8.4", | ||
"@types/js-yaml": "^4.0.6", | ||
"@types/node": "^20.8.0", | ||
"@types/degit": "^2.8.6", | ||
"@types/js-yaml": "^4.0.9", | ||
"@types/node": "^20.9.4", | ||
"degit": "^2.8.4", | ||
"del-cli": "^5.1.0", | ||
"esbuild": "^0.19.5", | ||
"esbuild": "^0.19.7", | ||
"execa": "^7.2.0", | ||
"vite": "^4.4.9", | ||
"vite-node": "^0.34.6", | ||
@@ -80,0 +79,0 @@ "vitest": "^0.34.6" |
@@ -51,3 +51,14 @@ import { createConfig } from "@redocly/openapi-core"; | ||
const redoc = | ||
options.redocly ?? (await createConfig({}, { extends: ["minimal"] })); | ||
options.redocly ?? | ||
(await createConfig( | ||
{ | ||
// @ts-expect-error This is OK | ||
styleguide: { | ||
rules: { | ||
"operation-operationId-unique": { severity: "error" }, // throw error on duplicate operationIDs | ||
}, | ||
}, | ||
}, | ||
{ extends: ["minimal"] }, | ||
)); | ||
@@ -54,0 +65,0 @@ const schema = await validateAndBundle(source, { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
408583
9
7720
Updated@redocly/openapi-core@^1.4.1
Updatedtypescript@^5.3.2