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

openapi-police

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-police - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

1

dist/schema-object.d.ts

@@ -14,3 +14,2 @@ import { Schema, ValidationOptions } from 'jsonpolice';

protected typeValidator(data: any, spec: any, path: string, opts: SchemaObjectOptions): any;
protected formatValidator(data: any, spec: any, path: string, opts: SchemaObjectOptions): any;
protected discriminatorValidator(data: any, spec: any, path: string, opts: SchemaObjectOptions): any;

@@ -17,0 +16,0 @@ protected anyOfValidator(data: any, spec: any, path: string, opts: SchemaObjectOptions): any;

17

dist/schema-object.js

@@ -37,3 +37,3 @@ "use strict";

'oneOf',
'not'
'not',
]);

@@ -82,11 +82,2 @@ }

}
formatValidator(data, spec, path, opts) {
if (typeof data === 'string') {
if (typeof spec.format !== 'string') {
throw jsonpolice_1.Schema.error(spec, 'format');
}
// TODO validate format
}
return data;
}
discriminatorValidator(data, spec, path, opts) {

@@ -99,3 +90,3 @@ if (spec.discriminator === null || typeof spec.discriminator !== 'object' || typeof spec.discriminator.propertyName !== 'string') {

throw new jsonpolice_1.ValidationError(path, jsonpolice_1.Schema.scope(spec), 'discriminator', [
new jsonpolice_1.ValidationError(`${path}/${spec.discriminator.propertyName}`, jsonpolice_1.Schema.scope(spec), 'required')
new jsonpolice_1.ValidationError(`${path}/${spec.discriminator.propertyName}`, jsonpolice_1.Schema.scope(spec), 'required'),
]);

@@ -118,3 +109,3 @@ }

const alts = spec.anyOf || spec.oneOf;
subSpec = alts.find(s => jsonpolice_1.Schema.scope(s) === disc);
subSpec = alts.find((s) => jsonpolice_1.Schema.scope(s) === disc);
}

@@ -131,3 +122,3 @@ else {

const scope = jsonpolice_1.Schema.scope(spec);
subSpec.allOf = subSpec.allOf.filter(s => jsonpolice_1.Schema.scope(s) !== scope);
subSpec.allOf = subSpec.allOf.filter((s) => jsonpolice_1.Schema.scope(s) !== scope);
}

@@ -134,0 +125,0 @@ try {

{
"name": "openapi-police",
"version": "2.0.0",
"version": "3.0.0",
"description": "OpenAPI v3 validators and utilities",

@@ -73,3 +73,3 @@ "main": "dist/index.js",

"dependencies": {
"jsonpolice": "^9.0.0",
"jsonpolice": "^10.0.0",
"jsonref": "^7.0.0"

@@ -76,0 +76,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