New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

openapi-enforcer

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-enforcer - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

4

bin/data-type-formats.js

@@ -212,3 +212,3 @@ /**

function randomBuffer (divider) {
return function (schema, { randomNumber }) {
return function ({ schema }, { randomNumber }) {
const hasMin = schema.hasOwnProperty('minLength');

@@ -239,3 +239,3 @@ const hasMax = schema.hasOwnProperty('maxLength');

function randomDate(schema, { randomNumber }) {
function randomDate({ schema }, { randomNumber }) {
const fiveYears = 157248000000; // 5 years in milliseconds

@@ -242,0 +242,0 @@ const hasMin = schema.hasOwnProperty('minimum');

@@ -140,3 +140,3 @@ /**

if (dataType) {
parent[property] = dataType.random(schema, { chooseOne, randomNumber, randomText });
parent[property] = dataType.random({ exception, schema }, { chooseOne, randomNumber, randomText });

@@ -143,0 +143,0 @@ } else if (type === 'boolean') {

@@ -292,11 +292,11 @@ # Schema

- *deserialize* [`function`] - The function to call to deserialize the value. It receives two parameters: `exception` for reporting errors and `value` which contains the serialized value. This function should return the deserialized value. Within the function `this` is the schema instance.
- *deserialize* [`function`] - The function to call to deserialize the value. It receives one parameter, an object, with properties `exception`, `schema`, and `value` which contains the serialized value. This function should return the deserialized value.
- *isNumeric* [`boolean`] - If this value is numeric then it allows the schema properties `maximum`, `minimum`, `exclusiveMaximum`, `exclusiveMinimum`, and `multipleOf`. Defaults to `true` if the type is `integer` or `number`, otherwise `false`.
- *random* [`function`] - The function to call to generate a random deserialized value. It receives one parameter, `exception` for reporting errors. The function should return the deserialized value. Within the function `this` is the schema instance.
- *random* [`function`] - The function to call to generate a random deserialized value. It receives one parameter, an object, with properties `exception` and `schema`. The function should return the deserialized value.
- *serialize* [`function`] - The function to call to serialize the value. It receives two parameters: `exception` for reporting errors and `value` which contains the deserialized value. This function should return the serialized value. Within the function `this` is the schema instance.
- *serialize* [`function`] - The function to call to serialize the value. It receives one parameter, an object, with properties `exception`, `schema`, and `value` which contains the deserialized value. This function should return the serialized value.
- *validate* [`function`] - The function to call to validate the deserialized value. It receives two parameters: `exception` for reporting errors and `value` which contains the deserialized value. This function does not need to return anything.
- *validate* [`function`] - The function to call to validate the deserialized value. It receives one parameter, and object, with the properties `exception`, `schema`, and `value` which contains the deserialized value. This function does not need to return anything and can report errors via the `exception` object.

@@ -303,0 +303,0 @@ **Returns:** `undefined`.

{
"name": "openapi-enforcer",
"version": "1.1.1",
"version": "1.1.2",
"description": "Library for validating, parsing, and formatting data against open api schemas.",

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