{"record":{"id":"af604c644568f51b","repo":"floci-io/floci","slug":"validationexception-af604c","errorCode":"ValidationException","errorMessage":"1 validation error detected: Request payload must be a JSON object","messagePattern":"1 validation error detected: Request payload must be a JSON object","errorType":"validation","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/core/common/SharedTagsController.java","lineNumber":181,"sourceCode":"        if (handler.tagsBodyIsList()) {\n            ArrayNode arr = root.putArray(key);\n            tags.forEach((k, v) -> {\n                ObjectNode entry = arr.addObject();\n                entry.put(\"Key\", k);\n                entry.put(\"Value\", v);\n            });\n        } else {\n            ObjectNode tagsNode = root.putObject(key);\n            tags.forEach(tagsNode::put);\n        }\n        return root;\n    }\n\n    private Map<String, String> parseTags(TagHandler handler, JsonNode node) {\n        Map<String, String> tags = new HashMap<>();\n        String key = handler.tagsBodyKey();\n        if (handler.strictTagValidation() && !node.isObject()) {\n            throw new AwsException(\"ValidationException\",\n                    \"1 validation error detected: Request payload must be a JSON object\", 400);\n        }\n        JsonNode tagNode = node.get(key);\n        if (tagNode == null || tagNode.isNull()) {\n            if (handler.strictTagValidation()) {\n                throw new AwsException(\"ValidationException\",\n                        \"1 validation error detected: Value null at '\" + key + \"' failed to satisfy constraint: Member must not be null\", 400);\n            }\n            return tags;\n        }\n        if (handler.tagsBodyIsList()) {\n            if (!tagNode.isArray()) {\n                if (handler.strictTagValidation()) {\n                    throw new AwsException(\"ValidationException\",\n                            \"1 validation error detected: Value at '\" + key + \"' failed to satisfy constraint: Member must be a list\", 400);\n                }\n                return tags;\n            }","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/core/common/SharedTagsController.java#L163-L199","documentation":"Thrown by pipeline-declaration validation when pipeline.roleArn is missing or null. The roleArn is the pipeline's service role and is mandatory in both AWS and the emulator; the guard fires after the name check and before stage validation, so a missing role always fails first.","triggerScenarios":"CreatePipeline/UpdatePipeline request whose pipeline object omits roleArn or sets it to null; role built from an unset template variable.","commonSituations":"Quick local pipelines assembled without an IAM role because 'the emulator does not need one'; IaC modules where the role reference is optional in the module but required by the API; refactor renaming roleArn to role.","solutions":["Add pipeline.roleArn with any syntactically valid ARN, e.g. arn:aws:iam::123456789012:role/service-role/my-pipeline (the emulator does not verify the role exists)","Wire the role variable in your template/module so it is always set","Re-check the field after SDK model changes — it is hasNonNull, so empty string also fails validation only if null; prefer a full ARN"],"exampleFix":"# before\n{ \"pipeline\": { \"name\": \"p\", \"stages\": [...] } }\n\n# after\n{ \"pipeline\": { \"name\": \"p\", \"roleArn\": \"arn:aws:iam::123456789012:role/my-pipeline-role\", \"stages\": [...] } }","handlingStrategy":"validation","validationCode":"if (pipeline.roleArn() == null || !pipeline.roleArn().startsWith(\"arn:\")) {\n    pipeline = pipeline.toBuilder()\n        .roleArn(\"arn:aws:iam::123456789012:role/emulator-pipeline-role\")\n        .build();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default the roleArn in your pipeline module/template; the emulator accepts any well-formed ARN","Add a pre-submit check that roleArn is present for every pipeline resource"],"tags":["codepipeline","validation","required-field","rolearn"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}