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

openapi-police

Package Overview
Dependencies
Maintainers
1
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 1.0.3 to 1.0.4

2

dist/parameter.d.ts

@@ -9,4 +9,4 @@ import { ValidationOptions } from "jsonpolice";

coerceToType(data: string, type: string): any;
validate(data: any, opts?: ValidationOptions): Promise<any>;
validate(data: any, opts?: ValidationOptions, path?: string): Promise<any>;
protected typeValidator(data: any, spec: any, path: string, opts: ValidationOptions): any;
}

@@ -18,4 +18,4 @@ "use strict";

const stylesByLocation = {
path: ['simple', 'matrix', 'label'],
query: ['form', 'spaceDelimited', 'pipeDelimited', 'deepObject'],
path: ['simple', 'label', 'matrix'],
query: ['simple', 'spaceDelimited', 'pipeDelimited', 'deepObject'],
cookie: ['form'],

@@ -199,3 +199,3 @@ header: ['simple']

else if (type === 'number' || type === 'integer') {
out = parseInt(out);
out = parseFloat(out);
}

@@ -208,3 +208,3 @@ }

}
async validate(data, opts = {}) {
async validate(data, opts = {}, path = '') {
if (this.parameter.content) {

@@ -215,3 +215,3 @@ // TODO validate using the MediaTypeValidator for the correct media type

else {
return super.validate(data, opts);
return super.validate(data, opts, path);
}

@@ -232,3 +232,3 @@ }

if (this.parameter.required) {
throw new jsonpolice_1.ValidationError('', jsonpolice_1.Schema.scope(spec), 'required');
throw new jsonpolice_1.ValidationError(path, jsonpolice_1.Schema.scope(spec), 'required');
}

@@ -235,0 +235,0 @@ else {

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

if (typeof subSpec === 'undefined') {
throw jsonpolice_1.Schema.error(spec.discriminator, 'subschema');
throw jsonpolice_1.Schema.error(spec.discriminator, 'schema');
}

@@ -102,0 +102,0 @@ else {

{
"name": "openapi-police",
"version": "1.0.3",
"version": "1.0.4",
"description": "OpenAPI v3 validators and utilities",

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

"dependencies": {
"jsonpolice": "^8.0.2",
"jsonpolice": "^8.0.3",
"jsonref": "^5.1.1"

@@ -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