{"record":{"id":"1e61c81484f7f997","repo":"quarkusio/quarkus","slug":"array-of-unsupported-type-typestr-on","errorCode":null,"errorMessage":"Array of unsupported type: \" + typeStr + \" on \" + errorLocation","messagePattern":"Array of unsupported type: \" \\+ typeStr \\+ \" on \" \\+ errorLocation","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client-jaxrs/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java","lineNumber":2340,"sourceCode":"            // file is sent as file :)\n            ResultHandle filePath = bytecodeCreator.invokeVirtualMethod(\n                    MethodDescriptor.ofMethod(File.class, \"toPath\", Path.class), fieldValue);\n            addFile(bytecodeCreator, multipartForm, formParamName, mimeType, partFilename, filePath);\n        } else if (typeStr.equals(Path.class.getName())) {\n            // and so is path\n            addFile(bytecodeCreator, multipartForm, formParamName, mimeType, partFilename, fieldValue);\n        } else if (typeStr.equals(FileUpload.class.getName())) {\n            addFileUpload(fieldValue, multipartForm, methodCreator);\n        } else if (typeStr.equals(InputStream.class.getName())) {\n            // and so is path\n            addInputStream(bytecodeCreator, multipartForm, formParamName, mimeType, partFilename, fieldValue, typeStr);\n        } else if (typeStr.equals(Buffer.class.getName())) {\n            // and buffer\n            addBuffer(bytecodeCreator, multipartForm, formParamName, mimeType, partFilename, fieldValue, errorLocation);\n        } else if (typeStr.startsWith(\"[\")) {\n            // byte[] can be sent as file too\n            if (!typeStr.equals(\"[B\")) {\n                throw new IllegalArgumentException(\"Array of unsupported type: \" + typeStr\n                        + \" on \" + errorLocation);\n            }\n            ResultHandle buffer = bytecodeCreator.invokeStaticInterfaceMethod(\n                    MethodDescriptor.ofMethod(Buffer.class, \"buffer\", Buffer.class, byte[].class),\n                    fieldValue);\n            addBuffer(bytecodeCreator, multipartForm, formParamName, mimeType, partFilename, buffer, errorLocation);\n        } else if (MULTI_BYTE_SIGNATURE.equals(parameterSignature)) {\n            addMultiAsFile(bytecodeCreator, multipartForm, formParamName, mimeType, partFilename, fieldValue,\n                    errorLocation);\n        } else if (typeStr.equals(EntityPart.class.getName())) {\n            bytecodeCreator.invokeStaticMethod(\n                    MethodDescriptor.ofMethod(ClientSendRequestHandler.class, \"addEntityPartToForm\",\n                            void.class, QuarkusMultipartForm.class, EntityPart.class),\n                    multipartForm, fieldValue);\n        } else if (mimeType != null) {\n            if (partFilename != null) {\n                log.warnf(\"Using the @PartFilename annotation is unsupported on the type '%s'. Problematic field is: '%s'\",\n                        mimeType, formParamName);","sourceCodeStart":2322,"sourceCodeEnd":2358,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client-jaxrs/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java#L2322-L2358","documentation":"When encoding a multipart form field, Quarkus supports byte[] (via Buffer) but not arrays of other types. If the field's type string denotes any array other than byte[] (not \"[B\"), the code generator cannot serialize it and throws.","triggerScenarios":"A @MultipartForm bean field (or bean param field) of type int[], String[], SomeObject[], etc., sent through a REST client multipart upload.","commonSituations":"Trying to upload multiple values as a primitive/object array in a multipart form; refactoring a JSON body DTO to be reused as a multipart form DTO.","solutions":["Change the field type to List<SupportedType> (e.g. List<String>, List<FileUpload>) which multipart supports as repeated parts","Convert arrays to byte[] only if you truly want raw bytes, and use byte[] (mapped to io.vertx.core.buffer.Buffer)","Serialize the array yourself to JSON/String and send as a single String part"],"exampleFix":"// before\n@RestForm\nString[] tags;\n// after\n@RestForm\nList<String> tags;","handlingStrategy":"validation","validationCode":"static void validateMultipartFields(Class<?> formBean) {\n    for (var f : formBean.getDeclaredFields()) {\n        if (f.getType().isArray() && f.getType() != byte[].class) {\n            throw new IllegalArgumentException(\n                \"Multipart field \" + f.getName() + \" cannot be array \" + f.getType() + \"; use List<T> or byte[]\");\n        }\n    }\n}","typeGuard":"static boolean multipartSafe(Class<?> t) {\n    if (t.isArray()) return t == byte[].class;\n    return true; // further checks per supported types\n}","tryCatchPattern":null,"preventionTips":["Use List<T> instead of T[] for repeated multipart parts","Use byte[] only for raw binary content","Keep multipart DTOs separate from JSON DTOs to avoid unsupported field kinds"],"tags":["quarkus","rest-client","multipart","unsupported-type"],"backgroundTag":"unsupported-multipart-field-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}