FAQ

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

    oas-schema-check


    Formats: Severity:

    This checks that all schemas have a valid type, and perform basic type validation on the schema based on the JSON Schema specification.

    The advisory check that compares required field names against declared properties is no longer part of this rule. It was split out into required-fields-defined, which is disabled by default.

    If you previously relied on oas-schema-check for that behavior, enable both rules in your ruleset.

    Why did this violation appear?

    The schema identified does not have a valid type. Allowed types:

    • string
    • number
    • integer
    • boolean
    • array
    • object

    If the schema does contain one of these types, it’s failed one of the other type checks, such as:

    String

    • minLength - The minimum length of the string
    • maxLength - The maximum length of the string
    • pattern - A ECMA-262 regular expression pattern to match against

    Number

    • minimum - The minimum value of the number
    • maximum - The maximum value of the number
    • exclusiveMinimum - The minimum value of the number, exclusive
    • exclusiveMaximum - The maximum value of the number, exclusive
    • multipleOf - The number must be a multiple of this value

    Object

    • minProperties - The minimum number of properties allowed
    • maxProperties - The maximum number of properties allowed

    Array

    • minItems - The minimum number of items allowed
    • maxItems - The maximum number of items allowed
    • minContains - The minimum number of items that must match the ‘contains’ schema
    • maxContains - The maximum number of items that must match the ‘contains’ schema

    For an advisory check that required field names are explicitly declared in properties, enable required-fields-defined alongside this rule.

    How do I fix this violation?

    Fix the schema type and corresponding type validation.