com.qdesrame.openapi.diff.model.ChangedParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-diff Show documentation
Show all versions of openapi-diff Show documentation
Utility for comparing two OpenAPI specifications.
The newest version!
package com.qdesrame.openapi.diff.model;
import io.swagger.v3.oas.models.parameters.Parameter;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
public class ChangedParameters implements Changed {
private List oldParameterList;
private List newParameterList;
private List increased;
private List missing;
private List changed;
public ChangedParameters(List oldParameterList, List newParameterList) {
this.oldParameterList = oldParameterList;
this.newParameterList = newParameterList;
this.increased = new ArrayList<>();
this.missing = new ArrayList<>();
this.changed = new ArrayList<>();
}
@Override
public boolean isDiff() {
return !increased.isEmpty() || !missing.isEmpty() || !changed.isEmpty();
}
@Override
public boolean isDiffBackwardCompatible() {
return increased.stream().noneMatch(Parameter::getRequired) && missing.isEmpty()
&& changed.stream().allMatch(ChangedParameter::isDiffBackwardCompatible);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy