问题
I want to enable authorize button in my Swagger v2 API REST Documentation.
How can I define api_key security with Swagger2Features?
回答1:
swagger2Feature.setSecurityDefinitions(
Collections.singletonMap("apiKeySecurity", new io.swagger.models.auth.ApiKeyAuthDefinition()));
Make sure to use the latest CXF version as there were some bugfixes in this area.
来源:https://stackoverflow.com/questions/45034082/add-securityschemedefinition-to-swagger2features-in-cxf