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

fix(catalog): Avoid offering already existing single properties. #398

Merged

Conversation

lordrip
Copy link
Member

@lordrip lordrip commented Nov 22, 2023

Context

For some Processors like Choice and DoTry, there are properties that could contain nested processors. In case of Choice, it's the otherwise property.

Changes

This pull request checks what's already defined in the Processor to avoid offering it again since it might cause data loss.

Screencast

Screencast.from.2023-11-22.15-22-23.webm

Fixes: #334

* Context
For some Processors like `Choice` and `DoTry`, there are properties that could
contain nested processors. In case of `Choice`, it's the `otherwise` property.

* Changes
This commit check what's already defined in the `Processor` to avoid offering it again
since it might cause data loss.

Fixes: KaotoIO#334
@lordrip lordrip force-pushed the fix/avoid-offer-existing-single-properties branch from c456ecb to 9cee228 Compare November 22, 2023 14:41
@lordrip lordrip merged commit 732220d into KaotoIO:main Nov 22, 2023
6 checks passed
Comment on lines +119 to +120
if (!definitionKeys.includes('doTry')) {
specialChildren.doTry.push('doTry');
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be specified "doFinally"?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right @tplevko, thanks for catching this up, I'll create another pull request to fix this.

lordrip added a commit to lordrip/kaoto that referenced this pull request Nov 22, 2023
lordrip added a commit to lordrip/kaoto that referenced this pull request Nov 22, 2023
lordrip added a commit that referenced this pull request Nov 22, 2023
@lordrip lordrip deleted the fix/avoid-offer-existing-single-properties branch November 23, 2023 21:08
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.

Adding an otherwise when there is already one is overriding the existing one
3 participants