Skip to content

Commit

Permalink
RE: Fixed detection of confluent subject name strategy when subject i…
Browse files Browse the repository at this point in the history
…s not defined
  • Loading branch information
mtseluiko committed Dec 14, 2022
1 parent b009dd8 commit 6c8ab5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reverse_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const getPackages = (avroSchema, jsonSchemas) => {
};

const inferSchemaNameStrategy = ({ name, namespace, confluentSubjectName, schemaTopic }) => {
let splittedSubjectName = confluentSubjectName.split('-').filter(Boolean);
let splittedSubjectName = (confluentSubjectName || '').split('-').filter(Boolean);
const endsWithSchemaType = ['key', 'value'].includes(_.last(splittedSubjectName));
const startsWithTopic = _.first(splittedSubjectName) === schemaTopic;

Expand All @@ -104,7 +104,7 @@ const inferSchemaNameStrategy = ({ name, namespace, confluentSubjectName, schema

const splittedRecordName = [
namespace,
...name.split('-'),
...(name || '').split('-'),
].filter(Boolean);

const recordNameStrategy = _.isEqual(splittedRecordName, splittedSubjectName);
Expand Down

0 comments on commit 6c8ab5d

Please sign in to comment.