Skip to content

Commit

Permalink
chore: decoupling oas-normalize from being a dependency in oas
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Dec 19, 2024
1 parent 1c0625f commit 0b7f71a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion packages/oas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions packages/oas/src/reducer/index.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -81,7 +80,7 @@ export default function reducer(definition: OASDocument, opts: ReducerOptions =
const $refs: Set<string> = new Set();
const usedTags: Set<string> = new Set();

if (getAPIDefinitionType(definition) !== 'openapi') {
if (!definition.openapi) {
throw new Error('Sorry, only OpenAPI definitions are supported.');
}

Expand Down

0 comments on commit 0b7f71a

Please sign in to comment.