exceptionfactory commented on PR #7665:
URL: https://github.com/apache/nifi/pull/7665#issuecomment-1764530205

   > @exceptionfactory Then would it be okay to have in `YamlTreeReader` code 
like:
   > 
   > ```
   > @Override
   >     protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
   >         final List<PropertyDescriptor> properties = new 
ArrayList<>(super.getSupportedPropertyDescriptors());
   >         //NOTE: Remove those properties which are not applicable for Yaml.
   >         properties.remove(AbstractJsonRowRecordReader.MAX_STRING_LENGTH);
   >         properties.remove(AbstractJsonRowRecordReader.ALLOW_COMMENTS);
   >         
   >         return properties;
   >     }
   > ```
   
   Thanks for the example @dan-s1, yes, if those properties do not appear to be 
honored with the YAML implementation, then that is one approach. However, given 
the number of times that this method will be called, it would be better to 
define a local static list of supported properties and return that reference in 
`getSupportedPropertyDescriptors()`. That does require manual maintenance of 
the list for the YAML Reader, but that is probably better in this case as it 
should force a review of whether any new property would apply to both the JSON 
and YAML implementations.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to