{"record":{"id":"1dea8b7787babb0d","repo":"kestra-io/kestra","slug":"unsupported-type-for-key-entry-getkey-value","errorCode":null,"errorMessage":"Unsupported type for key: {entry.getKey()}, value: {value}","messagePattern":"Unsupported type for key: (.+?), value: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/serializers/ListOrMapOfLabelDeserializer.java","lineNumber":54,"sourceCode":"                }\n            }).toList();\n        } else if (p.hasToken(JsonToken.START_OBJECT)) {\n            // deserialize as map\n            Map<String, Object> ret = ctxt.readValue(p, Map.class);\n            return ret == null ? null\n                : ret.entrySet().stream()\n                    .map(this::validateAndCreateLabel)\n                    .toList();\n        }\n        throw new IllegalArgumentException(\"Unable to deserialize value as it's neither an object neither an array\");\n    }\n\n    private Label validateAndCreateLabel(Map.Entry<String, Object> entry) {\n        Object value = entry.getValue();\n        if (isAllowedType(value)) {\n            return new Label(entry.getKey(), String.valueOf(value));\n        } else {\n            throw new IllegalArgumentException(\"Unsupported type for key: \" + entry.getKey() + \", value: \" + value);\n        }\n    }\n\n    private static boolean isAllowedType(Object value) {\n        return value instanceof String ||\n            value instanceof Integer ||\n            value instanceof Long ||\n            value instanceof Float ||\n            value instanceof Double ||\n            value instanceof Boolean;\n    }\n\n    @Override\n    public void resolve(DeserializationContext ctxt) throws JsonMappingException {\n    }\n}\n","sourceCodeStart":36,"sourceCodeEnd":71,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/serializers/ListOrMapOfLabelDeserializer.java#L36-L71","documentation":"The `ListOrMapOfLabelDeserializer` parses the map form of labels (a JSON object of `{key: value}`). Each value is type-checked by `isAllowedType()`, which accepts String, Integer, Long, Float, Double, and Boolean. If a value is a nested object, array, or null, an `IllegalArgumentException` is thrown via `validateAndCreateLabel` with the offending key and value. This is the map-form counterpart of error 229 (which is the array-form error).","triggerScenarios":"Submitting labels as a JSON map where one value is a nested object or array, e.g. `{\"meta\": {\"nested\": true}}`. Providing a null value for a key in the map form.","commonSituations":"A flow YAML uses a nested structure for a label value instead of a flat scalar. An API consumer serializes a complex object where a string is expected.","solutions":["Ensure every label value in the map form is a scalar: String, number, or boolean.","If you need complex metadata, serialize it to a JSON string.","Avoid null values for label keys — omit the key entirely instead."],"exampleFix":"# before\nlabels:\n  meta:\n    nested: true\n# after\nlabels:\n  meta: '{\"nested\":true}'","handlingStrategy":"validation","validationCode":"// Validate label values in map form before submission\npublic static Map<String, Object> validateLabelMap(Map<String, Object> labels) {\n    labels.forEach((key, value) -> {\n        if (!(value instanceof String || value instanceof Integer || value instanceof Long\n            || value instanceof Float || value instanceof Double || value instanceof Boolean)) {\n            throw new IllegalArgumentException(\n                \"Label '\" + key + \"' has unsupported value type: \" + value.getClass());\n        }\n    });\n    return labels;\n}","typeGuard":"function isAllowedLabelValue(v: unknown): boolean {\n    const t = typeof v;\n    return t === 'string' || t === 'number' || t === 'boolean';\n}","tryCatchPattern":null,"preventionTips":["Ensure every label value in the map form is a scalar.","Avoid null values — omit the key instead.","Serialize complex metadata to a JSON string before using as a label value."],"tags":["labels","deserializer","jackson","type-error","validation"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}