Skip to content

Commit 748e381

Browse files
authored
Do not allow non-numeric JSON numbers in row metadata
1 parent cbd22fb commit 748e381

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

driver/src/main/java/oracle/nosql/driver/values/JsonUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -763,20 +763,20 @@ public static String convertBytesToHex(byte[] byteArray) {
763763
* Validates input is a valid JSON construct: object, array, string, number,
764764
* true, false or null. Throws IllegalArgumentException if not valid.
765765
* Multiple JSON Objects are not allowed. Strings must use only double
766-
* quotes ("). Allows non-numeric values: NaN, Infinity, -Infinity (and -INF).
766+
* quotes ("). Does not allow non-numeric values: NaN, Infinity, -Infinity
767+
* or zero leading numbers.
767768
*/
768769
public static void validateJsonConstruct(String jsonInput) {
769-
JsonOptions options = new JsonOptions()
770-
.setAllowNonNumericNumbers(true);
771-
validateJsonConstruct(jsonInput, options);
770+
validateJsonConstruct(jsonInput, null);
772771
}
773772

774773
/**
775774
* Validates input is a valid JSON construct: object, array, string, number,
776775
* true, false or null. Throws IllegalArgumentException if not valid.
777776
* Multiple JSON Objects are not allowed. Strings must use only double
778777
* quotes (").
779-
*/ public static void validateJsonConstruct(String jsonInput,
778+
*/
779+
public static void validateJsonConstruct(String jsonInput,
780780
JsonOptions options) {
781781

782782
try (JsonParser jp = createParserWithOptions(jsonInput, options)) {

0 commit comments

Comments
 (0)