oas2OpSecurityDefined


oas2OpSecurityDefined 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

oas3-operation-security-defined:
  description: "Check operation security is correctly defined"
  type: "validation"
  recommended: true
  severity: "error"
  given: "$"
  then:
    function: "oas2OpSecurityDefined"

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


View Function Source