Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE: fixed forward-engineering of default and symboldDefault values of enum #155

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

Vitalii4as
Copy link
Contributor

There are 2 defaults in Avro in ennum type - one is on field level used for backwards compatibility, second is in "type" used for forwards compatibility, more in this article. I fixed forward-engineering of enum on both levels

@Vitalii4as Vitalii4as self-assigned this Mar 25, 2024
Comment on lines 209 to 212
const redundantAttributes = _.reject(
GENERAL_ATTRIBUTES,
attribute => attribute === 'default' && typeSchema.type === 'enum',
);
Copy link
Contributor

@taras-dubyk taras-dubyk Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be more readable this way?

Suggested change
const redundantAttributes = _.reject(
GENERAL_ATTRIBUTES,
attribute => attribute === 'default' && typeSchema.type === 'enum',
);
const redundantAttributes = typeSchema.type === 'enum' ? _.without(GENERAL_ATTRIBUTES, 'default') : GENERAL_ATTRIBUTES;

Ignore it if you disagree.

@taras-dubyk taras-dubyk added this pull request to the merge queue Mar 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 26, 2024
@taras-dubyk taras-dubyk merged commit bc4d013 into master Mar 26, 2024
2 checks passed
@taras-dubyk taras-dubyk deleted the fix/HCK-5048 branch March 26, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants