1

I want to iterate over a JSON file and generate schema for it. I am using GENson tool. Similar to this question JSON Schema Generator Python. But instead of

{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
     "name": {
       "type": [
        "string"
      ]
   }
},
  "required": [
    "name"
  ]
}

I want the output to be:

{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
     "name": {
       "type": [
        "string"
      ]
    }
  }
}

That is: I don't want every property to be required.

ray an
  • 1,132
  • 3
  • 17
  • 42
  • so what have you tried so far? – Ether May 25 '20 at 17:44
  • I was looking for some default options in the documentation which generates schema similar to my requirements. I could not find much. Then I wrote a python code myself to remove `required` key recursively given a schema – ray an May 26 '20 at 09:29

0 Answers0