Skip to content

Commit ee3f4f4

Browse files
committed
Update json-schema-validator dependency to 2.1.2
Adapt code accordingly.
1 parent 8f150d1 commit ee3f4f4

24 files changed

+40
-38
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<dependency>
7171
<groupId>com.github.fge</groupId>
7272
<artifactId>json-schema-validator</artifactId>
73-
<version>2.0.1</version>
73+
<version>2.1.2</version>
7474
</dependency>
7575
<dependency>
7676
<groupId>org.apache.avro</groupId>

src/main/java/com/github/fge/avro/Avro2JsonSchemaProcessor.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
import com.fasterxml.jackson.databind.JsonNode;
44
import com.github.fge.avro.translators.AvroTranslators;
55
import com.github.fge.jsonschema.exceptions.ProcessingException;
6-
import com.github.fge.jsonschema.processing.Processor;
6+
import com.github.fge.jsonschema.processing.RawProcessor;
77
import com.github.fge.jsonschema.report.ProcessingReport;
88
import com.github.fge.jsonschema.tree.CanonicalSchemaTree;
99
import com.github.fge.jsonschema.tree.JsonTree;
1010
import com.github.fge.jsonschema.tree.SchemaTree;
11-
import com.github.fge.jsonschema.util.ValueHolder;
1211
import org.apache.avro.AvroRuntimeException;
1312
import org.apache.avro.Schema;
1413

1514
public final class Avro2JsonSchemaProcessor
16-
implements Processor<ValueHolder<JsonTree>, ValueHolder<SchemaTree>>
15+
extends RawProcessor<JsonTree, SchemaTree>
1716
{
17+
public Avro2JsonSchemaProcessor()
18+
{
19+
super("avroSchema", "schema");
20+
}
21+
1822
@Override
19-
public ValueHolder<SchemaTree> process(final ProcessingReport report,
20-
final ValueHolder<JsonTree> input)
23+
public SchemaTree rawProcess(final ProcessingReport report,
24+
final JsonTree input)
2125
throws ProcessingException
2226
{
23-
final JsonNode node = input.getValue().getBaseNode();
27+
final JsonNode node = input.getBaseNode();
2428

2529
final Schema avroSchema;
2630
try {
@@ -43,8 +47,6 @@ public ValueHolder<SchemaTree> process(final ProcessingReport report,
4347
AvroTranslators.getTranslator(avroType)
4448
.translate(avroSchema, tree, report);
4549

46-
final SchemaTree schemaTree
47-
= new CanonicalSchemaTree(tree.getBaseNode());
48-
return ValueHolder.hold("schema", schemaTree);
50+
return new CanonicalSchemaTree(tree.getBaseNode());
4951
}
5052
}

src/main/java/com/github/fge/avro/MutableTree.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import com.fasterxml.jackson.databind.JsonNode;
44
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
55
import com.fasterxml.jackson.databind.node.ObjectNode;
6-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
6+
import com.github.fge.jackson.JacksonUtils;
7+
import com.github.fge.jackson.NodeType;
8+
import com.github.fge.jackson.jsonpointer.JsonPointer;
79
import com.github.fge.jsonschema.util.AsJson;
8-
import com.github.fge.jsonschema.util.JacksonUtils;
9-
import com.github.fge.jsonschema.util.NodeType;
1010
import net.jcip.annotations.NotThreadSafe;
1111

1212
@NotThreadSafe

src/main/java/com/github/fge/avro/translators/ArrayTranslator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import com.fasterxml.jackson.databind.node.ObjectNode;
44
import com.github.fge.avro.MutableTree;
5+
import com.github.fge.jackson.NodeType;
6+
import com.github.fge.jackson.jsonpointer.JsonPointer;
57
import com.github.fge.jsonschema.exceptions.ProcessingException;
6-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
78
import com.github.fge.jsonschema.report.ProcessingReport;
8-
import com.github.fge.jsonschema.util.NodeType;
99
import org.apache.avro.Schema;
1010

1111
final class ArrayTranslator

src/main/java/com/github/fge/avro/translators/AvroTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
44
import com.github.fge.avro.MutableTree;
5+
import com.github.fge.jackson.JacksonUtils;
56
import com.github.fge.jsonschema.exceptions.ProcessingException;
67
import com.github.fge.jsonschema.report.ProcessingMessage;
78
import com.github.fge.jsonschema.report.ProcessingReport;
8-
import com.github.fge.jsonschema.util.JacksonUtils;
99
import org.apache.avro.Schema;
1010

1111
public abstract class AvroTranslator

src/main/java/com/github/fge/avro/translators/AvroTranslators.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.github.fge.avro.translators;
22

3-
import com.github.fge.jsonschema.util.NodeType;
3+
import com.github.fge.jackson.NodeType;
44
import com.google.common.collect.ImmutableMap;
55
import org.apache.avro.Schema;
66

src/main/java/com/github/fge/avro/translators/ByteTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.github.fge.avro.translators;
22

33
import com.github.fge.avro.MutableTree;
4+
import com.github.fge.jackson.NodeType;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
56
import com.github.fge.jsonschema.report.ProcessingReport;
6-
import com.github.fge.jsonschema.util.NodeType;
77
import org.apache.avro.Schema;
88

99
final class ByteTranslator

src/main/java/com/github/fge/avro/translators/FixedTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.github.fge.avro.translators;
22

33
import com.github.fge.avro.MutableTree;
4+
import com.github.fge.jackson.NodeType;
45
import com.github.fge.jsonschema.report.ProcessingReport;
5-
import com.github.fge.jsonschema.util.NodeType;
66
import org.apache.avro.Schema;
77

88
final class FixedTranslator

src/main/java/com/github/fge/avro/translators/IntTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.github.fge.avro.translators;
22

33
import com.github.fge.avro.MutableTree;
4+
import com.github.fge.jackson.NodeType;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
56
import com.github.fge.jsonschema.report.ProcessingReport;
6-
import com.github.fge.jsonschema.util.NodeType;
77
import org.apache.avro.Schema;
88

99
final class IntTranslator

src/main/java/com/github/fge/avro/translators/LongTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.github.fge.avro.translators;
22

33
import com.github.fge.avro.MutableTree;
4+
import com.github.fge.jackson.NodeType;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
56
import com.github.fge.jsonschema.report.ProcessingReport;
6-
import com.github.fge.jsonschema.util.NodeType;
77
import org.apache.avro.Schema;
88

99
final class LongTranslator

src/main/java/com/github/fge/avro/translators/MapTranslator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import com.fasterxml.jackson.databind.node.ObjectNode;
44
import com.github.fge.avro.MutableTree;
5+
import com.github.fge.jackson.NodeType;
6+
import com.github.fge.jackson.jsonpointer.JsonPointer;
57
import com.github.fge.jsonschema.exceptions.ProcessingException;
6-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
78
import com.github.fge.jsonschema.report.ProcessingReport;
8-
import com.github.fge.jsonschema.util.NodeType;
99
import org.apache.avro.Schema;
1010

1111
final class MapTranslator

src/main/java/com/github/fge/avro/translators/NamedAvroTypeTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.github.fge.avro.translators;
22

33
import com.github.fge.avro.MutableTree;
4+
import com.github.fge.jackson.jsonpointer.JsonPointer;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
56
import com.github.fge.jsonschema.exceptions.unchecked.ProcessingError;
6-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
77
import com.github.fge.jsonschema.report.ProcessingMessage;
88
import com.github.fge.jsonschema.report.ProcessingReport;
99
import org.apache.avro.Schema;

src/main/java/com/github/fge/avro/translators/RecordTranslator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import com.fasterxml.jackson.databind.node.ArrayNode;
44
import com.fasterxml.jackson.databind.node.ObjectNode;
55
import com.github.fge.avro.MutableTree;
6+
import com.github.fge.jackson.JsonLoader;
7+
import com.github.fge.jackson.NodeType;
8+
import com.github.fge.jackson.jsonpointer.JsonPointer;
69
import com.github.fge.jsonschema.exceptions.ProcessingException;
7-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
810
import com.github.fge.jsonschema.report.ProcessingReport;
9-
import com.github.fge.jsonschema.util.JsonLoader;
10-
import com.github.fge.jsonschema.util.NodeType;
1111
import org.apache.avro.Schema;
1212
import org.codehaus.jackson.JsonNode;
1313
import org.codehaus.jackson.map.ObjectMapper;

src/main/java/com/github/fge/avro/translators/SimpleTypeTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.github.fge.avro.translators;
22

33
import com.github.fge.avro.MutableTree;
4+
import com.github.fge.jackson.NodeType;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
56
import com.github.fge.jsonschema.report.ProcessingReport;
6-
import com.github.fge.jsonschema.util.NodeType;
77
import org.apache.avro.Schema;
88

99
final class SimpleTypeTranslator

src/main/java/com/github/fge/avro/translators/UnionTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import com.fasterxml.jackson.databind.node.ArrayNode;
44
import com.github.fge.avro.MutableTree;
5+
import com.github.fge.jackson.jsonpointer.JsonPointer;
56
import com.github.fge.jsonschema.exceptions.ProcessingException;
6-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
77
import com.github.fge.jsonschema.report.ProcessingReport;
88
import org.apache.avro.Schema;
99

src/main/java/com/github/fge/jsonschema2avro/predicates/AvroPredicates.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.github.fge.jsonschema2avro.predicates;
22

33
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.github.fge.jackson.NodeType;
45
import com.github.fge.jsonschema.library.DraftV4Library;
56
import com.github.fge.jsonschema.processors.validation.ArraySchemaDigester;
67
import com.github.fge.jsonschema.processors.validation.ObjectSchemaDigester;
7-
import com.github.fge.jsonschema.util.NodeType;
88
import com.github.fge.jsonschema2avro.AvroPayload;
99
import com.google.common.base.CharMatcher;
1010
import com.google.common.base.Predicate;

src/main/java/com/github/fge/jsonschema2avro/writers/ArrayWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.github.fge.jsonschema2avro.writers;
22

33
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.github.fge.jackson.jsonpointer.JsonPointer;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
5-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
66
import com.github.fge.jsonschema.report.ProcessingReport;
77
import com.github.fge.jsonschema.tree.SchemaTree;
88
import com.github.fge.jsonschema.util.ValueHolder;

src/main/java/com/github/fge/jsonschema2avro/writers/MapWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.github.fge.jsonschema2avro.writers;
22

3+
import com.github.fge.jackson.jsonpointer.JsonPointer;
34
import com.github.fge.jsonschema.exceptions.ProcessingException;
4-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
55
import com.github.fge.jsonschema.report.ProcessingReport;
66
import com.github.fge.jsonschema.tree.SchemaTree;
77
import com.github.fge.jsonschema.util.ValueHolder;

src/main/java/com/github/fge/jsonschema2avro/writers/RecordWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.github.fge.jsonschema2avro.writers;
22

3+
import com.github.fge.jackson.jsonpointer.JsonPointer;
34
import com.github.fge.jsonschema.exceptions.ProcessingException;
4-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
55
import com.github.fge.jsonschema.report.ProcessingReport;
66
import com.github.fge.jsonschema.tree.SchemaTree;
77
import com.github.fge.jsonschema.util.ValueHolder;

src/main/java/com/github/fge/jsonschema2avro/writers/SimpleTypeWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.github.fge.jsonschema2avro.writers;
22

33
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.github.fge.jackson.NodeType;
45
import com.github.fge.jsonschema.report.ProcessingReport;
56
import com.github.fge.jsonschema.tree.SchemaTree;
6-
import com.github.fge.jsonschema.util.NodeType;
77
import com.github.fge.jsonschema2avro.AvroWriterProcessor;
88
import com.google.common.collect.ImmutableMap;
99
import org.apache.avro.Schema;

src/main/java/com/github/fge/jsonschema2avro/writers/SimpleUnionWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.github.fge.jsonschema2avro.writers;
22

33
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.github.fge.jackson.jsonpointer.JsonPointer;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
5-
import com.github.fge.jsonschema.jsonpointer.JsonPointer;
66
import com.github.fge.jsonschema.report.ProcessingReport;
77
import com.github.fge.jsonschema.tree.SchemaTree;
88
import com.github.fge.jsonschema.util.ValueHolder;

src/test/java/com/github/fge/avro/Avro2JsonSchemaProcessorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.github.fge.avro;
22

33
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.github.fge.jackson.JsonLoader;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
56
import com.github.fge.jsonschema.report.DevNullProcessingReport;
67
import com.github.fge.jsonschema.report.ProcessingMessage;
78
import com.github.fge.jsonschema.report.ProcessingReport;
89
import com.github.fge.jsonschema.tree.JsonTree;
910
import com.github.fge.jsonschema.tree.SimpleJsonTree;
10-
import com.github.fge.jsonschema.util.JsonLoader;
1111
import com.github.fge.jsonschema.util.ValueHolder;
1212
import org.apache.avro.SchemaParseException;
1313
import org.testng.annotations.BeforeClass;

src/test/java/com/github/fge/avro/AvroTranslationsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.fge.avro;
22

33
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.github.fge.jackson.JsonLoader;
45
import com.github.fge.jsonschema.cfg.ValidationConfiguration;
56
import com.github.fge.jsonschema.exceptions.ProcessingException;
67
import com.github.fge.jsonschema.processors.syntax.SyntaxValidator;
@@ -9,7 +10,6 @@
910
import com.github.fge.jsonschema.tree.JsonTree;
1011
import com.github.fge.jsonschema.tree.SchemaTree;
1112
import com.github.fge.jsonschema.tree.SimpleJsonTree;
12-
import com.github.fge.jsonschema.util.JsonLoader;
1313
import com.github.fge.jsonschema.util.ValueHolder;
1414
import com.google.common.collect.Lists;
1515
import org.testng.annotations.BeforeMethod;

src/test/java/com/github/fge/jsonschema2avro/AvroWriterProcessorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.github.fge.jsonschema2avro;
22

33
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.github.fge.jackson.JsonLoader;
45
import com.github.fge.jsonschema.exceptions.ProcessingException;
56
import com.github.fge.jsonschema.report.ProcessingReport;
67
import com.github.fge.jsonschema.tree.CanonicalSchemaTree;
78
import com.github.fge.jsonschema.tree.SchemaTree;
8-
import com.github.fge.jsonschema.util.JsonLoader;
99
import com.github.fge.jsonschema.util.ValueHolder;
1010
import com.google.common.collect.Lists;
1111
import org.apache.avro.Schema;

0 commit comments

Comments
 (0)