Skip to content

Commit 61b6a86

Browse files
committed
Update release notes wrt #64
1 parent 8d79756 commit 61b6a86

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

release-notes/CREDITS

+6
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ Greg Adams (gadams00@github)
1616

1717
#47: VisitorContext results in incomplete json schema output
1818
(2.4.4)
19+
20+
Izek Greenfield (igreenfield@github)
21+
22+
#64: Add support to oneOf
23+
(2.6.0)
24+

release-notes/VERSION

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project: jackson-module-jsonSchema
77
2.6.0 (not yet released)
88

99
#60: Add `readonly` property to `JsonSchema`
10+
#64: Add support to oneOf
11+
(contributed by Izek K, igreenfield@github)
1012
- Added `JsonSchemaGenerator(ObjectWriter)` to allow use of (re-)configured `ObjectWriter`
1113
instead of `ObjectMapper` which can not be configured.
1214

src/main/java/com/fasterxml/jackson/module/jsonSchema/types/ContainerTypeSchema.java

+7-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.fasterxml.jackson.module.jsonSchema.types;
22

3+
import java.util.Collections;
34
import java.util.HashSet;
45
import java.util.Set;
56

@@ -10,7 +11,6 @@
1011
* This class encapsulates the functionality of container type {@link JsonSchema}
1112
* Array and Object
1213
* @author jphelan
13-
*
1414
*/
1515
public abstract class ContainerTypeSchema extends SimpleTypeSchema {
1616
/**
@@ -23,12 +23,8 @@ of enum values uses the same algorithm as defined in "uniqueItems"
2323
(Section 5.15).
2424
*/
2525
@JsonProperty(value = "enum", required = true)
26-
private Set<String> enums;
26+
private Set<String> enums = Collections.emptySet();
2727

28-
//instance initializer block
29-
{
30-
enums = new HashSet<String>();
31-
}
3228
/**
3329
* This provides an enumeration of all possible values that are valid
3430
for the instance property. This MUST be an array, and each item in
@@ -39,13 +35,7 @@ of enum values uses the same algorithm as defined in "uniqueItems"
3935
(Section 5.15).
4036
*/
4137
@JsonProperty(value = "oneOf", required = true)
42-
private Set<Object> oneOf;
43-
//instance initializer block
44-
{
45-
oneOf = new HashSet<Object>();
46-
}
47-
48-
38+
private Set<Object> oneOf = Collections.emptySet();
4939

5040
/* (non-Javadoc)
5141
* @see com.fasterxml.jackson.databind.jsonSchema.types.JsonSchema#asContainerSchema()
@@ -58,13 +48,13 @@ of enum values uses the same algorithm as defined in "uniqueItems"
5848
*/
5949
@Override
6050
public boolean equals(Object obj) {
61-
if (obj instanceof ContainerTypeSchema) {
51+
if (obj == this) return true;
52+
if (obj instanceof ContainerTypeSchema) {
6253
ContainerTypeSchema that = (ContainerTypeSchema)obj;
6354
return equals(getEnums(), that.getEnums()) &&
6455
super.equals(obj);
65-
} else {
66-
return false;
67-
}
56+
}
57+
return false;
6858
}
6959

7060
public Set<String> getEnums() {

0 commit comments

Comments
 (0)