openapi-client icon indicating copy to clipboard operation
openapi-client copied to clipboard

Allow security override of specific endpoints

Open johnsusek opened this issue 5 years ago • 0 comments

For an endpoint specified like this:

  /pets:
      get:
        description: Example
        security: []

Currently openapi-client still will add security to the endpoint, just because the array exists.

This change removes the security from the operation if an empty array is passed in.

This is discussed a little more here: https://github.com/OAI/OpenAPI-Specification/issues/14

I think this aligns with the spec because if you load a spec into the swagger editor with an endpoint like above, it won't show a lock icon, indicating there should not be auth.

Thanks!

johnsusek avatar Mar 10 '20 20:03 johnsusek