FAQ

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

    json-schema-patterns-valid


    Formats: Severity:

    This rule checks regular expressions used by JSON Schema keywords such as pattern and patternProperties.

    JSON Schema patterns use ECMA-262 regular expression syntax.

    Bad example

    {
      "type": "string",
      "pattern": "["
    }
    

    Good example

    {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    }
    

    How do I fix this violation?

    Fix the regular expression syntax.