Json Schema Form

140 views Asked by At

I am using Json Schema Form to render the UI in my ReactTs project.

I was playing around with their playground and everything is working as expected. But when I am using the same schema into my app, the boolean(automatic) is not checked, even if the default is set to true:

{
  "type": "object",
  "properties": {
    "automatic": {
      "default": true,
      "description": "Automatically calculation of the offset",
      "title": "Automatic",
      "type": "boolean"
    },
    "age": {
      "type": "integer",
      "title": "Age"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "anyOf": [
          {
            "properties": {
              "foo": {
                "type": "string"
              }
            }
          },
          {
            "properties": {
              "bar": {
                "type": "string"
              }
            }
          }
        ]
      }
    }
  },
  "anyOf": [
    {
      "title": "First method of identification",
      "properties": {
        "firstName": {
          "type": "string",
          "title": "First name",
          "default": "Chuck"
        },
        "lastName": {
          "type": "string",
          "title": "Last name"
        }
      }
    },
    {
      "title": "Second method of identification",
      "properties": {
        "idCode": {
          "type": "string",
          "title": "ID code"
        }
      }
    }
  ]
}

Is there anything which I am missing?

0

There are 0 answers