You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Koji Kawamura (JIRA)" <ji...@apache.org> on 2018/11/28 03:16:00 UTC
[jira] [Commented] (NIFI-5843) Unclear validation message for
ScriptingComponentHelper
[ https://issues.apache.org/jira/browse/NIFI-5843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701352#comment-16701352 ]
Koji Kawamura commented on NIFI-5843:
-------------------------------------
[~alex_savitsky] Thanks for the suggestion.
Alternatively, we could combine the subjects like:
results.add(new ValidationResult.Builder().subject("Script Body or Script File").valid(false).explanation( "exactly one of Script File or Script Body must be set").build());
Do you mind submitting a PR if possible? I'm happy to review. Please refer the Contributor Guide for details and ask anything not clear.
https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide#ContributorGuide-providingCodeOrDocumentationContributionProvidingcodeordocumentationcontributions
> Unclear validation message for ScriptingComponentHelper
> -------------------------------------------------------
>
> Key: NIFI-5843
> URL: https://issues.apache.org/jira/browse/NIFI-5843
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework
> Affects Versions: 1.8.0
> Reporter: Alex Savitsky
> Priority: Trivial
>
> ScriptingComponentHelper.customValidate (from nifi-scripting-processors) creates an unclear validation message
> {quote}'' is invalid because Exactly one of Script File or Script Body must be set
> {quote}
> as it doesn't specify the validation subject. Since there are technically two invalid subjects in this case (Script File and Script Body), I suggest adding two validation messages, one for each subject.
> Current code:
> {code:java}
> results.add(new ValidationResult.Builder().valid(false).explanation(
> "Exactly one of Script File or Script Body must be set").build());
> {code}
> Proposed fix:
> {code:java}
> results.add(new ValidationResult.Builder().subject("Script Body").valid(false).explanation(
> "exactly one of Script File or Script Body must be set").build());
> results.add(new ValidationResult.Builder().subject("Script File").valid(false).explanation(
> "exactly one of Script File or Script Body must be set").build());
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)