
com.qdesrame.openapi.diff.model.ChangedPaths 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.
package com.qdesrame.openapi.diff.model;
import io.swagger.v3.oas.models.PathItem;
import lombok.Getter;
import lombok.Setter;
import java.util.LinkedHashMap;
import java.util.Map;
@Getter
@Setter
public class ChangedPaths implements Changed {
private Map oldPathMap;
private Map newPathMap;
private Map increased;
private Map missing;
private Map changed;
public ChangedPaths(Map oldPathMap, Map newPathMap) {
this.oldPathMap = oldPathMap;
this.newPathMap = newPathMap;
this.increased = new LinkedHashMap<>();
this.missing = new LinkedHashMap<>();
this.changed = new LinkedHashMap<>();
}
@Override
public boolean isDiff() {
return !increased.isEmpty() || !missing.isEmpty() || !changed.isEmpty();
}
@Override
public boolean isDiffBackwardCompatible() {
return missing.isEmpty() && changed.values().stream().allMatch(ChangedPath::isDiffBackwardCompatible);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy