{"record":{"id":"b7786921f39c56e6","repo":"quarkusio/quarkus","slug":"unknown-json-value-kind-b77869","errorCode":null,"errorMessage":"Unknown JSON Value {kind}","messagePattern":"Unknown JSON Value (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-jsonb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/runtime/serialisers/VertxJson.java","lineNumber":66,"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":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-jsonb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/runtime/serialisers/VertxJson.java#L48-L84","documentation":"VertxJson converts jakarta.json values into Vert.x JsonObject/JsonArray by recursively copying entries. Its copy switch handles NULL, TRUE, FALSE, STRING, NUMBER, and OBJECT kinds; if a jakarta.json value has another kind (i.e. ARRAY appearing in the object-entry copy path, or any future/unexpected kind), it throws IllegalArgumentException \"Unknown JSON Value <kind>\". This indicates a conversion gap, typically when a jakarta.json array is nested inside a JsonObject being converted to a Vert.x JsonObject.","triggerScenarios":"Calling the VertxJson serializer/converter on a jakarta.json JsonObject that contains a nested jakarta.json.JsonArray value (the object-copy switch lacks an ARRAY case), producing the error at runtime during request body reading/writing.","commonSituations":"Using jakarta.json (Json-P) structures with JSON-B/RESTEasy Reactive JSON-B endpoints where nested arrays exist inside objects; differences between Json-P and Vert.x JSON APIs when bridging both JSON stacks in one app; building payloads with Json.createObjectBuilder().add(\"list\", arrayBuilder).","solutions":["Avoid nesting jakarta.json.JsonArray inside a jakarta.json JsonObject passed to VertxJson; build the structure directly as Vert.x JsonObject/JsonArray","Convert with jakarta.json's own toString()/reader and parse into Vert.x types (new JsonObject(jsonString)) instead of using VertxJson.copy","Upgrade Quarkus — check if a fixed version handles ARRAY in this copy path; if not, file a bug with a reproducer","Flatten the payload so object entries are only scalars, nulls, booleans, or nested objects before conversion"],"exampleFix":"// before\nJsonObject origin = Json.createObjectBuilder().add(\"tags\", Json.createArrayBuilder().add(\"a\")).build();\nVertxJson.copy(vertxObject, origin); // throws: Unknown JSON Value ARRAY\n\n// after\nio.vertx.core.json.JsonObject v = new io.vertx.core.json.JsonObject(origin.toString());","handlingStrategy":"try-catch","validationCode":"static void assertNoNestedArrays(jakarta.json.JsonObject o) {\n    for (String k : o.keySet()) {\n        if (o.get(k) instanceof jakarta.json.JsonArray)\n            throw new IllegalArgumentException(\"Nested jakarta.json arrays are unsupported by VertxJson.copy: \" + k);\n    }\n}","typeGuard":"static boolean isVertxCopySafe(jakarta.json.JsonValue v) {\n    if (v instanceof jakarta.json.JsonObject o)\n        return o.values().stream().noneMatch(x -> x instanceof jakarta.json.JsonArray);\n    return !(v instanceof jakarta.json.JsonArray);\n}","tryCatchPattern":"try {\n    VertxJson.copy(target, origin);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Unknown JSON Value\")) {\n        io.vertx.core.json.JsonObject fallback = new io.vertx.core.json.JsonObject(origin.toString());\n    }\n}","preventionTips":["Prefer building Vert.x JsonObject/JsonArray directly when both JSON stacks are in play","Round-trip via JSON string (origin.toString() -> new JsonObject(...)) for mixed Json-P/Vert.x payloads","Avoid nesting jakarta.json.JsonArray inside objects passed to VertxJson","Add a conversion unit test covering nested arrays"],"tags":["jsonb","vertx","json","conversion"],"backgroundTag":"unsupported-json-value-kind","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}