-
Notifications
You must be signed in to change notification settings - Fork 5
v3_CASL-1159_naksha-cli-generating-storage-config-validation #488
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
base: v3
Are you sure you want to change the base?
v3_CASL-1159_naksha-cli-generating-storage-config-validation #488
Conversation
4ce2c7c to
2151776
Compare
| import java.util.List; | ||
|
|
||
| @FunctionalInterface | ||
| public interface Validator<T, S> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's T and S? some doc would be nice
|
|
||
| @Override | ||
| @NotNull | ||
| protected PlatformMap createData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For initial data population - use onCreation rather than createData
| ); | ||
| } | ||
| validateFields(map); | ||
| super.bind(data, symbol); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think bind is the best place to perform validation. This adds on behavior that this method was not responsible for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it would be best to keep Proxy-related logic unaware of validation and vice-versa. So that we don't rely on Proxy lifecycle methods.
One potential solution is client-side validation where we pass the validated object as parameter
Signed-off-by: Bartosz Czyż <[email protected]> # Conflicts: # here-naksha-cli/src/jvmMain/java/com/here/naksha/cli/copy/CopyCommand.java # here-naksha-cli/src/jvmMain/java/com/here/naksha/cli/copy/service/CopyService.java # here-naksha-cli/src/jvmTest/java/com/here/naksha/cli/copy/CopyCliTest.java
2151776 to
951145d
Compare
No description provided.