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

openapi-jsonschema-parameters

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-jsonschema-parameters - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

test/data-driven/convert-a-nullable-query-param-to-json-schema-openapi3.js

21

index.js

@@ -9,3 +9,3 @@ module.exports = convert;

var pathSchema = getSchema(parameters, 'path');
var querySchema = getSchema(parameters, 'query');
var querySchema = getQuerySchema(parameters);

@@ -93,2 +93,21 @@ if (bodySchema) {

function getQuerySchema(parameters) {
var params = parameters.filter(byIn('query'));
var schema;
if (params.length) {
schema = {properties: {}};
params.forEach(function(param) {
var paramSchema = copyValidationKeywords(param.schema || param);
schema.properties[param.name] = handleNullable(param.schema || param, paramSchema);
});
schema.required = getRequiredParams(params);
}
return schema;
}
function getSchema(parameters, type) {

@@ -95,0 +114,0 @@ var params = parameters.filter(byIn(type));

2

package.json
{
"name": "openapi-jsonschema-parameters",
"version": "0.4.0",
"version": "0.5.0",
"description": "Converts openapi parameters to a jsonschema format.",

@@ -5,0 +5,0 @@ "scripts": {

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