use of io.apicurio.datamodels.openapi.v2.models.Oas20SecurityRequirement in project apicurio-data-models by Apicurio.
the class Oas20to30TransformationVisitor method visitSecurityRequirement.
/**
* @see io.apicurio.datamodels.core.visitors.IVisitor#visitSecurityRequirement(io.apicurio.datamodels.core.models.common.SecurityRequirement)
*/
@Override
public void visitSecurityRequirement(SecurityRequirement node) {
Oas20SecurityRequirement req = (Oas20SecurityRequirement) node;
ISecurityRequirementParent parent30 = (ISecurityRequirementParent) this.lookup(req.parent());
Oas30SecurityRequirement securityRequirement30 = (Oas30SecurityRequirement) parent30.createSecurityRequirement();
parent30.addSecurityRequirement(securityRequirement30);
req.getSecurityRequirementNames().forEach(name -> {
securityRequirement30.addSecurityRequirementItem(name, req.getScopes(name));
});
this.mapNode(req, securityRequirement30);
}
Aggregations