Skip to main content

pre-defined-security-requirement-scheme

Overview

This rule belongs to the swagger-v2-standards-validation ruleset and states that:

The name specified for the security scheme in the Security Requirement Object must correspond with a Security Scheme definition in the Security Definitions Object.

PropertyValue
EnabledYes
Maximum SeverityError
MessageThe security scheme name does not exist in the Security Definitions Object.
CodeSWAGGER20STANDARDS_V411
TypeValidation
Rule SystemSemantic
Broad CategorySecurity Requirements
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation name security definitions security definitions object security scheme security

Suggested Fixes

  • Add a definition for the security scheme under the Security Definitions Object security schemes if you haven't added already.
  • Make sure that the name assigned to the security scheme in the Security Requirement Object matches exactly with the name of a pre-defined security scheme under the Security Definitions Object security schemes. Names are compared in a case-sensitive manner.
  • If added by mistake, remove the undefined security scheme name entry from the Security Scheme Object.

For More Information