Skip to content

Commit

Permalink
ensure hosts is list of length 1
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell Brown <[email protected]>
  • Loading branch information
Galactus22625 committed Jan 25, 2025
1 parent e9f389e commit a8b00f1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.Valid;
import jakarta.validation.constraints.AssertTrue;
import lombok.Getter;
import org.opensearch.dataprepper.plugins.source.jira.configuration.AuthenticationConfig;
import org.opensearch.dataprepper.plugins.source.jira.configuration.FilterConfig;
Expand All @@ -31,6 +32,11 @@ public class JiraSourceConfig implements CrawlerSourceConfig {
@JsonProperty("hosts")
private List<String> hosts;

@AssertTrue(message = "Jira hosts must be a list of length 1")
boolean isValidHosts() {
return hosts != null && hosts.size() == 1;
}

/**
* Authentication Config to Access Jira
*/
Expand Down

0 comments on commit a8b00f1

Please sign in to comment.