Skip to content

Commit af9db8a

Browse files
committed
Backport parsing enhancement from 4.x
1 parent 40614a9 commit af9db8a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

openapi/src/main/java/io/helidon/openapi/OpenAPISupport.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,12 @@ public Object parseValue(String value) {
591591
try {
592592
JsonReader reader = JSON_READER_FACTORY.createReader(new StringReader(value));
593593
JsonValue jsonValue = reader.readValue();
594+
// readValue will truncate the input to convert to a number if it can. Make sure the value is the same
595+
// length as the original.
596+
if (jsonValue.getValueType().equals(JsonValue.ValueType.NUMBER)
597+
&& value.length() != jsonValue.toString().length()) {
598+
return value;
599+
}
594600
return convertJsonValue(jsonValue);
595601
} catch (Exception ex) {
596602
LOGGER.log(Level.SEVERE, String.format("Error parsing value: %s", value), ex);

0 commit comments

Comments
 (0)