diff --git a/hivemq-edge/src/main/java/com/hivemq/api/model/mappings/fieldmapping/FieldMappingModel.java b/hivemq-edge/src/main/java/com/hivemq/api/model/mappings/fieldmapping/FieldMappingModel.java index f1ca43561..7d89d8c17 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/model/mappings/fieldmapping/FieldMappingModel.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/model/mappings/fieldmapping/FieldMappingModel.java @@ -21,18 +21,19 @@ import org.jetbrains.annotations.NotNull; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; @Schema(name = "FieldMapping") public class FieldMappingModel { - @JsonProperty(value = "instructions", required = true) + @JsonProperty(value = "instructions") @Schema(description = "List of instructions to be applied to incoming data") private final @NotNull List instructions; public FieldMappingModel( - @JsonProperty(value = "instructions", required = true) final @NotNull List instructions) { - this.instructions = instructions; + @JsonProperty(value = "instructions") final @NotNull List instructions) { + this.instructions = Objects.requireNonNullElse(instructions, List.of()); } public @NotNull List getInstructions() {