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

@seriousme/openapi-schema-validator

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seriousme/openapi-schema-validator - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

4

CHANGELOG.md

@@ -6,2 +6,6 @@ # Changelog

## [v1.1.2] 14-05-2021
### Changed
- Added Node 10 support
## [v1.1.1] 14-05-2021

@@ -8,0 +12,0 @@ ### Changed

14

index.js
const Ajv = require("ajv");
const Ajv2020 = require("ajv/dist/2020.js");
const JSYaml = require("js-yaml");
const { readFile } = require("fs/promises");
const util = require("util");
const fs = require("fs");
const readFile = util.promisify(fs.readFile);
const { resolve } = require("./resolve.js");

@@ -45,3 +48,3 @@

module.exports = class Validator {
class Validator {
constructor(ajvOptions = { strict: false, validateFormats: false }) {

@@ -56,4 +59,2 @@ this.ajvOptions = ajvOptions;

static supportedVersions = openApiVersions;
async validate(data) {

@@ -90,2 +91,5 @@ const specification = await getSpecFromData(data);

}
};
}
Validator.supportedVersions = openApiVersions;
module.exports = Validator;
{
"name": "@seriousme/openapi-schema-validator",
"version": "1.1.1",
"version": "1.1.2",
"description": "Validate OpenApi specifications against their JSON schema",

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

@@ -19,6 +19,11 @@ function escapeJsonPointer(str) {

function fromEntries(iterable) {
return [...iterable].reduce((obj, [key, val]) => {
obj[key] = val;
return obj;
}, {});
}
const filtered = (raw) =>
Object.fromEntries(
Object.entries(raw).filter(([key, _]) => !pointerWords.has(key))
);
fromEntries(Object.entries(raw).filter(([key, _]) => !pointerWords.has(key)));

@@ -25,0 +30,0 @@ function resolveUri(uri, anchors) {

const { test } = require("tap");
const Validator = require("../index.js");
const { readFile } = require("fs/promises");
const util = require("util");
const fs = require("fs");
const readFile = util.promisify(fs.readFile);
const localFile = (fileName) =>

@@ -10,3 +13,2 @@ new URL(fileName, `file://${__dirname}/`).pathname;

const invalidSpec = require(`./validation/invalid-spec.json`);
const { resolveSchema } = require("ajv/dist/compile");
const yamlFileName = localFile(`./validation/petstore-openapi.v3.yaml`);

@@ -13,0 +15,0 @@

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