Skip to content

Commit

Permalink
fix: template uses anonymous schema name when object type is unknown (#…
Browse files Browse the repository at this point in the history
…296)

* fix: Throw error when schema type is unknown instead of setting to the x-schema-parser-id

* chore: remove comments
  • Loading branch information
CameronRushton authored Oct 20, 2022
1 parent ea82761 commit 860152d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions filters/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,7 @@ function fixType([name, javaName, property]) {
// Picking a type for the user may be difficult - especially since the first avro union value must be the default value which is normally of type null.
typeName = 'Object';
} else {
// check to see if it's a ref to another schema.
typeName = property.ext('x-parser-schema-id');

if (!typeName) {
throw new Error(`Can't determine the type of property ${ name}`);
}
throw new Error(`Can't determine the type of property ${ name }`);
}
} else if (type === 'array') {
if (!property.items()) {
Expand Down

0 comments on commit 860152d

Please sign in to comment.