Skip to content

Commit

Permalink
Updated Schema.js to lookup shared schemas by fully qualified name (#132
Browse files Browse the repository at this point in the history
)

Shared lookup fails in the case that two Avro records have the
same namespace and the referrer defines the referent's name without using
a fully qualified name. This resolves the issue by using the
referent's fully qualified name for the lookup.

Co-authored-by: mikaello <2505178+mikaello@users.noreply.github.com>
  • Loading branch information
crimsonmagick and mikaello authored Oct 19, 2023
1 parent 4b2eeea commit 5f1ae87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ AvroDoc.Schema = function (avrodoc, shared_types, schema_json, filename) {
return type;
} else if (hasOwnPropertyS(shared_types, qualifiedNameStr)) {
const sharedType = shared_types[qualifiedNameStr].find(
(sharedSchema) => sharedSchema.qualified_name === name,
(sharedSchema) => sharedSchema.qualified_name === qualifiedNameStr,
);

if (sharedType) {
Expand Down

0 comments on commit 5f1ae87

Please sign in to comment.