New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@scalar/oas-utils

Package Overview
Dependencies
Maintainers
0
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/oas-utils - npm Package Compare versions

Comparing version 0.2.78 to 0.2.79

8

CHANGELOG.md
# @scalar/oas-utils
## 0.2.79
### Patch Changes
- 6dd7eda: fix: catch errors for invalid OpenAPI documents
- Updated dependencies [1b06f64]
- @scalar/themes@0.9.50
## 0.2.78

@@ -4,0 +12,0 @@

9

dist/transforms/import-spec.d.ts

@@ -8,4 +8,11 @@ import { type Collection, type CollectionPayload, type Request, type RequestExample, type Server, type Tag } from '../entities/spec/index.js';

export declare const parseSchema: (spec: string | UnknownObject) => Promise<{
/**
* Temporary fix for the parser returning an empty array
* TODO: remove this once the parser is fixed
*/
schema: OpenAPIV3.Document | OpenAPIV3_1.Document;
errors: import("@scalar/openapi-parser").ErrorObject[];
errors: ({
code: any;
message: any;
} | import("@scalar/openapi-parser").ErrorObject)[];
}>;

@@ -12,0 +19,0 @@ export type ImportSpecToWorkspaceArgs = Pick<CollectionPayload, 'documentUrl' | 'watchMode'> & Pick<ReferenceConfiguration, 'authentication' | 'baseServerURL' | 'servers'> & {

@@ -15,6 +15,23 @@ import { securitySchemeSchema } from '../entities/spec/security.js';

// @see packages/api-reference/src/helpers/parse.ts
const { filesystem } = await load(spec);
const { filesystem, errors: loadErrors = [] } = await load(spec).catch((e) => ({
errors: [
{
code: e.code,
message: e.message,
},
],
filesystem: [],
}));
const { specification } = upgrade(filesystem);
const { schema, errors = [] } = await dereference(specification);
return { schema: schema, errors };
const { schema, errors: derefErrors = [] } = await dereference(specification);
if (!schema)
console.warn('[@scalar/oas-utils] OpenAPI Parser Warning: Schema is undefined');
return {
/**
* Temporary fix for the parser returning an empty array
* TODO: remove this once the parser is fixed
*/
schema: (Array.isArray(schema) ? {} : schema),
errors: [...loadErrors, ...derefErrors],
};
};

@@ -21,0 +38,0 @@ /**

12

package.json

@@ -19,3 +19,3 @@ {

],
"version": "0.2.78",
"version": "0.2.79",
"engines": {

@@ -116,5 +116,5 @@ "node": ">=18"

"@scalar/object-utils": "1.1.12",
"@scalar/themes": "0.9.49",
"@scalar/types": "0.0.20",
"@scalar/openapi-types": "0.1.5"
"@scalar/openapi-types": "0.1.5",
"@scalar/themes": "0.9.50",
"@scalar/types": "0.0.20"
},

@@ -127,4 +127,4 @@ "devDependencies": {

"@scalar/build-tooling": "0.1.12",
"@scalar/openapi-types": "0.1.5",
"@scalar/openapi-parser": "0.8.10"
"@scalar/openapi-parser": "0.8.10",
"@scalar/openapi-types": "0.1.5"
},

@@ -131,0 +131,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc