ottobackwards commented on a change in pull request #4656:
URL: https://github.com/apache/nifi/pull/4656#discussion_r526088956



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ParameterContextResource.java
##########
@@ -400,11 +400,14 @@ public Response submitParameterContextUpdate(
     }
 
     private void validateParameterNames(final ParameterContextDTO 
parameterContextDto) {
-        for (final ParameterEntity entity : 
parameterContextDto.getParameters()) {
-            final String parameterName = entity.getParameter().getName();
-            if (!isLegalParameterName(parameterName)) {
-                throw new IllegalArgumentException("Request contains an 
illegal Parameter Name (" + parameterName + "). Parameter names may only 
include letters, numbers, spaces, and the special " +
-                    "characters .-_");
+        if (parameterContextDto.getParameters() != null) {

Review comment:
       ok, so the parameters are not marked as being required
   
   ```java
   @ApiModelProperty("The Parameters for the Parameter Context")
       public Set<ParameterEntity> getParameters() {
           return parameters;
       }
   ```
   
   So I think that throwing here is against the openapi spec and the contract 
in general.
   I'm not sure if chaffelson found this because of how openapi generated the 
code or not, but I don't think throwing here is right based on that.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to