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

[Question] Override top level security on operation with empty security

Open tjholm opened this issue 3 years ago • 1 comments

When applying security rules to operations is it possible to set an empty list of security requirements without these being omitted on serialization?

I want to be able to disable top level security on individual operations, bit it seems that trying to set security: [] on an operation would have that value be omitted.

Is it possible to achieve this behaviour currently?

tjholm avatar May 18 '22 01:05 tjholm

I gather your code uses the openapi3filter package? In this case have you tried setting the *ValidationInputs to https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3filter#NoopAuthenticationFunc ?

fenollp avatar Jun 01 '22 17:06 fenollp