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.7 to 1.0.8

2

dist/index.d.ts
export * from 'jsonpolice';
export { ParameterError } from './errors';
export { ParameterObject } from './parameter';
export { SchemaObject } from './schema-object';
export { SchemaObject, SchemaObjectOptions } from './schema-object';
export { OpenAPIV3 } from './types';

@@ -1,3 +0,2 @@

import { ValidationOptions } from "jsonpolice";
import { SchemaObject } from "./schema-object";
import { SchemaObject, SchemaObjectOptions } from "./schema-object";
import { OpenAPIV3 } from "./types";

@@ -9,4 +8,4 @@ export declare class ParameterObject extends SchemaObject {

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

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

coerceToType(data, type) {
let out = this.parseStyle(data, type);
let out = data;
if (typeof out === 'string') {

@@ -230,2 +230,6 @@ if (type === 'boolean') {

if (typeof data === 'string') {
if (opts.parseStyle !== false) {
data = this.parseStyle(data, spec.type);
opts.parseStyle = false;
}
data = this.coerceToType(data, spec.type);

@@ -232,0 +236,0 @@ }

import { Schema, ValidationOptions } from 'jsonpolice';
import { OpenAPIV3 } from './types';
export interface SchemaObjectOptions extends ValidationOptions {
parseStyle?: boolean;
contentType?: string;
}
export declare class SchemaObject extends Schema {

@@ -8,7 +12,7 @@ protected _spec: Promise<OpenAPIV3.SchemaObject>;

protected readonly validators: Set<string>;
protected typeValidator(data: any, spec: any, path: string, opts: ValidationOptions): any;
protected formatValidator(data: any, spec: any, path: string, opts: ValidationOptions): any;
protected discriminatorValidator(data: any, spec: any, path: string, opts: ValidationOptions): any;
protected anyOfValidator(data: any, spec: any, path: string, opts: ValidationOptions): any;
protected oneOfValidator(data: any, spec: any, path: string, opts: ValidationOptions): any;
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;
protected anyOfValidator(data: any, spec: any, path: string, opts: SchemaObjectOptions): any;
protected oneOfValidator(data: any, spec: any, path: string, opts: SchemaObjectOptions): any;
}
{
"name": "openapi-police",
"version": "1.0.7",
"version": "1.0.8",
"description": "OpenAPI v3 validators and utilities",

@@ -5,0 +5,0 @@ "main": "dist/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