Skip to content

Commit

Permalink
backport changes from 4.x
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin committed Sep 21, 2023
1 parent 093b41b commit c41707f
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions openapi/src/main/java/io/helidon/openapi/OpenAPISupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -562,12 +562,6 @@ private static class HelidonAnnotationScannerExtension implements AnnotationScan

@Override
public Object parseValue(String value) {
return parseExtension(null, value);
}

@Override
public Object parseExtension(String key, String value) {

// Inspired by SmallRye's JsonUtil#parseValue method.
if (value == null) {
return null;
Expand Down Expand Up @@ -599,10 +593,9 @@ public Object parseExtension(String key, String value) {
JsonValue jsonValue = reader.readValue();
return convertJsonValue(jsonValue);
} catch (Exception ex) {
LOGGER.log(Level.SEVERE, String.format("Error parsing extension key: %s, value: %s", key, value), ex);
LOGGER.log(Level.SEVERE, String.format("Error parsing value: %s", value), ex);
throw ex;
}
break;

default:
break;
}
Expand All @@ -611,6 +604,18 @@ public Object parseExtension(String key, String value) {
return value;
}

@Override
public Object parseExtension(String key, String value) {
try {
return parseValue(value);
} catch (Exception ex) {
LOGGER.log(Level.SEVERE,
String.format("Error parsing extension key: %s, value: %s", key, value),
ex);
return null;
}
}

private static Object convertJsonValue(JsonValue jsonValue) {
switch (jsonValue.getValueType()) {
case ARRAY:
Expand Down

0 comments on commit c41707f

Please sign in to comment.