quarkusio/quarkus · error · IllegalArgumentException
Unknown JSON Value
Error message
Unknown JSON Value
What it means
VertxJson is the Jsonb serializer/deserializer bridge for Vert.x JsonObject/JsonArray in RESTEasy Reactive. During recursive copy of a JsonArray, an element whose JSON kind does not match the handled cases (OBJECT, ARRAY, STRING, NUMBER, etc.) falls into the default branch and throws IllegalArgumentException. It indicates an unhandled JsonValue type reaching the copier.
Source
Thrown at extensions/resteasy-reactive/rest-jsonb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/runtime/serialisers/VertxJson.java:107
JsonNumber number = origin.getJsonNumber(i);
if (number.isIntegral()) {
array.add(number.longValue());
} else {
array.add(number.doubleValue());
}
break;
case ARRAY:
JsonArray newArray = new JsonArray();
copy(newArray, origin.getJsonArray(i));
array.add(newArray);
break;
case OBJECT:
JsonObject newObject = new JsonObject();
copy(newObject, origin.getJsonObject(i));
array.add(newObject);
break;
default:
throw new IllegalArgumentException("Unknown JSON Value " + kind);
}
}
}
public static class JsonObjectSerializer implements JsonbSerializer<JsonObject> {
@Override
public void serialize(JsonObject json, JsonGenerator generator, SerializationContext ctxt) {
ctxt.serialize(json.getMap(), generator);
}
}
public static class JsonArrayDeserializer implements JsonbDeserializer<JsonArray> {
@Override
public JsonArray deserialize(JsonParser parser, DeserializationContext context, Type type) {
JsonArray object = new JsonArray();
copy(object, parser.getArray());
return object;View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the JSON payload and remove or convert the unsupported element type
- Check the Vert.x JsonObject value kind enumeration and add a case for the missing kind in VertxJson.copy
- Upgrade Quarkus and Vert.x to aligned versions so all JSON value kinds are handled
Example fix
// before
default:
throw new IllegalArgumentException("Unknown JSON Value " + kind);
// after
default:
array.add(origin.getValue(i)); // or handle the kind explicitly
break; Defensive patterns
Strategy: validation
Validate before calling
// Check each element kind before serializing
array.forEach { v ->
val kind = v?.let { io.vertx.core.json.JsonObject::class } // verify only known kinds
require(v == null || v is String || v is Number || v is Boolean || v is JsonObject || v is JsonArray) {
"Unsupported JSON element kind"
}
} Type guard
fun isSupportedJsonElement(v: Any?): Boolean =
v == null || v is String || v is Number || v is Boolean || v is JsonObject || v is JsonArray Prevention
- Build JsonArray values only from primitives, JsonObject, and JsonArray
- Pin aligned Quarkus/Vert.x versions
- Add integration tests round-tripping complex JSON payloads
When it happens
Trigger: Serializing/deserializing a Vert.x JsonArray containing an element whose JSON kind is not one of the cases handled by copy(), e.g. an unusual or malformed JsonValue variant.
Common situations: Sending JSON payloads with element types the Vert.x parser maps to kinds the copier does not expect; version drift between Vert.x JSON model and the serializer; hand-built JsonObject/JsonArray instances passed to JAX-RS endpoints.
Related errors
- Failed to encode as JSON:
- Cannot create JsonArray
- Cannot create JsonObject
- Unknown JSON Value ${kind}
- HTTP Security policy applied only on Quarkus REST cannot be
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/2a55682f807296e1.
Report an issue: GitHub.