Skip to content

Commit

Permalink
fixed register schema for multiple versions
Browse files Browse the repository at this point in the history
  • Loading branch information
manikawnth-abg committed Feb 7, 2019
1 parent 3647c70 commit 9bc0a12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/schema-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ function typeFromSchemaResponse(schema, parseOptions) {
var schemaType = avro.parse(schema);

//check if the schema has been previouisly parsed and added to the registry
if(typeof parseOptions.registry === 'object' && typeof parseOptions.registry[schemaType.name] !== 'undefined'){
return parseOptions.registry[schemaType.name];
if(typeof parseOptions.registry === 'object' && typeof parseOptions.registry[schemaType.name] !== 'undefined'){
//avsc registry works on the name of the schema and not on name+version.
//So, it's safe to delete the cached one in the registry parse the schema again
delete parseOptions.registry[schemaType.name];
}

return avro.parse(schema, parseOptions);
Expand Down

0 comments on commit 9bc0a12

Please sign in to comment.