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

koa-spark

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-spark - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

21

dist/OpenApiBuilder.js

@@ -61,2 +61,5 @@ "use strict";

}
if (route.meta && route.meta.tags) {
operation.tags = Array.isArray(route.meta.tags) ? route.meta.tags : [route.meta.tags];
}
/**

@@ -74,7 +77,9 @@ * Request Body

try {
const { description, ...schema } = joi_to_json_schema_1.default(route.validate.params[paramName]);
return {
name: paramName,
description,
in: 'path',
required: true,
schema: joi_to_json_schema_1.default(route.validate.params[paramName])
schema
};

@@ -109,3 +114,3 @@ }

const path = typeof route.path === 'string'
? route.path.replace(/:(\w+)/, '{$1}')
? route.path.replace(/:(\w+)/g, '{$1}')
// TODO: warn the user that swagger doesn't accept regex as path

@@ -165,2 +170,14 @@ : route.path.toString();

const description = schema.description || '';
// Remove the `patterns: []` property from the schema
if (schema.properties) {
for (const propertySchema of Object.values(schema.properties)) {
if (propertySchema.items && propertySchema.items.patterns) {
// The property is an array, so definition is inside `items`
delete propertySchema.items.patterns;
}
else if (propertySchema.patterns) {
delete propertySchema.patterns;
}
}
}
delete schema.description;

@@ -167,0 +184,0 @@ delete schema.patterns;

2

package.json
{
"name": "koa-spark",
"version": "0.2.1",
"version": "0.2.2",
"description": "Koa utility pack",

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