exceptionfactory commented on code in PR #11208: URL: https://github.com/apache/nifi/pull/11208#discussion_r3197754449
########## nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/JsonParseMode.java: ########## @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.json; + +import org.apache.nifi.components.DescribedValue; + +enum JsonParseMode implements DescribedValue { Review Comment: ```suggestion enum ParsingStrategy implements DescribedValue { ``` ########## nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/JsonParserFactory.java: ########## @@ -42,14 +42,22 @@ public JsonParserFactory() { * JSON Parser Factory constructor with configurable constraints * * @param streamReadConstraints Stream Read Constraints - * @param allowComments Allow Comments during parsing + * @param lenient Allow for parsing JSON leniently */ - public JsonParserFactory(final StreamReadConstraints streamReadConstraints, final boolean allowComments) { + public JsonParserFactory(final StreamReadConstraints streamReadConstraints, final boolean lenient) { Review Comment: It looks like this should be changed to pass in the `ParsingStrategy` instead of the `boolean` ########## nifi-extension-bundles/nifi-extension-utils/nifi-record-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/AbstractJsonRowRecordReader.java: ########## @@ -71,6 +73,14 @@ public abstract class AbstractJsonRowRecordReader implements RecordReader { .addValidator(StandardValidators.BOOLEAN_VALIDATOR) .build(); + public static final PropertyDescriptor JSON_PARSE_MODE = new PropertyDescriptor.Builder() + .name("JSON Parse Mode") + .description("Specifies whether to parse the incoming JSON per the JSON specification or allow for lenient parsing") Review Comment: I recommend naming this `Parsing Strategy` since `JSON` is implied. ```suggestion public static final PropertyDescriptor PARSING_STRATEGY = new PropertyDescriptor.Builder() .name("Parsing Strategy") .description("Set the strategy for handling input content according to JSON specifications") ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
