diff --git a/dotCMS/src/main/java/com/dotcms/workflow/form/FireActionForm.java b/dotCMS/src/main/java/com/dotcms/workflow/form/FireActionForm.java index cc13d5e2c316..5c38e9a1056f 100644 --- a/dotCMS/src/main/java/com/dotcms/workflow/form/FireActionForm.java +++ b/dotCMS/src/main/java/com/dotcms/workflow/form/FireActionForm.java @@ -1,6 +1,7 @@ package com.dotcms.workflow.form; import com.dotmarketing.business.PermissionAPI; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.dotcms.rest.api.Validated; @@ -8,6 +9,11 @@ import java.util.List; import java.util.Map; +/** + * Form to fire an action in the workflow + * @author jsanca + */ +@JsonIgnoreProperties(ignoreUnknown = true) @JsonDeserialize(builder = FireActionForm.Builder.class) public class FireActionForm extends Validated { @@ -108,6 +114,7 @@ public FireActionForm(final Builder builder) { this.individualPermissions = builder.individualPermissions; } + @JsonIgnoreProperties(ignoreUnknown = true) public static class Builder { @JsonProperty() diff --git a/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json b/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json index c576f63c1873..995596c60da5 100644 --- a/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json +++ b/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json @@ -1,10 +1,10 @@ { "info": { - "_postman_id": "2a422520-eec4-42b3-94c3-5126f2691138", + "_postman_id": "e53e1b4d-87ee-4920-9477-917bb7ad4d95", "name": "Workflow Resource Tests [/api/v1/workflows]", "description": "Test the necesary validations to every end point of the worlflow resource ", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "4500400" + "_exporter_id": "781456" }, "item": [ { @@ -17470,6 +17470,71 @@ } } ] + }, + { + "name": "FireWithUnknowProps", + "item": [ + { + "name": "SuccessRequestWithUnknownProps", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200 \", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{jwt}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"contentlet\": {\n \"contentType\": \"webPageContent\",\n \"contentHost\": \"default\",\n \"title\": \"Test Title\",\n \"body\": \"Test Body\"\n },\n \"unknowprop1\":\"blablalba\",\n \"anotherunknown\":\"toktoktok\",\n \"comments\":\"This is a comment\"\n\n}" + }, + "url": { + "raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/PUBLISH", + "host": [ + "{{serverURL}}" + ], + "path": [ + "api", + "v1", + "workflow", + "actions", + "default", + "fire", + "PUBLISH" + ] + }, + "description": "Fire any action using the actionId\n\nOptional: If you pass ?inode={inode}, you don't need body here.\n\n@Path(\"/actions/{actionId}/fire\")" + }, + "response": [] + } + ] } ], "event": [