use of org.eclipse.microprofile.openapi.models.security.SecurityRequirement in project wildfly-swarm by wildfly-swarm.
the class OpenApiSerializer method writeSecurity.
/**
* Writes the {@link SecurityRequirement} model array to the JSON tree.
* @param parent
* @param security
*/
private void writeSecurity(ObjectNode parent, List<SecurityRequirement> security) {
if (security == null) {
return;
}
ArrayNode array = parent.putArray(OpenApiConstants.PROP_SECURITY);
for (SecurityRequirement securityRequirement : security) {
ObjectNode srNode = array.addObject();
for (String fieldName : securityRequirement.keySet()) {
List<String> values = securityRequirement.get(fieldName);
ArrayNode valuesNode = srNode.putArray(fieldName);
if (values != null) {
for (String value : values) {
valuesNode.add(value);
}
}
}
}
}
Aggregations