Add SecuritySchemeDefinition to Swagger2Features in CXF

笑着哭i 提交于 2019-12-12 06:22:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!