diff --git a/openapi/src/main/java/io/helidon/openapi/OpenAPISupport.java b/openapi/src/main/java/io/helidon/openapi/OpenAPISupport.java index 5738e495bdc..401955c4c6e 100644 --- a/openapi/src/main/java/io/helidon/openapi/OpenAPISupport.java +++ b/openapi/src/main/java/io/helidon/openapi/OpenAPISupport.java @@ -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; @@ -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; } @@ -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: