FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • ✨ New! Try the OpenAPI Doctor ✨ The OpenAPI Doctor
    Recommended

    json-schema-composition-sanity


    Formats: Severity:

    This rule checks for shallow contradictions in composition keywords such as allOf, oneOf and anyOf.

    It does not try to solve general schema satisfiability. It only catches local contradictions that are cheap and clear.

    Bad example

    {
      "allOf": [
        { "type": "string" },
        { "type": "object" }
      ]
    }
    

    Good example

    {
      "allOf": [
        { "type": "object" },
        {
          "properties": {
            "size": {
              "type": "string"
            }
          }
        }
      ]
    }
    

    How do I fix this violation?

    Remove the contradiction, or split the schemas into separate alternatives.