Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

api-doc-validator

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-doc-validator - npm Package Compare versions

Comparing version 2.7.6 to 2.8.0

8

lib/templates/api-createRequest.js

@@ -11,5 +11,2 @@

const ajv = Api.getAjv();
const errorHandler = context.errorHandler || Api.errorHandler;
let params = null;

@@ -47,2 +44,5 @@ let query = null;

const ajv = Api.getAjv({type: 'request', endpoint: e, context: this, meta});
const errorHandler = context.errorHandler || Api.errorHandler;
if (e.params) {

@@ -118,2 +118,4 @@ let {schema, validate} = e.params;

if (e.response) {
const ajv = Api.getAjv({type: 'response', endpoint: e, context: this, meta});
for (let i = 0, len = e.response.length; i < len; i++) {

@@ -120,0 +122,0 @@ let response = e.response[i];

Api.getAjv = function () {
let {ajv} = Api;
Api.getAjv = function ({type}) {
const key = type + 'Ajv';
let ajv = Api[key];
if (!ajv) {
const Ajv = require('ajv').default;
if (ajv) return ajv;
ajv = Api.ajv = new Ajv({coerceTypes: true});
const Ajv = require('ajv').default;
try {
var formatsFound = !!require.resolve('ajv-formats');
}
catch (err) {}
ajv = Api[key] = new Ajv({coerceTypes: type === 'response'});
if (formatsFound) {
require('ajv-formats')(ajv);
}
try {
var formatsFound = !!require.resolve('ajv-formats');
}
catch (err) {}
if (formatsFound) {
require('ajv-formats')(ajv);
}
return ajv;
};
{
"name": "api-doc-validator",
"version": "2.7.6",
"version": "2.8.0",
"description": "api doc and validator",

@@ -5,0 +5,0 @@ "main": "index.js",

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