FAQ

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

    missingType


    missingType will check that all schemas and their properties have a type field defined. This helps ensure that your OpenAPI specification is explicit about the data types expected for each schema and property.

    The function intelligently skips schemas where type can be inferred or is not required:

    • Schemas with enum or const values (type can be inferred)
    • Polymorphic schemas (allOf, oneOf, anyOf)
    • Schemas where structure implies type (has properties, items, additionalProperties, or patternProperties)

    Example ruleset configuration

    oas-missing-type:
      description: "Schemas and properties must have a type defined"
      type: "validation"
      recommended: true
      severity: "info"
      given: "$"
      then:
        function: "missingType"
    

    The function is used by the oas-missing-type Rule


    View Function Source