Skip to content

Commit

Permalink
fix(s3): missing NotNull for bucket and key
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Aug 16, 2024
1 parent ac0b919 commit 6b500a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import io.kestra.core.models.annotations.PluginProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

public interface AbstractS3ObjectInterface extends AbstractS3 {
@Schema(
title = "The S3 bucket name."
)
@PluginProperty(dynamic = true)
@NotNull
String getBucket();

@Schema(
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/io/kestra/plugin/aws/s3/Copy.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.kestra.core.runners.RunContext;
import io.kestra.plugin.aws.AbstractConnection;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.SuperBuilder;
import software.amazon.awssdk.services.s3.S3Client;
Expand Down Expand Up @@ -105,12 +106,14 @@ public static class CopyObject {
title = "The bucket name"
)
@PluginProperty(dynamic = true)
@NotNull
String bucket;

@Schema(
title = "The bucket key"
)
@PluginProperty(dynamic = true)
@NotNull
String key;
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/kestra/plugin/aws/s3/CreateBucket.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.kestra.core.runners.RunContext;
import io.kestra.plugin.aws.AbstractConnection;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.SuperBuilder;
import software.amazon.awssdk.services.s3.S3Client;
Expand Down Expand Up @@ -39,6 +40,7 @@ public class CreateBucket extends AbstractConnection implements AbstractS3, Runn
description = "The S3 bucket name to create."
)
@PluginProperty(dynamic = true)
@NotNull
private String bucket;

@Schema(
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/kestra/plugin/aws/s3/Delete.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.kestra.core.models.tasks.RunnableTask;
import io.kestra.core.runners.RunContext;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.SuperBuilder;
import software.amazon.awssdk.services.s3.S3Client;
Expand Down Expand Up @@ -38,6 +39,7 @@ public class Delete extends AbstractS3Object implements RunnableTask<Delete.Outp
title = "The key to delete."
)
@PluginProperty(dynamic = true)
@NotNull
private String key;

@Schema(
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/kestra/plugin/aws/s3/Download.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.kestra.core.models.tasks.RunnableTask;
import io.kestra.core.runners.RunContext;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.tuple.Pair;
Expand Down Expand Up @@ -43,6 +44,7 @@ public class Download extends AbstractS3Object implements RunnableTask<Download.
title = "The key of a file to download."
)
@PluginProperty(dynamic = true)
@NotNull
private String key;

@Schema(
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/io/kestra/plugin/aws/s3/Upload.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.kestra.core.runners.RunContext;
import io.kestra.core.serializers.JacksonMapper;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.apache.commons.io.FilenameUtils;
Expand Down Expand Up @@ -57,13 +58,15 @@ public class Upload extends AbstractS3Object implements RunnableTask<Upload.Outp
anyOf = {List.class, String.class}
)
@PluginProperty(dynamic = true)
@NotNull
private Object from;

@Schema(
title = "The key where to upload the file.",
description = "a full key (with filename) or the directory path if from is multiple files."
)
@PluginProperty(dynamic = true)
@NotNull
private String key;

@Schema(
Expand Down

0 comments on commit 6b500a4

Please sign in to comment.