{"record":{"id":"c0354ceb948307fc","repo":"quarkusio/quarkus","slug":"unknown-json-value-kind","errorCode":null,"errorMessage":"Unknown JSON Value ${kind}","messagePattern":"Unknown JSON Value (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-classic/resteasy-jsonb/runtime/src/main/java/io/quarkus/resteasy/jsonb/vertx/VertxJson.java","lineNumber":73,"sourceCode":"                    JsonNumber number = origin.getJsonNumber(key);\n                    if (number.isIntegral()) {\n                        object.put(key, number.longValue());\n                    } else {\n                        object.put(key, number.doubleValue());\n                    }\n                    break;\n                case ARRAY:\n                    JsonArray array = new JsonArray();\n                    copy(array, origin.getJsonArray(key));\n                    object.put(key, array);\n                    break;\n                case OBJECT:\n                    JsonObject json = new JsonObject();\n                    copy(json, origin.getJsonObject(key));\n                    object.put(key, json);\n                    break;\n                default:\n                    throw new IllegalArgumentException(\"Unknown JSON Value \" + kind);\n            }\n        });\n    }\n\n    public static void copy(JsonArray array, jakarta.json.JsonArray origin) {\n        for (int i = 0; i < origin.size(); i++) {\n            JsonValue value = origin.get(i);\n            JsonValue.ValueType kind = value.getValueType();\n            switch (kind) {\n                case STRING:\n                    array.add(origin.getString(i));\n                    break;\n                case TRUE:\n                    array.add(true);\n                    break;\n                case FALSE:\n                    array.add(false);\n                    break;","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-classic/resteasy-jsonb/runtime/src/main/java/io/quarkus/resteasy/jsonb/vertx/VertxJson.java#L55-L91","documentation":"VertxJson.copy(JsonObject, jakarta.json.JsonObject) converts a Jakarta JSON object into a Vert.x JsonObject by switching on each value's JsonValue.ValueType kind. If a value has a kind the switch does not handle (anything other than STRING, NUMBER, TRUE, FALSE, NULL, OBJECT), it throws this IllegalArgumentException. It means the JSON document contained a value type the converter cannot map.","triggerScenarios":"Calling VertxJson.copy(JsonObject, jakarta.json.JsonObject) on a JsonObject containing a jakarta.json value whose ValueType falls through the switch — in practice an unhandled kind such as a JSON array nested where only scalar/object cases were coded, or unusual JsonValue implementations.","commonSituations":"Converting JSON-P structures built by other libraries that produce JsonValue subtypes (e.g. JsonNumber variants or custom implementations) which don't map to the expected enum branches; version changes in jakarta.json introducing new value kinds.","solutions":["Inspect the jakarta.json document and normalize unsupported value kinds before copying (e.g. convert arrays/scalars explicitly).","Extend or replace the conversion: write your own mapper using jsonValue.valueType() covering ARRAY, or use JsonObject.wrap()/Json.createValue conversions.","Report/patch the switch in VertxJson to handle the missing ValueType case."],"exampleFix":"// before\nswitch (origin.get(key).getValueType()) { /* no ARRAY case */ }\n\n// after: guard before copy\nJsonValue v = origin.get(key);\nif (v.getValueType() == JsonValue.ValueType.ARRAY) {\n    object.put(key, VertxJson.copy(new JsonArray(), v.asJsonArray()));\n} else {\n    copyInto(object, key, v);\n}","handlingStrategy":"validation","validationCode":"static boolean isCopyable(JsonObject origin) {\n    return origin.entrySet().stream()\n        .allMatch(e -> EnumSet.of(JsonValue.ValueType.STRING, JsonValue.ValueType.NUMBER,\n                JsonValue.ValueType.TRUE, JsonValue.ValueType.FALSE,\n                JsonValue.ValueType.NULL, JsonValue.ValueType.OBJECT)\n            .contains(e.getValue().getValueType()));\n}","typeGuard":"static boolean isSupportedKind(JsonValue v) {\n    JsonValue.ValueType t = v.getValueType();\n    return t != JsonValue.ValueType.ARRAY; // ARRAY (and any unhandled kind) is not supported by this copy()\n}","tryCatchPattern":"try {\n    VertxJson.copy(target, jakartaObject);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unknown JSON Value\")) {\n        throw new IllegalStateException(\"Document contains an unsupported JSON value kind: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Avoid nested JSON arrays when converting Jakarta JSON objects with this helper","Pre-normalize documents to the supported value kinds before conversion","Write a recursive converter that covers all JsonValue.ValueType cases"],"tags":["json","vertx","jsonb","conversion"],"backgroundTag":"unsupported-json-value-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}