-
Notifications
You must be signed in to change notification settings - Fork 5k
[Improvement-17942][API&UI]Add startParams validation logic in both the frontend and backend. #17956
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: dev
Are you sure you want to change the base?
Conversation
| // UI configuration state from form management hook | ||
| ...startState.startForm, | ||
| // Business data injected from modal operations hook | ||
| startParamsList: variables.startParamsList |
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.
| // UI configuration state from form management hook | |
| ...startState.startForm, | |
| // Business data injected from modal operations hook | |
| startParamsList: variables.startParamsList | |
| ...startState.startForm, | |
| startParamsList: variables.startParamsList |
| // null key | ||
| if (StringUtils.isEmpty(param.getProp())) { | ||
| throw new ServiceException("Parameter key cannot be empty"); | ||
| } | ||
|
|
||
| String key = param.getProp().trim(); | ||
| // duplicate keys | ||
| if (keys.contains(key)) { | ||
| throw new ServiceException("Duplicate parameter key: " + key); | ||
| } | ||
| keys.add(key); | ||
|
|
||
| // IN-type params require a non-empty value | ||
| if (Direct.IN.equals(param.getDirect()) && StringUtils.isEmpty(param.getValue())) { | ||
| throw new ServiceException("IN parameter value cannot be empty for key: " + key); | ||
| } |
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.
| // null key | |
| if (StringUtils.isEmpty(param.getProp())) { | |
| throw new ServiceException("Parameter key cannot be empty"); | |
| } | |
| String key = param.getProp().trim(); | |
| // duplicate keys | |
| if (keys.contains(key)) { | |
| throw new ServiceException("Duplicate parameter key: " + key); | |
| } | |
| keys.add(key); | |
| // IN-type params require a non-empty value | |
| if (Direct.IN.equals(param.getDirect()) && StringUtils.isEmpty(param.getValue())) { | |
| throw new ServiceException("IN parameter value cannot be empty for key: " + key); | |
| } | |
| if (StringUtils.isEmpty(param.getProp())) { | |
| throw new ServiceException("Parameter key cannot be empty"); | |
| } | |
| String key = param.getProp().trim(); | |
| if (keys.contains(key)) { | |
| throw new ServiceException("Duplicate parameter key: " + key); | |
| } | |
| if (Direct.IN.equals(param.getDirect()) && StringUtils.isEmpty(param.getValue())) { | |
| throw new ServiceException("IN parameter value cannot be empty for key: " + key); | |
| } | |
| keys.add(key); |
| if (startParamList == null || startParamList.isEmpty()) { | ||
| return; | ||
| } |
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.
| if (startParamList == null || startParamList.isEmpty()) { | |
| return; | |
| } | |
| if (CollectionUtils.isEmpty(startParamList)) { | |
| return; | |
| } |
|


Purpose of the pull request
close #17942
Brief change log
Add startParams validation logic in both the frontend and backend.
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md