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

openapi-fuzzer-core

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-fuzzer-core - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "openapi-fuzzer-core",
"version": "1.0.2",
"version": "1.0.3",
"description": "A library to generate random requests based on open-api specifications.",

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

const { klona } = require("klona");
const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete'];
const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete', 'head'];

@@ -145,2 +145,3 @@ class Swagger {

for (const value of values) {
if (typeof value === 'number' || typeof value === 'boolean') continue;
this.specs.push({

@@ -227,8 +228,10 @@ name: 'BODY',

const goldenCopy = this.fakeParameter(parameter);
for (const property of Object.keys(properties)) {
const fuzzValues = this.fuzzParameter(properties[property], nonPrimitives);
for (const fuzzValue of fuzzValues) {
const fake = klona(goldenCopy);
fake[property] = fuzzValue;
values.push(fake);
if (properties) {
for (const property of Object.keys(properties)) {
const fuzzValues = this.fuzzParameter(properties[property], nonPrimitives);
for (const fuzzValue of fuzzValues) {
const fake = klona(goldenCopy);
fake[property] = fuzzValue;
values.push(fake);
}
}

@@ -248,3 +251,3 @@ }

let fake;
const properties = parameter.properties;
const { example, properties } = parameter;
switch (parameter.type) {

@@ -262,4 +265,8 @@ case 'integer':

fake = {};
for (const property of Object.keys(properties)) {
fake[property] = this.fakeParameter(properties[property]);
if (properties) {
for (const property of Object.keys(properties)) {
fake[property] = this.fakeParameter(properties[property]);
}
} else if (example) {
fake = example;
}

@@ -266,0 +273,0 @@ return fake;

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