@kubb/adapter-oas 5.0.0-beta.108 → 5.0.0-beta.109
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.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -27,7 +27,6 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
27
27
|
let node_path = require("node:path");
|
|
28
28
|
node_path = __toESM(node_path, 1);
|
|
29
29
|
let yaml = require("yaml");
|
|
30
|
-
let _readme_openapi_parser = require("@readme/openapi-parser");
|
|
31
30
|
let _scalar_openapi_upgrader = require("@scalar/openapi-upgrader");
|
|
32
31
|
let api_ref_bundler = require("api-ref-bundler");
|
|
33
32
|
let _kubb_kit = require("@kubb/kit");
|
|
@@ -529,9 +528,10 @@ function assertDocument(document) {
|
|
|
529
528
|
* ```
|
|
530
529
|
*/
|
|
531
530
|
async function validateDocument(document, { throwOnError = false } = {}) {
|
|
531
|
+
const { compileErrors, validate } = await import("@readme/openapi-parser");
|
|
532
532
|
try {
|
|
533
|
-
const result = await
|
|
534
|
-
if (!result.valid) throw new Error(
|
|
533
|
+
const result = await validate(structuredClone(document), { validate: { errors: { colorize: true } } });
|
|
534
|
+
if (!result.valid) throw new Error(compileErrors(result));
|
|
535
535
|
} catch (error) {
|
|
536
536
|
if (throwOnError) throw error;
|
|
537
537
|
}
|