title: JSON SChema to JSON Object
body: <p>Can anyone help me to create the code to generate Sample JSON using JSON Schema in javascript.
  I have a JSON Schema as input and I have to get JSON as output after javascript transformation.</p>
  
  <p>The code should be dynamic.</p>
  
  <p>example:</p>
  
  <p><strong>JSON SCHEMA--</strong></p>
  
  <pre><code>{
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "object",
      "properties": {
          "glossary": {
              "type": "object",
              "properties": {
                  "title": {
                      "type": "string"
                  },
                  "GlossDiv": {
                      "type": "object",
                      "properties": {
                          "title": {
                              "type": "string"
                          },
                          "GlossList": {
                              "type": "object",
                              "properties": {
                                  "GlossEntry": {
                                      "type": "object",
                                      "properties": {
                                          "ID": {
                                              "type": "string"
                                          },
                                          "SortAs": {
                                              "type": "string"
                                          },
                                          "GlossTerm": {
                                              "type": "string"
                                          },
                                          "Acronym": {
                                              "type": "string"
                                          },
                                          "Abbrev": {
                                              "type": "string"
                                          },
                                          "GlossDef": {
                                              "type": "object",
                                              "properties": {
                                                  "para": {
                                                      "type": "string"
                                                  },
                                                  "GlossSeeAlso": {
                                                      "type": "array",
                                                      "items": [
                                                          {
                                                              "type": "string"
                                                          }, {
                                                              "type": "string"
                                                          }
                                                      ]
                                                  }
                                              },
                                              "required": [
                                                  "para", "GlossSeeAlso"
                                              ]
                                          },
                                          "GlossSee": {
                                              "type": "string"
                                          }
                                      },
                                      "required": [
                                          "ID", "SortAs", "GlossTerm", "Acronym", "Abbrev", "GlossDef", "GlossSee"
                                      ]
                                  }
                              },
                              "required": [
                                  "GlossEntry"
                              ]
                          }
                      },
                      "required": [
                          "title", "GlossList"
                      ]
                  }
              },
              "required": [
                  "title", "GlossDiv"
              ]
          }
      },
      "required": [
          "glossary"
      ]
  }
  </code></pre>
  
  <p><strong>JSON OUTPUT--</strong></p>
  
  <pre><code>{
      "glossary": {
          "title": "example glossary",
          "GlossDiv": {
              "title": "S",
              "GlossList": {
                  "GlossEntry": {
                      "ID": "SGML",
                      "SortAs": "SGML",
                      "GlossTerm": "Standard Generalized Markup Language",
                      "Acronym": "SGML",
                      "Abbrev": "ISO 8879:1986",
                      "GlossDef": {
                          "para": "A meta-markup language, used to create markup languages such as DocBook.",
                          "GlossSeeAlso": [
                              "GML", "XML"
                          ]
                      },
                      "GlossSee": "markup"
                  }
              }
          }
      }
  }
  </code></pre>