Skip to content

Support for allOf and if statements #4

@akshaypatidar1999

Description

@akshaypatidar1999

We have json schema containing allOf and if keywords. Currently if we generate README we get empty object for config. Can we add support for these keywords as well.

{
  "type": "object",
  "properties": {
    
    "key": {
      "type": "object",
      "properties": {
        "prop1": {
          "type": "string",
          "enum": [
            "v1",
            "v2"
          ]
        },
        "config": {
          "type": "object"
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "prop1": {
                "const": "v1"
              }
            },
          },
          "then": {
            "properties": {
              "config": {
                "properties": {
                  "prop2": {
                    "type": "boolean"
                  }
               }
              ,
              "additionalProperties": false}  
            }
          }
        },
        {
          "if": {
            "properties": {
              "prop1": {
                "const": "v2"
              }
            },
          },
          "then": {
            "properties": {
              "config": {
                "properties": {
                  "prop3": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }  
            }
          }
        }
      ]
    }
  },
  "additionalProperties": false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions