diff --git a/core/pom.xml b/core/pom.xml index c6542256..a3a9d494 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -42,11 +42,6 @@ commons-httpclient commons-httpclient - - org.projectlombok - lombok - provided - org.junit.jupiter junit-jupiter diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/CacheKey.java b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/CacheKey.java index ccf03428..8300270e 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/CacheKey.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/CacheKey.java @@ -1,12 +1,54 @@ package com.qdesrame.openapi.diff.core.compare; import com.qdesrame.openapi.diff.core.model.DiffContext; -import lombok.Value; +import java.util.Objects; -@Value -public class CacheKey { +public final class CacheKey { + private final String left; + private final String right; + private final DiffContext context; - String left; - String right; - DiffContext context; + public CacheKey(final String left, final String right, final DiffContext context) { + this.left = left; + this.right = right; + this.context = context; + } + + public String getLeft() { + return this.left; + } + + public String getRight() { + return this.right; + } + + public DiffContext getContext() { + return this.context; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CacheKey cacheKey = (CacheKey) o; + return Objects.equals(left, cacheKey.left) + && Objects.equals(right, cacheKey.right) + && Objects.equals(context, cacheKey.context); + } + + @Override + public int hashCode() { + return Objects.hash(left, right, context); + } + + @java.lang.Override + public java.lang.String toString() { + return "CacheKey(left=" + + this.getLeft() + + ", right=" + + this.getRight() + + ", context=" + + this.getContext() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/OpenApiDiff.java b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/OpenApiDiff.java index af6c0624..10a30eca 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/OpenApiDiff.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/OpenApiDiff.java @@ -17,17 +17,12 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; -import lombok.Getter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@Getter public class OpenApiDiff { - public static final String SWAGGER_VERSION_V2 = "2.0"; - private static final Logger logger = LoggerFactory.getLogger(OpenApiDiff.class); - private PathsDiff pathsDiff; private PathDiff pathDiff; private SchemaDiff schemaDiff; @@ -47,7 +42,6 @@ public class OpenApiDiff { private OAuthFlowDiff oAuthFlowDiff; private ExtensionsDiff extensionsDiff; private MetadataDiff metadataDiff; - private final OpenAPI oldSpecOpenApi; private final OpenAPI newSpecOpenApi; private List newEndpoints; @@ -132,7 +126,6 @@ private void setChangedExtension(ChangedExtensions changedExtension) { private void preProcess(OpenAPI openApi) { List securityRequirements = openApi.getSecurity(); - if (securityRequirements != null) { List distinctSecurityRequirements = securityRequirements.stream().distinct().collect(Collectors.toList()); @@ -171,4 +164,104 @@ private ChangedOpenApi getChangedOpenApi() { .setChangedOperations(changedOperations) .setChangedExtensions(changedExtensions); } + + public PathsDiff getPathsDiff() { + return this.pathsDiff; + } + + public PathDiff getPathDiff() { + return this.pathDiff; + } + + public SchemaDiff getSchemaDiff() { + return this.schemaDiff; + } + + public ContentDiff getContentDiff() { + return this.contentDiff; + } + + public ParametersDiff getParametersDiff() { + return this.parametersDiff; + } + + public ParameterDiff getParameterDiff() { + return this.parameterDiff; + } + + public RequestBodyDiff getRequestBodyDiff() { + return this.requestBodyDiff; + } + + public ResponseDiff getResponseDiff() { + return this.responseDiff; + } + + public HeadersDiff getHeadersDiff() { + return this.headersDiff; + } + + public HeaderDiff getHeaderDiff() { + return this.headerDiff; + } + + public ApiResponseDiff getApiResponseDiff() { + return this.apiResponseDiff; + } + + public OperationDiff getOperationDiff() { + return this.operationDiff; + } + + public SecurityRequirementsDiff getSecurityRequirementsDiff() { + return this.securityRequirementsDiff; + } + + public SecurityRequirementDiff getSecurityRequirementDiff() { + return this.securityRequirementDiff; + } + + public SecuritySchemeDiff getSecuritySchemeDiff() { + return this.securitySchemeDiff; + } + + public OAuthFlowsDiff getOAuthFlowsDiff() { + return this.oAuthFlowsDiff; + } + + public OAuthFlowDiff getOAuthFlowDiff() { + return this.oAuthFlowDiff; + } + + public ExtensionsDiff getExtensionsDiff() { + return this.extensionsDiff; + } + + public MetadataDiff getMetadataDiff() { + return this.metadataDiff; + } + + public OpenAPI getOldSpecOpenApi() { + return this.oldSpecOpenApi; + } + + public OpenAPI getNewSpecOpenApi() { + return this.newSpecOpenApi; + } + + public List getNewEndpoints() { + return this.newEndpoints; + } + + public List getMissingEndpoints() { + return this.missingEndpoints; + } + + public List getChangedOperations() { + return this.changedOperations; + } + + public ChangedExtensions getChangedExtensions() { + return this.changedExtensions; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/SecurityDiffInfo.java b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/SecurityDiffInfo.java index cd052df4..c0c82461 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/SecurityDiffInfo.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/SecurityDiffInfo.java @@ -5,24 +5,25 @@ import io.swagger.v3.oas.models.security.SecurityScheme; import java.util.List; import java.util.Optional; -import lombok.AllArgsConstructor; -import lombok.Data; -@Data -@AllArgsConstructor public class SecurityDiffInfo { - private String ref; private SecurityScheme securityScheme; private List scopes; + public SecurityDiffInfo( + final String ref, final SecurityScheme securityScheme, final List scopes) { + this.ref = ref; + this.securityScheme = securityScheme; + this.scopes = scopes; + } + public static SecurityRequirement getSecurityRequirement( List securityDiffInfoList) { SecurityRequirement securityRequirement = new SecurityRequirement(); for (SecurityDiffInfo securityDiffInfo : securityDiffInfoList) { securityRequirement.put(securityDiffInfo.getRef(), securityDiffInfo.getScopes()); } - return securityRequirement; } @@ -47,9 +48,7 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SecurityDiffInfo that = (SecurityDiffInfo) o; - if (securityScheme != null ? !securityScheme.equals(that.securityScheme) : that.securityScheme != null) { @@ -64,4 +63,39 @@ public int hashCode() { result = 31 * result + (scopes != null ? scopes.hashCode() : 0); return result; } + + public String getRef() { + return this.ref; + } + + public SecurityScheme getSecurityScheme() { + return this.securityScheme; + } + + public List getScopes() { + return this.scopes; + } + + public void setRef(final String ref) { + this.ref = ref; + } + + public void setSecurityScheme(final SecurityScheme securityScheme) { + this.securityScheme = securityScheme; + } + + public void setScopes(final List scopes) { + this.scopes = scopes; + } + + @java.lang.Override + public java.lang.String toString() { + return "SecurityDiffInfo(ref=" + + this.getRef() + + ", securityScheme=" + + this.getSecurityScheme() + + ", scopes=" + + this.getScopes() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/schemadiffresult/SchemaDiffResult.java b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/schemadiffresult/SchemaDiffResult.java index eae8efa3..164e6697 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/compare/schemadiffresult/SchemaDiffResult.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/compare/schemadiffresult/SchemaDiffResult.java @@ -13,9 +13,7 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.media.Schema; import java.util.*; -import lombok.Getter; -@Getter public class SchemaDiffResult { protected ChangedSchema changedSchema; protected OpenApiDiff openApiDiff; @@ -55,7 +53,6 @@ public , X> Optional diff( .setReadOnly(new ChangedReadOnly(left.getReadOnly(), right.getReadOnly(), context)) .setWriteOnly(new ChangedWriteOnly(left.getWriteOnly(), right.getWriteOnly(), context)) .setMaxLength(new ChangedMaxLength(left.getMaxLength(), right.getMaxLength(), context)); - openApiDiff .getExtensionsDiff() .diff(left.getExtensions(), right.getExtensions(), context) @@ -64,11 +61,9 @@ public , X> Optional diff( .getMetadataDiff() .diff(left.getDescription(), right.getDescription(), context) .ifPresent(changedSchema::setDescription); - Map leftProperties = null == left ? null : left.getProperties(); Map rightProperties = null == right ? null : right.getProperties(); MapKeyDiff propertyDiff = MapKeyDiff.diff(leftProperties, rightProperties); - for (String key : propertyDiff.getSharedKey()) { openApiDiff .getSchemaDiff() @@ -80,9 +75,7 @@ public , X> Optional diff( .ifPresent( changedSchema1 -> changedSchema.getChangedProperties().put(key, changedSchema1)); } - compareAdditionalProperties(refSet, left, right, context); - changedSchema .getIncreasedProperties() .putAll(filterProperties(Change.Type.ADDED, propertyDiff.getIncreased(), context)); @@ -157,4 +150,12 @@ private void compareAdditionalProperties( isChanged(apChangedSchema).ifPresent(changedSchema::setAddProp); } } + + public ChangedSchema getChangedSchema() { + return this.changedSchema; + } + + public OpenApiDiff getOpenApiDiff() { + return this.openApiDiff; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/Change.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/Change.java index db87ae77..adfb6480 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/Change.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/Change.java @@ -1,13 +1,11 @@ package com.qdesrame.openapi.diff.core.model; -import lombok.Value; +import java.util.Objects; -@Value -public class Change { - - T oldValue; - T newValue; - Type type; +public final class Change { + private final T oldValue; + private final T newValue; + private final Type type; public static Change changed(T oldValue, T newValue) { return new Change<>(oldValue, newValue, Type.CHANGED); @@ -24,6 +22,50 @@ public static Change removed(T oldValue) { public enum Type { ADDED, CHANGED, - REMOVED + REMOVED; + } + + public Change(final T oldValue, final T newValue, final Type type) { + this.oldValue = oldValue; + this.newValue = newValue; + this.type = type; + } + + public T getOldValue() { + return this.oldValue; + } + + public T getNewValue() { + return this.newValue; + } + + public Type getType() { + return this.type; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Change change = (Change) o; + return Objects.equals(oldValue, change.oldValue) + && Objects.equals(newValue, change.newValue) + && type == change.type; + } + + @Override + public int hashCode() { + return Objects.hash(oldValue, newValue, type); + } + + @java.lang.Override + public java.lang.String toString() { + return "Change(oldValue=" + + this.getOldValue() + + ", newValue=" + + this.getNewValue() + + ", type=" + + this.getType() + + ")"; } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedApiResponse.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedApiResponse.java index 9b98dad8..97031996 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedApiResponse.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedApiResponse.java @@ -5,19 +5,14 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; -import lombok.Data; -import lombok.experimental.Accessors; -@Data -@Accessors(chain = true) public class ChangedApiResponse implements ComposedChanged { - private final ApiResponses oldApiResponses; private final ApiResponses newApiResponses; private final DiffContext context; - private Map increased; private Map missing; private Map changed; @@ -49,4 +44,91 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public ApiResponses getOldApiResponses() { + return this.oldApiResponses; + } + + public ApiResponses getNewApiResponses() { + return this.newApiResponses; + } + + public DiffContext getContext() { + return this.context; + } + + public Map getIncreased() { + return this.increased; + } + + public Map getMissing() { + return this.missing; + } + + public Map getChanged() { + return this.changed; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedApiResponse setIncreased(final Map increased) { + this.increased = increased; + return this; + } + + public ChangedApiResponse setMissing(final Map missing) { + this.missing = missing; + return this; + } + + public ChangedApiResponse setChanged(final Map changed) { + this.changed = changed; + return this; + } + + public ChangedApiResponse setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedApiResponse that = (ChangedApiResponse) o; + return Objects.equals(oldApiResponses, that.oldApiResponses) + && Objects.equals(newApiResponses, that.newApiResponses) + && Objects.equals(context, that.context) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldApiResponses, newApiResponses, context, increased, missing, changed, extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedApiResponse(oldApiResponses=" + + this.getOldApiResponses() + + ", newApiResponses=" + + this.getNewApiResponses() + + ", context=" + + this.getContext() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedContent.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedContent.java index 26afee7e..67603086 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedContent.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedContent.java @@ -2,21 +2,12 @@ import io.swagger.v3.oas.models.media.Content; import io.swagger.v3.oas.models.media.MediaType; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import lombok.Data; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -public class ChangedContent implements ComposedChanged { +import java.util.*; +public class ChangedContent implements ComposedChanged { private final Content oldContent; private final Content newContent; private final DiffContext context; - private Map increased; private Map missing; private Map changed; @@ -45,4 +36,78 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public Content getOldContent() { + return this.oldContent; + } + + public Content getNewContent() { + return this.newContent; + } + + public DiffContext getContext() { + return this.context; + } + + public Map getIncreased() { + return this.increased; + } + + public Map getMissing() { + return this.missing; + } + + public Map getChanged() { + return this.changed; + } + + public ChangedContent setIncreased(final Map increased) { + this.increased = increased; + return this; + } + + public ChangedContent setMissing(final Map missing) { + this.missing = missing; + return this; + } + + public ChangedContent setChanged(final Map changed) { + this.changed = changed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedContent that = (ChangedContent) o; + return Objects.equals(oldContent, that.oldContent) + && Objects.equals(newContent, that.newContent) + && Objects.equals(context, that.context) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash(oldContent, newContent, context, increased, missing, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedContent(oldContent=" + + this.getOldContent() + + ", newContent=" + + this.getNewContent() + + ", context=" + + this.getContext() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedExtensions.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedExtensions.java index 62fd7a44..d678f82b 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedExtensions.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedExtensions.java @@ -1,20 +1,13 @@ package com.qdesrame.openapi.diff.core.model; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import lombok.Data; -@Data public class ChangedExtensions implements ComposedChanged { - private final Map oldExtensions; private final Map newExtensions; private final DiffContext context; - private Map increased; private Map missing; private Map changed; @@ -41,4 +34,75 @@ public List getChangedElements() { public DiffResult isCoreChanged() { return DiffResult.NO_CHANGES; } + + public Map getOldExtensions() { + return this.oldExtensions; + } + + public Map getNewExtensions() { + return this.newExtensions; + } + + public DiffContext getContext() { + return this.context; + } + + public Map getIncreased() { + return this.increased; + } + + public Map getMissing() { + return this.missing; + } + + public Map getChanged() { + return this.changed; + } + + public void setIncreased(final Map increased) { + this.increased = increased; + } + + public void setMissing(final Map missing) { + this.missing = missing; + } + + public void setChanged(final Map changed) { + this.changed = changed; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedExtensions that = (ChangedExtensions) o; + return Objects.equals(oldExtensions, that.oldExtensions) + && Objects.equals(newExtensions, that.newExtensions) + && Objects.equals(context, that.context) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash(oldExtensions, newExtensions, context, increased, missing, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedExtensions(oldExtensions=" + + this.getOldExtensions() + + ", newExtensions=" + + this.getNewExtensions() + + ", context=" + + this.getContext() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeader.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeader.java index 64a14ad1..b1573fb9 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeader.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeader.java @@ -3,17 +3,12 @@ import io.swagger.v3.oas.models.headers.Header; import java.util.Arrays; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedHeader implements ComposedChanged { - private final Header oldHeader; private final Header newHeader; private final DiffContext context; - private boolean required; private boolean deprecated; private boolean style; @@ -44,4 +39,149 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public Header getOldHeader() { + return this.oldHeader; + } + + public Header getNewHeader() { + return this.newHeader; + } + + public DiffContext getContext() { + return this.context; + } + + public boolean isRequired() { + return this.required; + } + + public boolean isDeprecated() { + return this.deprecated; + } + + public boolean isStyle() { + return this.style; + } + + public boolean isExplode() { + return this.explode; + } + + public ChangedMetadata getDescription() { + return this.description; + } + + public ChangedSchema getSchema() { + return this.schema; + } + + public ChangedContent getContent() { + return this.content; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedHeader setRequired(final boolean required) { + this.required = required; + return this; + } + + public ChangedHeader setDeprecated(final boolean deprecated) { + this.deprecated = deprecated; + return this; + } + + public ChangedHeader setStyle(final boolean style) { + this.style = style; + return this; + } + + public ChangedHeader setExplode(final boolean explode) { + this.explode = explode; + return this; + } + + public ChangedHeader setDescription(final ChangedMetadata description) { + this.description = description; + return this; + } + + public ChangedHeader setSchema(final ChangedSchema schema) { + this.schema = schema; + return this; + } + + public ChangedHeader setContent(final ChangedContent content) { + this.content = content; + return this; + } + + public ChangedHeader setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedHeader that = (ChangedHeader) o; + return required == that.required + && deprecated == that.deprecated + && style == that.style + && explode == that.explode + && Objects.equals(oldHeader, that.oldHeader) + && Objects.equals(newHeader, that.newHeader) + && Objects.equals(context, that.context) + && Objects.equals(description, that.description) + && Objects.equals(schema, that.schema) + && Objects.equals(content, that.content) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldHeader, + newHeader, + context, + required, + deprecated, + style, + explode, + description, + schema, + content, + extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedHeader(oldHeader=" + + this.getOldHeader() + + ", newHeader=" + + this.getNewHeader() + + ", context=" + + this.getContext() + + ", required=" + + this.isRequired() + + ", deprecated=" + + this.isDeprecated() + + ", style=" + + this.isStyle() + + ", explode=" + + this.isExplode() + + ", description=" + + this.getDescription() + + ", schema=" + + this.getSchema() + + ", content=" + + this.getContent() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeaders.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeaders.java index b76a2ee6..4b125d95 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeaders.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedHeaders.java @@ -4,17 +4,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedHeaders implements ComposedChanged { - private final Map oldHeaders; private final Map newHeaders; private final DiffContext context; - private Map increased; private Map missing; private Map changed; @@ -41,4 +36,78 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public Map getOldHeaders() { + return this.oldHeaders; + } + + public Map getNewHeaders() { + return this.newHeaders; + } + + public DiffContext getContext() { + return this.context; + } + + public Map getIncreased() { + return this.increased; + } + + public Map getMissing() { + return this.missing; + } + + public Map getChanged() { + return this.changed; + } + + public ChangedHeaders setIncreased(final Map increased) { + this.increased = increased; + return this; + } + + public ChangedHeaders setMissing(final Map missing) { + this.missing = missing; + return this; + } + + public ChangedHeaders setChanged(final Map changed) { + this.changed = changed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedHeaders that = (ChangedHeaders) o; + return Objects.equals(oldHeaders, that.oldHeaders) + && Objects.equals(newHeaders, that.newHeaders) + && Objects.equals(context, that.context) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash(oldHeaders, newHeaders, context, increased, missing, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedHeaders(oldHeaders=" + + this.getOldHeaders() + + ", newHeaders=" + + this.getNewHeaders() + + ", context=" + + this.getContext() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedList.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedList.java index 31455e68..e891718e 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedList.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedList.java @@ -2,18 +2,13 @@ import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Optional; -import lombok.Data; -import lombok.experimental.Accessors; -@Data -@Accessors(chain = true) public abstract class ChangedList implements Changed { - protected DiffContext context; protected List oldValue; protected List newValue; - private List increased; private List missing; private List shared; @@ -38,7 +33,6 @@ public DiffResult isChanged() { public abstract DiffResult isItemsChanged(); public static class SimpleChangedList extends ChangedList { - public SimpleChangedList(List oldValue, List newValue) { super(oldValue, newValue, null); } @@ -48,4 +42,93 @@ public DiffResult isItemsChanged() { return DiffResult.UNKNOWN; } } + + public DiffContext getContext() { + return this.context; + } + + public List getOldValue() { + return this.oldValue; + } + + public List getNewValue() { + return this.newValue; + } + + public List getIncreased() { + return this.increased; + } + + public List getMissing() { + return this.missing; + } + + public List getShared() { + return this.shared; + } + + public ChangedList setContext(final DiffContext context) { + this.context = context; + return this; + } + + public ChangedList setOldValue(final List oldValue) { + this.oldValue = oldValue; + return this; + } + + public ChangedList setNewValue(final List newValue) { + this.newValue = newValue; + return this; + } + + public ChangedList setIncreased(final List increased) { + this.increased = increased; + return this; + } + + public ChangedList setMissing(final List missing) { + this.missing = missing; + return this; + } + + public ChangedList setShared(final List shared) { + this.shared = shared; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedList that = (ChangedList) o; + return Objects.equals(context, that.context) + && Objects.equals(oldValue, that.oldValue) + && Objects.equals(newValue, that.newValue) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(shared, that.shared); + } + + @Override + public int hashCode() { + return Objects.hash(context, oldValue, newValue, increased, missing, shared); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedList(context=" + + this.getContext() + + ", oldValue=" + + this.getOldValue() + + ", newValue=" + + this.getNewValue() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", shared=" + + this.getShared() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMediaType.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMediaType.java index c0b11b27..1f635d6c 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMediaType.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMediaType.java @@ -3,13 +3,9 @@ import io.swagger.v3.oas.models.media.Schema; import java.util.Collections; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedMediaType implements ComposedChanged { - private final Schema oldSchema; private final Schema newSchema; private final DiffContext context; @@ -30,4 +26,54 @@ public List getChangedElements() { public DiffResult isCoreChanged() { return DiffResult.NO_CHANGES; } + + public Schema getOldSchema() { + return this.oldSchema; + } + + public Schema getNewSchema() { + return this.newSchema; + } + + public DiffContext getContext() { + return this.context; + } + + public ChangedSchema getSchema() { + return this.schema; + } + + public ChangedMediaType setSchema(final ChangedSchema schema) { + this.schema = schema; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedMediaType that = (ChangedMediaType) o; + return Objects.equals(oldSchema, that.oldSchema) + && Objects.equals(newSchema, that.newSchema) + && Objects.equals(context, that.context) + && Objects.equals(schema, that.schema); + } + + @Override + public int hashCode() { + return Objects.hash(oldSchema, newSchema, context, schema); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedMediaType(oldSchema=" + + this.getOldSchema() + + ", newSchema=" + + this.getNewSchema() + + ", context=" + + this.getContext() + + ", schema=" + + this.getSchema() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMetadata.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMetadata.java index edd6b2e8..3df729a2 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMetadata.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedMetadata.java @@ -1,13 +1,8 @@ package com.qdesrame.openapi.diff.core.model; import java.util.Objects; -import lombok.Data; -import lombok.experimental.Accessors; -@Data -@Accessors(chain = true) public class ChangedMetadata implements Changed { - private String left; private String right; @@ -18,4 +13,42 @@ public DiffResult isChanged() { } return DiffResult.METADATA; } + + public ChangedMetadata() {} + + public String getLeft() { + return this.left; + } + + public String getRight() { + return this.right; + } + + public ChangedMetadata setLeft(final String left) { + this.left = left; + return this; + } + + public ChangedMetadata setRight(final String right) { + this.right = right; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedMetadata that = (ChangedMetadata) o; + return Objects.equals(left, that.left) && Objects.equals(right, that.right); + } + + @Override + public int hashCode() { + return Objects.hash(left, right); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedMetadata(left=" + this.getLeft() + ", right=" + this.getRight() + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlow.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlow.java index 92638d81..8ced9ed8 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlow.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlow.java @@ -3,16 +3,11 @@ import io.swagger.v3.oas.models.security.OAuthFlow; import java.util.Collections; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedOAuthFlow implements ComposedChanged { - private OAuthFlow oldOAuthFlow; private OAuthFlow newOAuthFlow; - private boolean authorizationUrl; private boolean tokenUrl; private boolean refreshUrl; @@ -35,4 +30,94 @@ public DiffResult isCoreChanged() { } return DiffResult.NO_CHANGES; } + + public OAuthFlow getOldOAuthFlow() { + return this.oldOAuthFlow; + } + + public OAuthFlow getNewOAuthFlow() { + return this.newOAuthFlow; + } + + public boolean isAuthorizationUrl() { + return this.authorizationUrl; + } + + public boolean isTokenUrl() { + return this.tokenUrl; + } + + public boolean isRefreshUrl() { + return this.refreshUrl; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedOAuthFlow setOldOAuthFlow(final OAuthFlow oldOAuthFlow) { + this.oldOAuthFlow = oldOAuthFlow; + return this; + } + + public ChangedOAuthFlow setNewOAuthFlow(final OAuthFlow newOAuthFlow) { + this.newOAuthFlow = newOAuthFlow; + return this; + } + + public ChangedOAuthFlow setAuthorizationUrl(final boolean authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + public ChangedOAuthFlow setTokenUrl(final boolean tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + public ChangedOAuthFlow setRefreshUrl(final boolean refreshUrl) { + this.refreshUrl = refreshUrl; + return this; + } + + public ChangedOAuthFlow setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedOAuthFlow that = (ChangedOAuthFlow) o; + return authorizationUrl == that.authorizationUrl + && tokenUrl == that.tokenUrl + && refreshUrl == that.refreshUrl + && Objects.equals(oldOAuthFlow, that.oldOAuthFlow) + && Objects.equals(newOAuthFlow, that.newOAuthFlow) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldOAuthFlow, newOAuthFlow, authorizationUrl, tokenUrl, refreshUrl, extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedOAuthFlow(oldOAuthFlow=" + + this.getOldOAuthFlow() + + ", newOAuthFlow=" + + this.getNewOAuthFlow() + + ", authorizationUrl=" + + this.isAuthorizationUrl() + + ", tokenUrl=" + + this.isTokenUrl() + + ", refreshUrl=" + + this.isRefreshUrl() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlows.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlows.java index 168ed71c..5f521a45 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlows.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOAuthFlows.java @@ -3,16 +3,11 @@ import io.swagger.v3.oas.models.security.OAuthFlows; import java.util.Arrays; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedOAuthFlows implements ComposedChanged { - private final OAuthFlows oldOAuthFlows; private final OAuthFlows newOAuthFlows; - private ChangedOAuthFlow implicitOAuthFlow; private ChangedOAuthFlow passwordOAuthFlow; private ChangedOAuthFlow clientCredentialOAuthFlow; @@ -38,4 +33,104 @@ public List getChangedElements() { public DiffResult isCoreChanged() { return DiffResult.NO_CHANGES; } + + public OAuthFlows getOldOAuthFlows() { + return this.oldOAuthFlows; + } + + public OAuthFlows getNewOAuthFlows() { + return this.newOAuthFlows; + } + + public ChangedOAuthFlow getImplicitOAuthFlow() { + return this.implicitOAuthFlow; + } + + public ChangedOAuthFlow getPasswordOAuthFlow() { + return this.passwordOAuthFlow; + } + + public ChangedOAuthFlow getClientCredentialOAuthFlow() { + return this.clientCredentialOAuthFlow; + } + + public ChangedOAuthFlow getAuthorizationCodeOAuthFlow() { + return this.authorizationCodeOAuthFlow; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedOAuthFlows setImplicitOAuthFlow(final ChangedOAuthFlow implicitOAuthFlow) { + this.implicitOAuthFlow = implicitOAuthFlow; + return this; + } + + public ChangedOAuthFlows setPasswordOAuthFlow(final ChangedOAuthFlow passwordOAuthFlow) { + this.passwordOAuthFlow = passwordOAuthFlow; + return this; + } + + public ChangedOAuthFlows setClientCredentialOAuthFlow( + final ChangedOAuthFlow clientCredentialOAuthFlow) { + this.clientCredentialOAuthFlow = clientCredentialOAuthFlow; + return this; + } + + public ChangedOAuthFlows setAuthorizationCodeOAuthFlow( + final ChangedOAuthFlow authorizationCodeOAuthFlow) { + this.authorizationCodeOAuthFlow = authorizationCodeOAuthFlow; + return this; + } + + public ChangedOAuthFlows setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedOAuthFlows that = (ChangedOAuthFlows) o; + return Objects.equals(oldOAuthFlows, that.oldOAuthFlows) + && Objects.equals(newOAuthFlows, that.newOAuthFlows) + && Objects.equals(implicitOAuthFlow, that.implicitOAuthFlow) + && Objects.equals(passwordOAuthFlow, that.passwordOAuthFlow) + && Objects.equals(clientCredentialOAuthFlow, that.clientCredentialOAuthFlow) + && Objects.equals(authorizationCodeOAuthFlow, that.authorizationCodeOAuthFlow) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldOAuthFlows, + newOAuthFlows, + implicitOAuthFlow, + passwordOAuthFlow, + clientCredentialOAuthFlow, + authorizationCodeOAuthFlow, + extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedOAuthFlows(oldOAuthFlows=" + + this.getOldOAuthFlows() + + ", newOAuthFlows=" + + this.getNewOAuthFlows() + + ", implicitOAuthFlow=" + + this.getImplicitOAuthFlow() + + ", passwordOAuthFlow=" + + this.getPasswordOAuthFlow() + + ", clientCredentialOAuthFlow=" + + this.getClientCredentialOAuthFlow() + + ", authorizationCodeOAuthFlow=" + + this.getAuthorizationCodeOAuthFlow() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOneOfSchema.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOneOfSchema.java index 2d28fa4f..1d5832e1 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOneOfSchema.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOneOfSchema.java @@ -4,17 +4,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedOneOfSchema implements ComposedChanged { - private final Map oldMapping; private final Map newMapping; private final DiffContext context; - private Map increased; private Map missing; private Map changed; @@ -41,4 +36,78 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public Map getOldMapping() { + return this.oldMapping; + } + + public Map getNewMapping() { + return this.newMapping; + } + + public DiffContext getContext() { + return this.context; + } + + public Map getIncreased() { + return this.increased; + } + + public Map getMissing() { + return this.missing; + } + + public Map getChanged() { + return this.changed; + } + + public ChangedOneOfSchema setIncreased(final Map increased) { + this.increased = increased; + return this; + } + + public ChangedOneOfSchema setMissing(final Map missing) { + this.missing = missing; + return this; + } + + public ChangedOneOfSchema setChanged(final Map changed) { + this.changed = changed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedOneOfSchema that = (ChangedOneOfSchema) o; + return Objects.equals(oldMapping, that.oldMapping) + && Objects.equals(newMapping, that.newMapping) + && Objects.equals(context, that.context) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash(oldMapping, newMapping, context, increased, missing, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedOneOfSchema(oldMapping=" + + this.getOldMapping() + + ", newMapping=" + + this.getNewMapping() + + ", context=" + + this.getContext() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOpenApi.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOpenApi.java index 66a199c8..d8edcb87 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOpenApi.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOpenApi.java @@ -3,18 +3,13 @@ import com.qdesrame.openapi.diff.core.utils.EndpointUtils; import io.swagger.v3.oas.models.OpenAPI; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; -import lombok.Data; -import lombok.experimental.Accessors; -@Data -@Accessors(chain = true) public class ChangedOpenApi implements ComposedChanged { - private OpenAPI oldSpecOpenApi; private OpenAPI newSpecOpenApi; - private List newEndpoints; private List missingEndpoints; private List changedOperations; @@ -46,4 +41,101 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public ChangedOpenApi() {} + + public OpenAPI getOldSpecOpenApi() { + return this.oldSpecOpenApi; + } + + public OpenAPI getNewSpecOpenApi() { + return this.newSpecOpenApi; + } + + public List getNewEndpoints() { + return this.newEndpoints; + } + + public List getMissingEndpoints() { + return this.missingEndpoints; + } + + public List getChangedOperations() { + return this.changedOperations; + } + + public ChangedExtensions getChangedExtensions() { + return this.changedExtensions; + } + + public ChangedOpenApi setOldSpecOpenApi(final OpenAPI oldSpecOpenApi) { + this.oldSpecOpenApi = oldSpecOpenApi; + return this; + } + + public ChangedOpenApi setNewSpecOpenApi(final OpenAPI newSpecOpenApi) { + this.newSpecOpenApi = newSpecOpenApi; + return this; + } + + public ChangedOpenApi setNewEndpoints(final List newEndpoints) { + this.newEndpoints = newEndpoints; + return this; + } + + public ChangedOpenApi setMissingEndpoints(final List missingEndpoints) { + this.missingEndpoints = missingEndpoints; + return this; + } + + public ChangedOpenApi setChangedOperations(final List changedOperations) { + this.changedOperations = changedOperations; + return this; + } + + public ChangedOpenApi setChangedExtensions(final ChangedExtensions changedExtensions) { + this.changedExtensions = changedExtensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedOpenApi that = (ChangedOpenApi) o; + return Objects.equals(oldSpecOpenApi, that.oldSpecOpenApi) + && Objects.equals(newSpecOpenApi, that.newSpecOpenApi) + && Objects.equals(newEndpoints, that.newEndpoints) + && Objects.equals(missingEndpoints, that.missingEndpoints) + && Objects.equals(changedOperations, that.changedOperations) + && Objects.equals(changedExtensions, that.changedExtensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldSpecOpenApi, + newSpecOpenApi, + newEndpoints, + missingEndpoints, + changedOperations, + changedExtensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedOpenApi(oldSpecOpenApi=" + + this.getOldSpecOpenApi() + + ", newSpecOpenApi=" + + this.getNewSpecOpenApi() + + ", newEndpoints=" + + this.getNewEndpoints() + + ", missingEndpoints=" + + this.getMissingEndpoints() + + ", changedOperations=" + + this.getChangedOperations() + + ", changedExtensions=" + + this.getChangedExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOperation.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOperation.java index 78143931..5992fd03 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOperation.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedOperation.java @@ -6,16 +6,11 @@ import io.swagger.v3.oas.models.PathItem; import java.util.Arrays; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedOperation implements ComposedChanged { - private Operation oldOperation; private Operation newOperation; - private String pathUrl; private PathItem.HttpMethod httpMethod; private ChangedMetadata summary; @@ -66,4 +61,178 @@ public DiffResult resultApiResponses() { public DiffResult resultRequestBody() { return requestBody == null ? DiffResult.NO_CHANGES : requestBody.isChanged(); } + + public Operation getOldOperation() { + return this.oldOperation; + } + + public Operation getNewOperation() { + return this.newOperation; + } + + public String getPathUrl() { + return this.pathUrl; + } + + public PathItem.HttpMethod getHttpMethod() { + return this.httpMethod; + } + + public ChangedMetadata getSummary() { + return this.summary; + } + + public ChangedMetadata getDescription() { + return this.description; + } + + public boolean isDeprecated() { + return this.deprecated; + } + + public ChangedParameters getParameters() { + return this.parameters; + } + + public ChangedRequestBody getRequestBody() { + return this.requestBody; + } + + public ChangedApiResponse getApiResponses() { + return this.apiResponses; + } + + public ChangedSecurityRequirements getSecurityRequirements() { + return this.securityRequirements; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedOperation setOldOperation(final Operation oldOperation) { + this.oldOperation = oldOperation; + return this; + } + + public ChangedOperation setNewOperation(final Operation newOperation) { + this.newOperation = newOperation; + return this; + } + + public ChangedOperation setPathUrl(final String pathUrl) { + this.pathUrl = pathUrl; + return this; + } + + public ChangedOperation setHttpMethod(final PathItem.HttpMethod httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + public ChangedOperation setSummary(final ChangedMetadata summary) { + this.summary = summary; + return this; + } + + public ChangedOperation setDescription(final ChangedMetadata description) { + this.description = description; + return this; + } + + public ChangedOperation setDeprecated(final boolean deprecated) { + this.deprecated = deprecated; + return this; + } + + public ChangedOperation setParameters(final ChangedParameters parameters) { + this.parameters = parameters; + return this; + } + + public ChangedOperation setRequestBody(final ChangedRequestBody requestBody) { + this.requestBody = requestBody; + return this; + } + + public ChangedOperation setApiResponses(final ChangedApiResponse apiResponses) { + this.apiResponses = apiResponses; + return this; + } + + public ChangedOperation setSecurityRequirements( + final ChangedSecurityRequirements securityRequirements) { + this.securityRequirements = securityRequirements; + return this; + } + + public ChangedOperation setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedOperation that = (ChangedOperation) o; + return deprecated == that.deprecated + && Objects.equals(oldOperation, that.oldOperation) + && Objects.equals(newOperation, that.newOperation) + && Objects.equals(pathUrl, that.pathUrl) + && httpMethod == that.httpMethod + && Objects.equals(summary, that.summary) + && Objects.equals(description, that.description) + && Objects.equals(parameters, that.parameters) + && Objects.equals(requestBody, that.requestBody) + && Objects.equals(apiResponses, that.apiResponses) + && Objects.equals(securityRequirements, that.securityRequirements) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldOperation, + newOperation, + pathUrl, + httpMethod, + summary, + description, + deprecated, + parameters, + requestBody, + apiResponses, + securityRequirements, + extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedOperation(oldOperation=" + + this.getOldOperation() + + ", newOperation=" + + this.getNewOperation() + + ", pathUrl=" + + this.getPathUrl() + + ", httpMethod=" + + this.getHttpMethod() + + ", summary=" + + this.getSummary() + + ", description=" + + this.getDescription() + + ", deprecated=" + + this.isDeprecated() + + ", parameters=" + + this.getParameters() + + ", requestBody=" + + this.getRequestBody() + + ", apiResponses=" + + this.getApiResponses() + + ", securityRequirements=" + + this.getSecurityRequirements() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameter.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameter.java index b52cbfad..a0f862b0 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameter.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameter.java @@ -3,13 +3,9 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.util.Arrays; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedParameter implements ComposedChanged { - private final DiffContext context; private Parameter oldParameter; private Parameter newParameter; @@ -53,4 +49,198 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public DiffContext getContext() { + return this.context; + } + + public Parameter getOldParameter() { + return this.oldParameter; + } + + public Parameter getNewParameter() { + return this.newParameter; + } + + public String getName() { + return this.name; + } + + public String getIn() { + return this.in; + } + + public boolean isChangeRequired() { + return this.changeRequired; + } + + public boolean isDeprecated() { + return this.deprecated; + } + + public boolean isChangeStyle() { + return this.changeStyle; + } + + public boolean isChangeExplode() { + return this.changeExplode; + } + + public boolean isChangeAllowEmptyValue() { + return this.changeAllowEmptyValue; + } + + public ChangedMetadata getDescription() { + return this.description; + } + + public ChangedSchema getSchema() { + return this.schema; + } + + public ChangedContent getContent() { + return this.content; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedParameter setOldParameter(final Parameter oldParameter) { + this.oldParameter = oldParameter; + return this; + } + + public ChangedParameter setNewParameter(final Parameter newParameter) { + this.newParameter = newParameter; + return this; + } + + public ChangedParameter setName(final String name) { + this.name = name; + return this; + } + + public ChangedParameter setIn(final String in) { + this.in = in; + return this; + } + + public ChangedParameter setChangeRequired(final boolean changeRequired) { + this.changeRequired = changeRequired; + return this; + } + + public ChangedParameter setDeprecated(final boolean deprecated) { + this.deprecated = deprecated; + return this; + } + + public ChangedParameter setChangeStyle(final boolean changeStyle) { + this.changeStyle = changeStyle; + return this; + } + + public ChangedParameter setChangeExplode(final boolean changeExplode) { + this.changeExplode = changeExplode; + return this; + } + + public ChangedParameter setChangeAllowEmptyValue(final boolean changeAllowEmptyValue) { + this.changeAllowEmptyValue = changeAllowEmptyValue; + return this; + } + + public ChangedParameter setDescription(final ChangedMetadata description) { + this.description = description; + return this; + } + + public ChangedParameter setSchema(final ChangedSchema schema) { + this.schema = schema; + return this; + } + + public ChangedParameter setContent(final ChangedContent content) { + this.content = content; + return this; + } + + public ChangedParameter setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedParameter that = (ChangedParameter) o; + return changeRequired == that.changeRequired + && deprecated == that.deprecated + && changeStyle == that.changeStyle + && changeExplode == that.changeExplode + && changeAllowEmptyValue == that.changeAllowEmptyValue + && Objects.equals(context, that.context) + && Objects.equals(oldParameter, that.oldParameter) + && Objects.equals(newParameter, that.newParameter) + && Objects.equals(name, that.name) + && Objects.equals(in, that.in) + && Objects.equals(description, that.description) + && Objects.equals(schema, that.schema) + && Objects.equals(content, that.content) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + context, + oldParameter, + newParameter, + name, + in, + changeRequired, + deprecated, + changeStyle, + changeExplode, + changeAllowEmptyValue, + description, + schema, + content, + extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedParameter(context=" + + this.getContext() + + ", oldParameter=" + + this.getOldParameter() + + ", newParameter=" + + this.getNewParameter() + + ", name=" + + this.getName() + + ", in=" + + this.getIn() + + ", changeRequired=" + + this.isChangeRequired() + + ", deprecated=" + + this.isDeprecated() + + ", changeStyle=" + + this.isChangeStyle() + + ", changeExplode=" + + this.isChangeExplode() + + ", changeAllowEmptyValue=" + + this.isChangeAllowEmptyValue() + + ", description=" + + this.getDescription() + + ", schema=" + + this.getSchema() + + ", content=" + + this.getContent() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameters.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameters.java index b8d8a06f..f113a73f 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameters.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedParameters.java @@ -3,16 +3,12 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.util.ArrayList; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedParameters implements ComposedChanged { private final List oldParameterList; private final List newParameterList; private final DiffContext context; - private List increased; private List missing; private List changed; @@ -47,4 +43,78 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public List getOldParameterList() { + return this.oldParameterList; + } + + public List getNewParameterList() { + return this.newParameterList; + } + + public DiffContext getContext() { + return this.context; + } + + public List getIncreased() { + return this.increased; + } + + public List getMissing() { + return this.missing; + } + + public List getChanged() { + return this.changed; + } + + public ChangedParameters setIncreased(final List increased) { + this.increased = increased; + return this; + } + + public ChangedParameters setMissing(final List missing) { + this.missing = missing; + return this; + } + + public ChangedParameters setChanged(final List changed) { + this.changed = changed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedParameters that = (ChangedParameters) o; + return Objects.equals(oldParameterList, that.oldParameterList) + && Objects.equals(newParameterList, that.newParameterList) + && Objects.equals(context, that.context) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash(oldParameterList, newParameterList, context, increased, missing, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedParameters(oldParameterList=" + + this.getOldParameterList() + + ", newParameterList=" + + this.getNewParameterList() + + ", context=" + + this.getContext() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPath.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPath.java index 8406632b..d55f7b28 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPath.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPath.java @@ -2,24 +2,15 @@ import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import lombok.Data; -import lombok.experimental.Accessors; -@Data -@Accessors(chain = true) public class ChangedPath implements ComposedChanged { - private final String pathUrl; private final PathItem oldPath; private final PathItem newPath; private final DiffContext context; - Map increased; Map missing; List changed; @@ -50,4 +41,98 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public String getPathUrl() { + return this.pathUrl; + } + + public PathItem getOldPath() { + return this.oldPath; + } + + public PathItem getNewPath() { + return this.newPath; + } + + public DiffContext getContext() { + return this.context; + } + + public Map getIncreased() { + return this.increased; + } + + public Map getMissing() { + return this.missing; + } + + public List getChanged() { + return this.changed; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedPath setIncreased(final Map increased) { + this.increased = increased; + return this; + } + + public ChangedPath setMissing(final Map missing) { + this.missing = missing; + return this; + } + + public ChangedPath setChanged(final List changed) { + this.changed = changed; + return this; + } + + public ChangedPath setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedPath that = (ChangedPath) o; + return Objects.equals(pathUrl, that.pathUrl) + && Objects.equals(oldPath, that.oldPath) + && Objects.equals(newPath, that.newPath) + && Objects.equals(context, that.context) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + pathUrl, oldPath, newPath, context, increased, missing, changed, extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedPath(pathUrl=" + + this.getPathUrl() + + ", oldPath=" + + this.getOldPath() + + ", newPath=" + + this.getNewPath() + + ", context=" + + this.getContext() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPaths.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPaths.java index 4ae8c41d..d5116a53 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPaths.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedPaths.java @@ -1,18 +1,11 @@ package com.qdesrame.openapi.diff.core.model; import io.swagger.v3.oas.models.PathItem; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import lombok.Data; +import java.util.*; -@Data public class ChangedPaths implements ComposedChanged { - private final Map oldPathMap; private final Map newPathMap; - private Map increased; private Map missing; private Map changed; @@ -40,4 +33,68 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public Map getOldPathMap() { + return this.oldPathMap; + } + + public Map getNewPathMap() { + return this.newPathMap; + } + + public Map getIncreased() { + return this.increased; + } + + public Map getMissing() { + return this.missing; + } + + public Map getChanged() { + return this.changed; + } + + public void setIncreased(final Map increased) { + this.increased = increased; + } + + public void setMissing(final Map missing) { + this.missing = missing; + } + + public void setChanged(final Map changed) { + this.changed = changed; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedPaths that = (ChangedPaths) o; + return Objects.equals(oldPathMap, that.oldPathMap) + && Objects.equals(newPathMap, that.newPathMap) + && Objects.equals(increased, that.increased) + && Objects.equals(missing, that.missing) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash(oldPathMap, newPathMap, increased, missing, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedPaths(oldPathMap=" + + this.getOldPathMap() + + ", newPathMap=" + + this.getNewPathMap() + + ", increased=" + + this.getIncreased() + + ", missing=" + + this.getMissing() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedRequestBody.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedRequestBody.java index b0111e02..7de801ec 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedRequestBody.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedRequestBody.java @@ -3,17 +3,12 @@ import io.swagger.v3.oas.models.parameters.RequestBody; import java.util.Arrays; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedRequestBody implements ComposedChanged { - private final RequestBody oldRequestBody; private final RequestBody newRequestBody; private final DiffContext context; - private boolean changeRequired; private ChangedMetadata description; private ChangedContent content; @@ -38,4 +33,91 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public RequestBody getOldRequestBody() { + return this.oldRequestBody; + } + + public RequestBody getNewRequestBody() { + return this.newRequestBody; + } + + public DiffContext getContext() { + return this.context; + } + + public boolean isChangeRequired() { + return this.changeRequired; + } + + public ChangedMetadata getDescription() { + return this.description; + } + + public ChangedContent getContent() { + return this.content; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedRequestBody setChangeRequired(final boolean changeRequired) { + this.changeRequired = changeRequired; + return this; + } + + public ChangedRequestBody setDescription(final ChangedMetadata description) { + this.description = description; + return this; + } + + public ChangedRequestBody setContent(final ChangedContent content) { + this.content = content; + return this; + } + + public ChangedRequestBody setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedRequestBody that = (ChangedRequestBody) o; + return changeRequired == that.changeRequired + && Objects.equals(oldRequestBody, that.oldRequestBody) + && Objects.equals(newRequestBody, that.newRequestBody) + && Objects.equals(context, that.context) + && Objects.equals(description, that.description) + && Objects.equals(content, that.content) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldRequestBody, newRequestBody, context, changeRequired, description, content, extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedRequestBody(oldRequestBody=" + + this.getOldRequestBody() + + ", newRequestBody=" + + this.getNewRequestBody() + + ", context=" + + this.getContext() + + ", changeRequired=" + + this.isChangeRequired() + + ", description=" + + this.getDescription() + + ", content=" + + this.getContent() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedResponse.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedResponse.java index 8f23fb57..9704ce98 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedResponse.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedResponse.java @@ -3,17 +3,12 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import java.util.Arrays; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedResponse implements ComposedChanged { - private final ApiResponse oldApiResponse; private final ApiResponse newApiResponse; private final DiffContext context; - private ChangedMetadata description; private ChangedHeaders headers; private ChangedContent content; @@ -35,4 +30,91 @@ public List getChangedElements() { public DiffResult isCoreChanged() { return DiffResult.NO_CHANGES; } + + public ApiResponse getOldApiResponse() { + return this.oldApiResponse; + } + + public ApiResponse getNewApiResponse() { + return this.newApiResponse; + } + + public DiffContext getContext() { + return this.context; + } + + public ChangedMetadata getDescription() { + return this.description; + } + + public ChangedHeaders getHeaders() { + return this.headers; + } + + public ChangedContent getContent() { + return this.content; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedResponse setDescription(final ChangedMetadata description) { + this.description = description; + return this; + } + + public ChangedResponse setHeaders(final ChangedHeaders headers) { + this.headers = headers; + return this; + } + + public ChangedResponse setContent(final ChangedContent content) { + this.content = content; + return this; + } + + public ChangedResponse setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedResponse that = (ChangedResponse) o; + return Objects.equals(oldApiResponse, that.oldApiResponse) + && Objects.equals(newApiResponse, that.newApiResponse) + && Objects.equals(context, that.context) + && Objects.equals(description, that.description) + && Objects.equals(headers, that.headers) + && Objects.equals(content, that.content) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldApiResponse, newApiResponse, context, description, headers, content, extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedResponse(oldApiResponse=" + + this.getOldApiResponse() + + ", newApiResponse=" + + this.getNewApiResponse() + + ", context=" + + this.getContext() + + ", description=" + + this.getDescription() + + ", headers=" + + this.getHeaders() + + ", content=" + + this.getContent() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSchema.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSchema.java index 722e3d99..8ed33b9f 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSchema.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSchema.java @@ -10,15 +10,11 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; -import lombok.Data; -import lombok.experimental.Accessors; -@Data -@Accessors(chain = true) public class ChangedSchema implements ComposedChanged { - protected DiffContext context; protected Schema oldSchema; protected Schema newSchema; @@ -96,7 +92,322 @@ private boolean compatibleForRequest() { return false; } } - return (oldSchema != null || newSchema == null); } + + public DiffContext getContext() { + return this.context; + } + + public Schema getOldSchema() { + return this.oldSchema; + } + + public Schema getNewSchema() { + return this.newSchema; + } + + public String getType() { + return this.type; + } + + public Map getChangedProperties() { + return this.changedProperties; + } + + public Map getIncreasedProperties() { + return this.increasedProperties; + } + + public Map getMissingProperties() { + return this.missingProperties; + } + + public boolean isChangeDeprecated() { + return this.changeDeprecated; + } + + public ChangedMetadata getDescription() { + return this.description; + } + + public boolean isChangeTitle() { + return this.changeTitle; + } + + public ChangedRequired getRequired() { + return this.required; + } + + public boolean isChangeDefault() { + return this.changeDefault; + } + + public ChangedEnum getEnumeration() { + return this.enumeration; + } + + public boolean isChangeFormat() { + return this.changeFormat; + } + + public ChangedReadOnly getReadOnly() { + return this.readOnly; + } + + public ChangedWriteOnly getWriteOnly() { + return this.writeOnly; + } + + public boolean isChangedType() { + return this.changedType; + } + + public ChangedMaxLength getMaxLength() { + return this.maxLength; + } + + public boolean isDiscriminatorPropertyChanged() { + return this.discriminatorPropertyChanged; + } + + public ChangedSchema getItems() { + return this.items; + } + + public ChangedOneOfSchema getOneOfSchema() { + return this.oneOfSchema; + } + + public ChangedSchema getAddProp() { + return this.addProp; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedSchema setContext(final DiffContext context) { + this.context = context; + return this; + } + + public ChangedSchema setOldSchema(final Schema oldSchema) { + this.oldSchema = oldSchema; + return this; + } + + public ChangedSchema setNewSchema(final Schema newSchema) { + this.newSchema = newSchema; + return this; + } + + public ChangedSchema setType(final String type) { + this.type = type; + return this; + } + + public ChangedSchema setChangedProperties(final Map changedProperties) { + this.changedProperties = changedProperties; + return this; + } + + public ChangedSchema setIncreasedProperties(final Map increasedProperties) { + this.increasedProperties = increasedProperties; + return this; + } + + public ChangedSchema setMissingProperties(final Map missingProperties) { + this.missingProperties = missingProperties; + return this; + } + + public ChangedSchema setChangeDeprecated(final boolean changeDeprecated) { + this.changeDeprecated = changeDeprecated; + return this; + } + + public ChangedSchema setDescription(final ChangedMetadata description) { + this.description = description; + return this; + } + + public ChangedSchema setChangeTitle(final boolean changeTitle) { + this.changeTitle = changeTitle; + return this; + } + + public ChangedSchema setRequired(final ChangedRequired required) { + this.required = required; + return this; + } + + public ChangedSchema setChangeDefault(final boolean changeDefault) { + this.changeDefault = changeDefault; + return this; + } + + public ChangedSchema setEnumeration(final ChangedEnum enumeration) { + this.enumeration = enumeration; + return this; + } + + public ChangedSchema setChangeFormat(final boolean changeFormat) { + this.changeFormat = changeFormat; + return this; + } + + public ChangedSchema setReadOnly(final ChangedReadOnly readOnly) { + this.readOnly = readOnly; + return this; + } + + public ChangedSchema setWriteOnly(final ChangedWriteOnly writeOnly) { + this.writeOnly = writeOnly; + return this; + } + + public ChangedSchema setChangedType(final boolean changedType) { + this.changedType = changedType; + return this; + } + + public ChangedSchema setMaxLength(final ChangedMaxLength maxLength) { + this.maxLength = maxLength; + return this; + } + + public ChangedSchema setDiscriminatorPropertyChanged(final boolean discriminatorPropertyChanged) { + this.discriminatorPropertyChanged = discriminatorPropertyChanged; + return this; + } + + public ChangedSchema setItems(final ChangedSchema items) { + this.items = items; + return this; + } + + public ChangedSchema setOneOfSchema(final ChangedOneOfSchema oneOfSchema) { + this.oneOfSchema = oneOfSchema; + return this; + } + + public ChangedSchema setAddProp(final ChangedSchema addProp) { + this.addProp = addProp; + return this; + } + + public ChangedSchema setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedSchema that = (ChangedSchema) o; + return changeDeprecated == that.changeDeprecated + && changeTitle == that.changeTitle + && changeDefault == that.changeDefault + && changeFormat == that.changeFormat + && changedType == that.changedType + && discriminatorPropertyChanged == that.discriminatorPropertyChanged + && Objects.equals(context, that.context) + && Objects.equals(oldSchema, that.oldSchema) + && Objects.equals(newSchema, that.newSchema) + && Objects.equals(type, that.type) + && Objects.equals(changedProperties, that.changedProperties) + && Objects.equals(increasedProperties, that.increasedProperties) + && Objects.equals(missingProperties, that.missingProperties) + && Objects.equals(description, that.description) + && Objects.equals(required, that.required) + && Objects.equals(enumeration, that.enumeration) + && Objects.equals(readOnly, that.readOnly) + && Objects.equals(writeOnly, that.writeOnly) + && Objects.equals(maxLength, that.maxLength) + && Objects.equals(items, that.items) + && Objects.equals(oneOfSchema, that.oneOfSchema) + && Objects.equals(addProp, that.addProp) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + context, + oldSchema, + newSchema, + type, + changedProperties, + increasedProperties, + missingProperties, + changeDeprecated, + description, + changeTitle, + required, + changeDefault, + enumeration, + changeFormat, + readOnly, + writeOnly, + changedType, + maxLength, + discriminatorPropertyChanged, + items, + oneOfSchema, + addProp, + extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedSchema(context=" + + this.getContext() + + ", oldSchema=" + + this.getOldSchema() + + ", newSchema=" + + this.getNewSchema() + + ", type=" + + this.getType() + + ", changedProperties=" + + this.getChangedProperties() + + ", increasedProperties=" + + this.getIncreasedProperties() + + ", missingProperties=" + + this.getMissingProperties() + + ", changeDeprecated=" + + this.isChangeDeprecated() + + ", description=" + + this.getDescription() + + ", changeTitle=" + + this.isChangeTitle() + + ", required=" + + this.getRequired() + + ", changeDefault=" + + this.isChangeDefault() + + ", enumeration=" + + this.getEnumeration() + + ", changeFormat=" + + this.isChangeFormat() + + ", readOnly=" + + this.getReadOnly() + + ", writeOnly=" + + this.getWriteOnly() + + ", changedType=" + + this.isChangedType() + + ", maxLength=" + + this.getMaxLength() + + ", discriminatorPropertyChanged=" + + this.isDiscriminatorPropertyChanged() + + ", items=" + + this.getItems() + + ", oneOfSchema=" + + this.getOneOfSchema() + + ", addProp=" + + this.getAddProp() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirement.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirement.java index 5d950f06..28a94fa6 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirement.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirement.java @@ -3,16 +3,11 @@ import io.swagger.v3.oas.models.security.SecurityRequirement; import java.util.ArrayList; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; -@Data -@Accessors(chain = true) public class ChangedSecurityRequirement implements ComposedChanged { - private SecurityRequirement oldSecurityRequirement; private SecurityRequirement newSecurityRequirement; - private SecurityRequirement missing; private SecurityRequirement increased; private List changed; @@ -57,4 +52,84 @@ public void addIncreased(String key, List scopes) { public void addChanged(ChangedSecurityScheme changedSecurityScheme) { changed.add(changedSecurityScheme); } + + public SecurityRequirement getOldSecurityRequirement() { + return this.oldSecurityRequirement; + } + + public SecurityRequirement getNewSecurityRequirement() { + return this.newSecurityRequirement; + } + + public SecurityRequirement getMissing() { + return this.missing; + } + + public SecurityRequirement getIncreased() { + return this.increased; + } + + public List getChanged() { + return this.changed; + } + + public ChangedSecurityRequirement setOldSecurityRequirement( + final SecurityRequirement oldSecurityRequirement) { + this.oldSecurityRequirement = oldSecurityRequirement; + return this; + } + + public ChangedSecurityRequirement setNewSecurityRequirement( + final SecurityRequirement newSecurityRequirement) { + this.newSecurityRequirement = newSecurityRequirement; + return this; + } + + public ChangedSecurityRequirement setMissing(final SecurityRequirement missing) { + this.missing = missing; + return this; + } + + public ChangedSecurityRequirement setIncreased(final SecurityRequirement increased) { + this.increased = increased; + return this; + } + + public ChangedSecurityRequirement setChanged(final List changed) { + this.changed = changed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedSecurityRequirement that = (ChangedSecurityRequirement) o; + return Objects.equals(oldSecurityRequirement, that.oldSecurityRequirement) + && Objects.equals(newSecurityRequirement, that.newSecurityRequirement) + && Objects.equals(missing, that.missing) + && Objects.equals(increased, that.increased) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash( + oldSecurityRequirement, newSecurityRequirement, missing, increased, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedSecurityRequirement(oldSecurityRequirement=" + + this.getOldSecurityRequirement() + + ", newSecurityRequirement=" + + this.getNewSecurityRequirement() + + ", missing=" + + this.getMissing() + + ", increased=" + + this.getIncreased() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirements.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirements.java index 81b935bf..2a119c2b 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirements.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityRequirements.java @@ -3,17 +3,12 @@ import io.swagger.v3.oas.models.security.SecurityRequirement; import java.util.ArrayList; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; import org.apache.commons.collections4.CollectionUtils; -@Data -@Accessors(chain = true) public class ChangedSecurityRequirements implements ComposedChanged { - private List oldSecurityRequirements; private List newSecurityRequirements; - private List missing; private List increased; private List changed; @@ -62,4 +57,84 @@ public void addChanged(ChangedSecurityRequirement changedSecurityRequirement) { } this.changed.add(changedSecurityRequirement); } + + public List getOldSecurityRequirements() { + return this.oldSecurityRequirements; + } + + public List getNewSecurityRequirements() { + return this.newSecurityRequirements; + } + + public List getMissing() { + return this.missing; + } + + public List getIncreased() { + return this.increased; + } + + public List getChanged() { + return this.changed; + } + + public ChangedSecurityRequirements setOldSecurityRequirements( + final List oldSecurityRequirements) { + this.oldSecurityRequirements = oldSecurityRequirements; + return this; + } + + public ChangedSecurityRequirements setNewSecurityRequirements( + final List newSecurityRequirements) { + this.newSecurityRequirements = newSecurityRequirements; + return this; + } + + public ChangedSecurityRequirements setMissing(final List missing) { + this.missing = missing; + return this; + } + + public ChangedSecurityRequirements setIncreased(final List increased) { + this.increased = increased; + return this; + } + + public ChangedSecurityRequirements setChanged(final List changed) { + this.changed = changed; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedSecurityRequirements that = (ChangedSecurityRequirements) o; + return Objects.equals(oldSecurityRequirements, that.oldSecurityRequirements) + && Objects.equals(newSecurityRequirements, that.newSecurityRequirements) + && Objects.equals(missing, that.missing) + && Objects.equals(increased, that.increased) + && Objects.equals(changed, that.changed); + } + + @Override + public int hashCode() { + return Objects.hash( + oldSecurityRequirements, newSecurityRequirements, missing, increased, changed); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedSecurityRequirements(oldSecurityRequirements=" + + this.getOldSecurityRequirements() + + ", newSecurityRequirements=" + + this.getNewSecurityRequirements() + + ", missing=" + + this.getMissing() + + ", increased=" + + this.getIncreased() + + ", changed=" + + this.getChanged() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityScheme.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityScheme.java index c7ea64bd..23d99790 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityScheme.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/ChangedSecurityScheme.java @@ -3,17 +3,12 @@ import io.swagger.v3.oas.models.security.SecurityScheme; import java.util.Arrays; import java.util.List; -import lombok.Data; -import lombok.experimental.Accessors; +import java.util.Objects; /** Created by adarsh.sharma on 11/01/18. */ -@Data -@Accessors(chain = true) public class ChangedSecurityScheme implements ComposedChanged { - private SecurityScheme oldSecurityScheme; private SecurityScheme newSecurityScheme; - private boolean changedType; private boolean changedIn; private boolean changedScheme; @@ -54,4 +49,164 @@ public DiffResult isCoreChanged() { } return DiffResult.INCOMPATIBLE; } + + public SecurityScheme getOldSecurityScheme() { + return this.oldSecurityScheme; + } + + public SecurityScheme getNewSecurityScheme() { + return this.newSecurityScheme; + } + + public boolean isChangedType() { + return this.changedType; + } + + public boolean isChangedIn() { + return this.changedIn; + } + + public boolean isChangedScheme() { + return this.changedScheme; + } + + public boolean isChangedBearerFormat() { + return this.changedBearerFormat; + } + + public boolean isChangedOpenIdConnectUrl() { + return this.changedOpenIdConnectUrl; + } + + public ChangedSecuritySchemeScopes getChangedScopes() { + return this.changedScopes; + } + + public ChangedMetadata getDescription() { + return this.description; + } + + public ChangedOAuthFlows getOAuthFlows() { + return this.oAuthFlows; + } + + public ChangedExtensions getExtensions() { + return this.extensions; + } + + public ChangedSecurityScheme setOldSecurityScheme(final SecurityScheme oldSecurityScheme) { + this.oldSecurityScheme = oldSecurityScheme; + return this; + } + + public ChangedSecurityScheme setNewSecurityScheme(final SecurityScheme newSecurityScheme) { + this.newSecurityScheme = newSecurityScheme; + return this; + } + + public ChangedSecurityScheme setChangedType(final boolean changedType) { + this.changedType = changedType; + return this; + } + + public ChangedSecurityScheme setChangedIn(final boolean changedIn) { + this.changedIn = changedIn; + return this; + } + + public ChangedSecurityScheme setChangedScheme(final boolean changedScheme) { + this.changedScheme = changedScheme; + return this; + } + + public ChangedSecurityScheme setChangedBearerFormat(final boolean changedBearerFormat) { + this.changedBearerFormat = changedBearerFormat; + return this; + } + + public ChangedSecurityScheme setChangedOpenIdConnectUrl(final boolean changedOpenIdConnectUrl) { + this.changedOpenIdConnectUrl = changedOpenIdConnectUrl; + return this; + } + + public ChangedSecurityScheme setChangedScopes(final ChangedSecuritySchemeScopes changedScopes) { + this.changedScopes = changedScopes; + return this; + } + + public ChangedSecurityScheme setDescription(final ChangedMetadata description) { + this.description = description; + return this; + } + + public ChangedSecurityScheme setOAuthFlows(final ChangedOAuthFlows oAuthFlows) { + this.oAuthFlows = oAuthFlows; + return this; + } + + public ChangedSecurityScheme setExtensions(final ChangedExtensions extensions) { + this.extensions = extensions; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedSecurityScheme that = (ChangedSecurityScheme) o; + return changedType == that.changedType + && changedIn == that.changedIn + && changedScheme == that.changedScheme + && changedBearerFormat == that.changedBearerFormat + && changedOpenIdConnectUrl == that.changedOpenIdConnectUrl + && Objects.equals(oldSecurityScheme, that.oldSecurityScheme) + && Objects.equals(newSecurityScheme, that.newSecurityScheme) + && Objects.equals(changedScopes, that.changedScopes) + && Objects.equals(description, that.description) + && Objects.equals(oAuthFlows, that.oAuthFlows) + && Objects.equals(extensions, that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash( + oldSecurityScheme, + newSecurityScheme, + changedType, + changedIn, + changedScheme, + changedBearerFormat, + changedOpenIdConnectUrl, + changedScopes, + description, + oAuthFlows, + extensions); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedSecurityScheme(oldSecurityScheme=" + + this.getOldSecurityScheme() + + ", newSecurityScheme=" + + this.getNewSecurityScheme() + + ", changedType=" + + this.isChangedType() + + ", changedIn=" + + this.isChangedIn() + + ", changedScheme=" + + this.isChangedScheme() + + ", changedBearerFormat=" + + this.isChangedBearerFormat() + + ", changedOpenIdConnectUrl=" + + this.isChangedOpenIdConnectUrl() + + ", changedScopes=" + + this.getChangedScopes() + + ", description=" + + this.getDescription() + + ", oAuthFlows=" + + this.getOAuthFlows() + + ", extensions=" + + this.getExtensions() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/Endpoint.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/Endpoint.java index bc940c33..13015c45 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/Endpoint.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/Endpoint.java @@ -2,15 +2,12 @@ import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; -import lombok.Data; +import java.util.Objects; -@Data public class Endpoint { - private String pathUrl; private PathItem.HttpMethod method; private String summary; - private PathItem path; private Operation operation; @@ -18,4 +15,63 @@ public class Endpoint { public String toString() { return method + " " + pathUrl; } + + public Endpoint() {} + + public String getPathUrl() { + return this.pathUrl; + } + + public PathItem.HttpMethod getMethod() { + return this.method; + } + + public String getSummary() { + return this.summary; + } + + public PathItem getPath() { + return this.path; + } + + public Operation getOperation() { + return this.operation; + } + + public void setPathUrl(final String pathUrl) { + this.pathUrl = pathUrl; + } + + public void setMethod(final PathItem.HttpMethod method) { + this.method = method; + } + + public void setSummary(final String summary) { + this.summary = summary; + } + + public void setPath(final PathItem path) { + this.path = path; + } + + public void setOperation(final Operation operation) { + this.operation = operation; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Endpoint endpoint = (Endpoint) o; + return Objects.equals(pathUrl, endpoint.pathUrl) + && method == endpoint.method + && Objects.equals(summary, endpoint.summary) + && Objects.equals(path, endpoint.path) + && Objects.equals(operation, endpoint.operation); + } + + @Override + public int hashCode() { + return Objects.hash(pathUrl, method, summary, path, operation); + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/model/schema/ChangedMaxLength.java b/core/src/main/java/com/qdesrame/openapi/diff/core/model/schema/ChangedMaxLength.java index 31780dc6..b7e21ab5 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/model/schema/ChangedMaxLength.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/model/schema/ChangedMaxLength.java @@ -4,14 +4,11 @@ import com.qdesrame.openapi.diff.core.model.DiffContext; import com.qdesrame.openapi.diff.core.model.DiffResult; import java.util.Objects; -import lombok.Value; -@Value -public class ChangedMaxLength implements Changed { - - Integer oldValue; - Integer newValue; - DiffContext context; +public final class ChangedMaxLength implements Changed { + private final Integer oldValue; + private final Integer newValue; + private final DiffContext context; @Override public DiffResult isChanged() { @@ -24,4 +21,49 @@ public DiffResult isChanged() { } return DiffResult.INCOMPATIBLE; } + + public ChangedMaxLength( + final Integer oldValue, final Integer newValue, final DiffContext context) { + this.oldValue = oldValue; + this.newValue = newValue; + this.context = context; + } + + public Integer getOldValue() { + return this.oldValue; + } + + public Integer getNewValue() { + return this.newValue; + } + + public DiffContext getContext() { + return this.context; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChangedMaxLength that = (ChangedMaxLength) o; + return Objects.equals(oldValue, that.oldValue) + && Objects.equals(newValue, that.newValue) + && Objects.equals(context, that.context); + } + + @Override + public int hashCode() { + return Objects.hash(oldValue, newValue, context); + } + + @java.lang.Override + public java.lang.String toString() { + return "ChangedMaxLength(oldValue=" + + this.getOldValue() + + ", newValue=" + + this.getNewValue() + + ", context=" + + this.getContext() + + ")"; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/output/MarkdownRender.java b/core/src/main/java/com/qdesrame/openapi/diff/core/output/MarkdownRender.java index 88e8801b..30491cb2 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/output/MarkdownRender.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/output/MarkdownRender.java @@ -16,17 +16,13 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import java.util.List; import java.util.Map; -import lombok.Getter; -import lombok.Setter; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MarkdownRender implements Render { - public static final Logger LOGGER = LoggerFactory.getLogger(MarkdownRender.class); - protected static RefPointer refPointer = new RefPointer<>(RefType.SCHEMAS); protected final String H3 = "### "; protected final String H4 = "#### "; @@ -39,20 +35,19 @@ public class MarkdownRender implements Render { protected final String LI = "* "; protected final String HR = "---\n"; protected ChangedOpenApi diff; - /** * A paramater which indicates whether or not metadata (summary and metadata) changes should be * logged in the changelog file. */ - @Getter @Setter protected boolean showChangedMetadata; + protected boolean showChangedMetadata; public MarkdownRender() {} public String render(ChangedOpenApi diff) { this.diff = diff; - return listEndpoints("What's New", diff.getNewEndpoints()) - + listEndpoints("What's Deleted", diff.getMissingEndpoints()) - + listEndpoints("What's Deprecated", diff.getDeprecatedEndpoints()) + return listEndpoints("What\'s New", diff.getNewEndpoints()) + + listEndpoints("What\'s Deleted", diff.getMissingEndpoints()) + + listEndpoints("What\'s Deprecated", diff.getDeprecatedEndpoints()) + listEndpoints(diff.getChangedOperations()); } @@ -83,7 +78,7 @@ protected String titleH5(String title) { protected String listEndpoints(List changedOperations) { if (null == changedOperations || changedOperations.size() == 0) return ""; - StringBuilder sb = new StringBuilder(sectionTitle("What's Changed")); + StringBuilder sb = new StringBuilder(sectionTitle("What\'s Changed")); changedOperations.stream() .map( operation -> { @@ -253,12 +248,13 @@ protected String oneOfSchema(int deepness, ChangedOneOfSchema schema, String dis .getMissing() .keySet() .forEach( - key -> sb.append(format("%sDeleted '%s' %s\n", indent(deepness), key, discriminator))); + key -> + sb.append(format("%sDeleted \'%s\' %s\n", indent(deepness), key, discriminator))); schema .getIncreased() .forEach( (key, sub) -> - sb.append(format("%sAdded '%s' %s:\n", indent(deepness), key, discriminator)) + sb.append(format("%sAdded \'%s\' %s:\n", indent(deepness), key, discriminator)) .append(schema(deepness, sub, schema.getContext()))); schema .getChanged() @@ -550,4 +546,20 @@ protected Schema resolve(Schema schema) { return refPointer.resolveRef( diff.getNewSpecOpenApi().getComponents(), schema, schema.get$ref()); } + + /** + * A paramater which indicates whether or not metadata (summary and metadata) changes should be + * logged in the changelog file. + */ + public boolean isShowChangedMetadata() { + return this.showChangedMetadata; + } + + /** + * A paramater which indicates whether or not metadata (summary and metadata) changes should be + * logged in the changelog file. + */ + public void setShowChangedMetadata(final boolean showChangedMetadata) { + this.showChangedMetadata = showChangedMetadata; + } } diff --git a/core/src/main/java/com/qdesrame/openapi/diff/core/utils/RefType.java b/core/src/main/java/com/qdesrame/openapi/diff/core/utils/RefType.java index 44b34e68..564e309d 100644 --- a/core/src/main/java/com/qdesrame/openapi/diff/core/utils/RefType.java +++ b/core/src/main/java/com/qdesrame/openapi/diff/core/utils/RefType.java @@ -1,20 +1,20 @@ package com.qdesrame.openapi.diff.core.utils; -import lombok.Getter; - -@Getter public enum RefType { REQUEST_BODIES("requestBodies"), RESPONSES("responses"), PARAMETERS("parameters"), SCHEMAS("schemas"), HEADERS("headers"), - SECURITY_SCHEMES("securitySchemes"), - ; + SECURITY_SCHEMES("securitySchemes"); RefType(String name) { this.name = name; } private final String name; + + public String getName() { + return this.name; + } } diff --git a/pom.xml b/pom.xml index 49167d44..1d8a4d6c 100644 --- a/pom.xml +++ b/pom.xml @@ -137,12 +137,6 @@ commons-httpclient 3.1 - - org.projectlombok - lombok - 1.18.14 - provided - org.assertj assertj-core