oasOpSecurityDefined will check a specification to ensure each path operation has correctly defined security.

The function ensures any security schemes referenced in the operation, is present in the global specification security definition.

Example ruleset configuration

  description: "Check operation security is correctly defined"
  type: "validation"
  recommended: true
  severity: "error"
  given: "$"
    function: "oasOpSecurityDefined"

The function is used by the oas3-operation-security-defined Rule

View Function Source