Skip to content

How to remove Top level document security #2304

@dbartumeu

Description

@dbartumeu

I'm adding JWT authorization to the document:

 document.AddSecurity("JWT", 
    Enumerable.Empty<string>(),
    new OpenApiSecurityScheme {
    Type = OpenApiSecuritySchemeType.ApiKey,
    Name = "Authorization",
    In = OpenApiSecurityApiKeyLocation.Header,
    Description = "Type into the textbox: Bearer {your JWT token}."
});

document.OperationProcessors.Add(
    new AspNetCoreOperationSecurityScopeProcessor("JWT")
        //new OperationSecurityScopeProcessor("JWT")
);

and for some reason in the swagger.json it appends the security to the whole document. Ex:

...
"security": [
    {
      "JWT": []
    }
  ]

is there a way to remove that section?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions