-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial impl for AvroRecordUtil.validateNestedSchemasConsistent (#524)
- Loading branch information
1 parent
3b5d833
commit 39547a2
Showing
9 changed files
with
408 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...main/java/com/linkedin/avroutil1/compatibility/exception/InconsistentSchemaException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2023 LinkedIn Corp. | ||
* Licensed under the BSD 2-Clause License (the "License"). | ||
* See License in the project root for license information. | ||
*/ | ||
|
||
package com.linkedin.avroutil1.compatibility.exception; | ||
|
||
import com.linkedin.avroutil1.compatibility.avropath.AvroPath; | ||
|
||
/** | ||
* thrown to indicate there are multiple conflicting schema definitions | ||
* within the same object graph or group of generated specific record classes | ||
*/ | ||
public class InconsistentSchemaException extends Exception { | ||
/** | ||
* indicates the path to the location of the conflicting schema definition, from the | ||
* "root" (outer-most) object or schema. | ||
*/ | ||
private final AvroPath path; | ||
|
||
public InconsistentSchemaException(AvroPath path, String msg) { | ||
super(msg); | ||
this.path = path; | ||
} | ||
|
||
public AvroPath getPath() { | ||
return path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
.../tests/helper-tests-allavro/src/test/resources/allavro/innerSchemaValidation/BadEnum.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "enum", | ||
"namespace": "allavro.innerSchemaValidation", | ||
"name": "InnerEnum", | ||
"symbols": [ | ||
"A", "B", "EVIL" | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
...tests/helper-tests-allavro/src/test/resources/allavro/innerSchemaValidation/BadFixed.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "fixed", | ||
"namespace": "allavro.innerSchemaValidation", | ||
"name": "InnerFixed", | ||
"size": 666 | ||
} |
Oops, something went wrong.