Skip to content

Commit db698c4

Browse files
committed
taking readOnly & writeOnly into account in hashCode and equals()
1 parent 64f92b3 commit db698c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/java/org/everit/json/schema/Schema.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,17 @@ public boolean equals(Object o) {
185185
Objects.equals(defaultValue, schema.defaultValue) &&
186186
Objects.equals(description, schema.description) &&
187187
Objects.equals(id, schema.id) &&
188-
Objects.equals(nullable, schema.nullable);
188+
Objects.equals(nullable, schema.nullable) &&
189+
readOnly == schema.readOnly &&
190+
writeOnly == schema.writeOnly;
189191
} else {
190192
return false;
191193
}
192194
}
193195

194196
@Override
195197
public int hashCode() {
196-
return Objects.hash(title, description, id, defaultValue, nullable);
198+
return Objects.hash(title, description, id, defaultValue, nullable, readOnly, writeOnly);
197199
}
198200

199201
public String getTitle() {

0 commit comments

Comments
 (0)