|
@@ -54,14 +54,15 @@ public class SpringDocConfig {
|
|
|
openApi.externalDocs(properties.getExternalDocs());
|
|
openApi.externalDocs(properties.getExternalDocs());
|
|
|
openApi.tags(properties.getTags());
|
|
openApi.tags(properties.getTags());
|
|
|
openApi.paths(properties.getPaths());
|
|
openApi.paths(properties.getPaths());
|
|
|
- openApi.components(properties.getComponents());
|
|
|
|
|
- Set<String> keySet = properties.getComponents().getSecuritySchemes().keySet();
|
|
|
|
|
- List<SecurityRequirement> list = new ArrayList<>();
|
|
|
|
|
- SecurityRequirement securityRequirement = new SecurityRequirement();
|
|
|
|
|
- keySet.forEach(securityRequirement::addList);
|
|
|
|
|
- list.add(securityRequirement);
|
|
|
|
|
- openApi.security(list);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (properties.getComponents() != null) {
|
|
|
|
|
+ openApi.components(properties.getComponents());
|
|
|
|
|
+ Set<String> keySet = properties.getComponents().getSecuritySchemes().keySet();
|
|
|
|
|
+ List<SecurityRequirement> list = new ArrayList<>();
|
|
|
|
|
+ SecurityRequirement securityRequirement = new SecurityRequirement();
|
|
|
|
|
+ keySet.forEach(securityRequirement::addList);
|
|
|
|
|
+ list.add(securityRequirement);
|
|
|
|
|
+ openApi.security(list);
|
|
|
|
|
+ }
|
|
|
return openApi;
|
|
return openApi;
|
|
|
}
|
|
}
|
|
|
|
|
|