openapi-jsonschema-parameters
Advanced tools
Comparing version 0.4.0 to 0.5.0
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)); |
{ | ||
"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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19355
27
800