KaiZen-OpenAPI-Editor icon indicating copy to clipboard operation
KaiZen-OpenAPI-Editor copied to clipboard

Better code assist for security requirements

Open tedepstein opened this issue 8 years ago • 1 comments

securityDefinitions allows you to define security schemes; then the security property, applicable at multiple levels and called a "security requirements" object, allows you to apply a security scheme.

The security requirements object is a array of objects. Each object is a map, where the key (i.e. property name) is the name of a security definition, and the value is an array of OAuth roles or (potentially) other meta-information that further specifies the application of the security scheme in context.

If there are no such parameters (which there aren't, for type except OAuth), you have to use an empty array.

securityDefinitions:
  api_key:
      type: apiKey
      name: api_key
      in: header
      
security: {
  [
    {
      "api_key : []
    }
  ]
}

(The security requirements object is broken out into JSON syntax for clarity.)

Our code assist doesn't do a great job with security requirements. It should offer the names of defined security schemes as the key. Right now it just puts _key_, doesn't even display a suggestion list. No real help for values either.

tedepstein avatar Dec 16 '16 15:12 tedepstein

Related issue: #227

tedepstein avatar Sep 22 '17 15:09 tedepstein