Socket
Socket
Sign inDemoInstall

exegesis

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exegesis - npm Package Compare versions

Comparing version 2.5.7 to 3.0.0

16

lib/oas3/Schema/validators.js

@@ -69,16 +69,14 @@ "use strict";

function addCustomFormats(ajv, customFormats) {
return Object.keys(customFormats).reduce((result, key) => {
for (const key of Object.keys(customFormats)) {
const customFormat = customFormats[key];
if (typeof customFormat === 'function' || customFormat instanceof RegExp) {
result[key] = { type: 'string', validate: customFormat };
ajv.addFormat(key, { type: 'string', validate: customFormat });
}
else if (customFormat.type === 'string') {
result[key] = { type: 'string', validate: customFormat.validate };
ajv.addFormat(key, { type: 'string', validate: customFormat.validate });
}
else if (customFormat.type === 'number') {
result[key] = { type: 'number', validate: customFormat.validate };
ajv.addFormat(key, { type: 'number', validate: customFormat.validate });
}
ajv.addFormat(key, result[key]);
return result;
}, {});
}
}

@@ -161,3 +159,3 @@ function removeExamples(schema) {

errors = ajvValidate.errors.map((err) => {
let pathPtr = err.dataPath || '';
let pathPtr = err.instancePath || '';
if (pathPtr.startsWith('/value')) {

@@ -210,4 +208,2 @@ pathPtr = pathPtr.slice(6);

removeAdditional: allowTypeCoercion ? 'failing' : false,
jsonPointers: true,
nullable: true,
allErrors: schemaContext.options.allErrors,

@@ -214,0 +210,0 @@ });

{
"name": "exegesis",
"version": "2.5.7",
"version": "3.0.0",
"description": "Parses OpenAPI documents",

@@ -54,3 +54,2 @@ "main": "lib/index.js",

"@types/json-schema": "^7.0.3",
"@types/json-schema-traverse": "^0.4.0",
"@types/lodash": "^4.14.132",

@@ -82,3 +81,3 @@ "@types/mocha": "^8.0.0",

"@apidevtools/json-schema-ref-parser": "^9.0.3",
"ajv": "^6.12.2",
"ajv": "^8.3.0",
"body-parser": "^1.18.3",

@@ -85,0 +84,0 @@ "content-type": "^1.0.4",

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