generate-schema
generate-schema copied to clipboard
Child objects without conversion
//code
var GenerateSchema = require('generate-schema')
var schema = GenerateSchema.json('Product', [
{
"test": [
{
"testchild1": "s",
"child2": [
1
]
}
],
"c": {
"a": [
"as.wYYYYY",
2,
{
"s": "s"
}
]
}
}
])
console.log(JSON.stringify(schema,null,2))
//result
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"s": {
"type": "string"
}
}
]
}
}
}
}
}
"s" is a object but do not have properties and type
Would you expect the following instead?
{
"type": "object",
"properties": {
"s": {
"type": "string"
}
}
}