generate-schema icon indicating copy to clipboard operation
generate-schema copied to clipboard

Child objects without conversion

Open abnerCrack opened this issue 9 years ago • 1 comments

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

abnerCrack avatar Oct 20 '16 10:10 abnerCrack

Would you expect the following instead?

              {
                "type": "object",
                "properties": {
                  "s": {
                    "type": "string"
                  }
                }
              }

nijikokun avatar Oct 24 '16 18:10 nijikokun