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

joi-to-json

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi-to-json - npm Package Compare versions

Comparing version

to
2.3.6

18

lib/parsers/json.js

@@ -423,10 +423,26 @@ /* eslint no-use-before-define: 'off' */

if (joiSpec.whens) {
schema.oneOf = []
const condition = joiSpec.whens[0]
schema.oneOf = []
if (condition.switch) {
for (const switchCondition of condition.switch) {
if (switchCondition.then) {
schema.oneOf.push(this.parse(switchCondition.then, definitions, level + 1))
}
if (switchCondition.otherwise) {
schema.oneOf.push(this.parse(switchCondition.otherwise, definitions, level + 1))
}
}
}
if (condition.then) {
schema.oneOf.push(this.parse(condition.then, definitions, level + 1))
}
if (condition.otherwise) {
schema.oneOf.push(this.parse(condition.otherwise, definitions, level + 1))
}
delete schema.type

@@ -433,0 +449,0 @@ return

2

package.json
{
"name": "joi-to-json",
"version": "2.3.5",
"version": "2.3.6",
"description": "joi to JSON / OpenAPI Schema Converter",

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