diff --git a/package-lock.json b/package-lock.json index c8375012..6a0f84ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,7 @@ "requires": true, "packages": { "": { + "name": "oas", "workspaces": [ "./packages/*" ], @@ -13897,9 +13898,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -20621,7 +20622,6 @@ "jsonpath-plus": "^10.0.0", "jsonpointer": "^5.0.0", "memoizee": "^0.4.16", - "oas-normalize": "file:../oas-normalize", "openapi-types": "^12.1.1", "path-to-regexp": "^8.1.0", "remove-undefined-objects": "^5.0.0" diff --git a/package.json b/package.json index 0df6e734..779d7e8f 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "scripts": { "alex": "alex .", "attw": "npx lerna run attw --stream", + "bench": "vitest bench", "build": "npx lerna run build --stream", "clean": "npx lerna clean", "lint": "npm run lint:types && npm run lint:js && npm run prettier", diff --git a/packages/oas/package.json b/packages/oas/package.json index 7f31f499..a8d068b6 100644 --- a/packages/oas/package.json +++ b/packages/oas/package.json @@ -94,7 +94,6 @@ "jsonpath-plus": "^10.0.0", "jsonpointer": "^5.0.0", "memoizee": "^0.4.16", - "oas-normalize": "file:../oas-normalize", "openapi-types": "^12.1.1", "path-to-regexp": "^8.1.0", "remove-undefined-objects": "^5.0.0" diff --git a/packages/oas/src/reducer/index.ts b/packages/oas/src/reducer/index.ts index 5cec4cfa..0d80c430 100644 --- a/packages/oas/src/reducer/index.ts +++ b/packages/oas/src/reducer/index.ts @@ -1,7 +1,6 @@ import type { ComponentsObject, HttpMethods, OASDocument, TagObject } from '../types.js'; import jsonPointer from 'jsonpointer'; -import { getAPIDefinitionType } from 'oas-normalize/lib/utils'; import { query } from '../analyzer/util.js'; @@ -81,7 +80,7 @@ export default function reducer(definition: OASDocument, opts: ReducerOptions = const $refs: Set = new Set(); const usedTags: Set = new Set(); - if (getAPIDefinitionType(definition) !== 'openapi') { + if (!definition.openapi) { throw new Error('Sorry, only OpenAPI definitions are supported.'); }